function shop_ImagePopup(id,type,name)
{  
	var fs=window.open('/shop/index.php/fuseaction/shop.image/type/'+type+'/imageid/'+id,'image','directories=no,height=780,width=640,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no');
	fs.focus();
}

function shop_ConfAct(location,message)
{
	var answer = confirm (message)
	if (answer)
		window.location=location;
}

function shop_FormConfAct(messageid,verb,noun,actor)
{
	if(messageid==1)
		var message="Are you sure you want to "+verb+" this "+noun+" "+actor+"?";
	else if(messageid==2)
		var message="Are you sure you want to "+verb+" your "+noun;

	return confirm (message)
}

function trim(str)
{
	while(''+str.charAt(0)==' ')
		str=str.substring(1,str.length);
	while(''+str.charAt(str.length-1)==' ')
		str=str.substring(0,str.length-1);
	return str;
}

/**
 * Validation related functions
 */

function showError(id)
{
	document.getElementById(id+'_error').style.visibility='visible';
}

function hideError(id)
{
	document.getElementById(id+'_error').style.visibility='hidden';
}

function appendError(text,errordiv)
{
	listNode = document.getElementById(errordiv+'_ul');
	itemNode = document.createElement('li');
	itemNode.appendChild(document.createTextNode(text));
	listNode.appendChild(itemNode);
}