function addToShoppingCard(idx)
{
	if(window.location.href.indexOf("shopping_cart") != "-1")
		window.location = "basket.php?op=add&id=" + idx + "&shopping_cart=true";	
	else
		window.frames["shop_frame"].location="basket.php?op=add&id="+ idx;
	window.location = "#";
	return false;
}
function delAllShoppingCard()
{
	if(window.parent.location.href.indexOf("shopping_cart") != "-1")
		window.parent.location="basket.php?op=delAll&shopping_cart=true";
	else
		window.location="basket.php?op=delAll";
	
	return false;
}
function editShoppingCardCount(idx, type)
{
	if(window.parent.location.href.indexOf("shopping_cart") != "-1")
		window.parent.location="basket.php?op=edit&id="+ idx + "&type=" + type + "&shopping_cart=true";
	else
		window.location="basket.php?op=edit&id="+ idx + "&type=" + type;
	return false;
}
function deleteFromShoppingCard(idx)
{
	window.location="basket.php?op=del&id="+ idx;
	return false;
}
function openPopUp_520x390(href, target)
{
	window.open(href, target, 'width=520, height=390, top=0, toolbar=0, location=0, directories=0, status=1, menuBar=0, scrollBars=1, resizable=0');
	return false;
}
function InvalidEmail(elm)
{
	if (elm.value.indexOf("@") <= 0 || elm.value.indexOf(".") <= 0 || elm.value.indexOf("@.") > 0 || elm.value.indexOf(".@") > 0)
		return true;
	else
		return false;
}
function InvalidPassword(elm)
{
	if (elm.value.length < 6)
		return true;
	else
		return false;
}
function IsEmpty(elm)
{
	if (elm.value == "" || elm.value == null)
		return true;
	else
		return false;
}
function errorMsg(element, errmsg)
{
	alert(errmsg);
	element.focus();
	return false;
}
