var strBuisness = "sales@magicalmountain.net";
var strReturnURL = "http://www.magicalmountain.net/Emporium/EmporiumComplete.asp";
var strCancelReturnURL = "http://www.magicalmountain.net/Emporium/EmporiumCancel.asp";
var strImageURL = "https://www.readysecure3.com/users/magicalmountiannet/PayPalEmporium.jpg";
var strNotifyURL = "http://www.magicalmountain.net/Emporium/EmporiumProcess.asp";
var blnAddCart = false;
var blnCartOpen = false;
var cart
var blnSearch = false

//document.cookie = "ScreenWidth=" + screen.width 

function ViewCart()
{	

		cart = window.open('https://www.paypal.com/cart/display=1&business='+ strBuisness + '&return=' + strReturnURL + '&cancel_return=' + strCancelReturnURL + '&image_url=' + strImageURL + '&notify_url=' + strNotifyURL,'cartwin','toolbar=no,scrollbars=yes,resizable=yes,width=640,height=400,top=0,left=0,status=yes');
		window.cart.focus()
	
}

function addtoCart(strProductName,intInventoryID,strProductPrice,strProductShipping)
{
	if (!blnAddCart)
	{
		if (intInventoryID!=401)
		{
			cart = window.open('https://www.paypal.com/cart/add=1&no_note=1&business=' + strBuisness + '&item_name=' + strProductName + '&item_number=' + intInventoryID + '&amount=' + strProductPrice + '&shipping=' + strProductShipping + '&return=' + strReturnURL + '&cancel_return=' + strCancelReturnURL + '&image_url=' + strImageURL + '&notify_url=' + strNotifyURL,'cartwin','width=640,height=400,top=0,left=0,toolbar=no,scrollbars=yes,resizable=yes,status=yes')
		}
		else
		{
			var strPersonalize = document.frmPersonalize.txtPersonalize.value
			cart = window.open('https://www.paypal.com/cart/add=1&no_note=1&business=' + strBuisness + '&item_name=' + strProductName + '&item_number=' + intInventoryID + '&amount=' + strProductPrice + '&shipping=' + strProductShipping + '&on0=Personalization%20Text&os0=' + strPersonalize + '&return=' + strReturnURL + '&cancel_return=' + strCancelReturnURL + '&image_url=' + strImageURL + '&notify_url=' + strNotifyURL,'cartwin','width=640,height=400,top=0,left=0,toolbar=no,scrollbars=yes,resizable=yes,status=yes')				
		}			
		
		if (intInventoryID!=401 && intInventoryID!=3310)
		{
			blnAddCart = true;
		}
		
		window.cart.focus()
	}
	else
	{
		alert('We apologize, but there is only one of these items available for purchase.')
	}	
	
}

function goEmporiumSearch(theForm)
{	
	if (theForm.EmporiumSearch.value=='')
	{
		alert('Please enter search criteria.')
		return false
	}
	return true
}
