// Open new explorer window
function OpenWindow(url)
{
	window.open(url , '', 'toolbar=no,status=no,titlebar=no,menubar=no,resizable=yes,scrollbars=yes');
}

function OpenWindow(url, width, height)
{
	window.open(url , '',  'width=' + width + ',height=' + height + ',toolbar=no,status=no,titlebar=no,menubar=no,resizable=yes,scrollbars=yes');
}

function OpenWindowSmall(url)
{
	window.open(url , '', 'width=10, height=10, left=0, top=0, toolbar=no,status=no,titlebar=no,menubar=no,resizable=yes,scrollbars=yes');
}

// cart
function OpenCartWindow(url)
{
	window.open(url , '', 'resizable=yes,scrollbars=yes,toolbar=yes,status=yes,titlebar=yes,menubar=yes,location=yes');
}

// Change image
function ChangeImage(image, text)
{         
	var imageElt;
	var textElt
    imageElt = document.getElementById(image);
    textElt = document.getElementById(text);
    imageElt.src = textElt.value;
}	

// click button from text box
function ClickButtonFromTextBox(e, buttonid)
{ 
	var bt = document.getElementById(buttonid); 
	if (typeof bt == 'object')
	{ 
		if(navigator.appName.indexOf("Netscape")>(-1))
		{ 
			if (e.keyCode == 13)
			{ 
				bt.click(); 
				return false; 
			} 
		} 
		if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1))
		{ 
			if (event.keyCode == 13)
			{ 
				bt.click(); 
				return false; 
			} 
		} 
	} 
} 

// pay pal
function SBPPAction(item_name, item_number, amount, shipping, size_control, size_item)
{   
	var vItemName;
	var vItemNumber
	var vAmount;
	
	if (document.all)
	{
		vItemName = document.getElementById('item_name');
		vItemName.value = item_name;
		vItemNumber = document.getElementById('item_number');
		vItemNumber.value = item_number;
		vAmount = document.getElementById('amount');
		vAmount.value = amount;
	}
	else
	{
		document.Form1.item_name.value = item_name;
		document.Form1.item_number.value = item_number;
		document.Form1.amount.value = amount;
	}
	
	
	if (document.all)
	{
		var vADID = document.getElementById('SBPPControl1:adid');
		if (vADID != "")
		{
			if (vADID.value != "")
			{
	
				var vCustom = document.getElementById('custom');
				vCustom.value = vADID.value;
			}
		}
	}
	else
	{
		if (document.Form1.adid.value != "")
		{
			document.Form1.custom.value = document.Form1.adid.value;
		}	
	}
	
	if (shipping != "")
	{
		if (document.all)
		{	
			var vShipping = document.getElementById('shipping');
			vShipping.value = shipping;
		
			var vNoShipping = document.getElementById('no_shipping');
			vNoShipping.value = "0";
		}
		else
		{
			document.Form1.shipping.value = shipping;
			document.Form1.no_shipping.value = "0";
		}	
	}
	
	if (size_control != "")
	{
		if (document.all)
		{
			var it = size_control + ":" + size_item;
			var vSize = document.getElementById(it);
			
			var von0 = document.getElementById('on0');
			von0.value = "Size";
			
			var vos0 = document.getElementById('os0');
			vos0.value = vSize.value;
		}
		else
		{
			document.Form1.on0.value = "Size";
			var item = eval('document.Form1.' + size_control + '_' + size_item +'.value');
			document.Form1.os0.value = item;
		}					
	}
	
	var theform;
	if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) 
	{
		theform = document.Form1;
	}
	else 
	{
		theform = document.forms["Form1"];
	} 
	
	
	theform.action = 'https://www.paypal.com/cgi-bin/webscr';
	theform.target = 'paypal';
	theform.__VIEWSTATE.name = 'NOVIEWSTATE';
}

