function popup()
{
	window.open ("customers.php","pop","HEIGHT=450,WIDTH=550,screenX=20,screenY=5,status=yes,scrollbars=yes,toolbar=no,directories=no,menubar=no,location=no");
}

/* start code for display popup window when purchasing hedstrom pad shells by Minhaj 4-June-2009 */
function addLink() {
	document.fhtshells.submit();
}

var counter =1;
function checkselect(theform)
{
	if(counter == 1)
	{
	counter=2;
		if(theform.name=='fhtshells'){
		window.open ("alert_hedpad.php","pop",'left=250,top=100,width=400,height=300,toolbar=1,resizable=0');
		return false;
		}
	}

	if (theform.pidxx.selectedIndex<=0)
	{
		alert ("Please choose the size!");
		return false;
	}
	return true;
}

/* end code for display popup window when purchasing hedstrom pad shells by Minhaj 4-June-2009 */



function bigMeasure()
{
	window.open("bigmeasure.php","big","toolbar=no, menubar=no, resize=true, width=490, height=605,scrollbars=yes");
}
function contactUsRect()
{
	window.open("rectangular_trampoline_pad.php","big","toolbar=no, menubar=no, resize=true, width=420, height=400,scrollbars=yes");
}

function contactUsOct()
{
	window.open("Popup.php?pad=octa","big","toolbar=no, menubar=no, resize=true, width=423, height=391,scrollbars=yes");
}
function comparisonPopUp()
{
    window.open("pad_comparison_chart.php","big","toolbar=no, menubar=no,width=576,height=536,status=no",false)
}

	function getpid(formName,allow,cartQty,btnval)
{
	var frmObj  =  eval( "document." + formName );
	frmObj.btn.value = btnval.value;
    if(btnval.value=="View Cart")
	{
		if(cartQty==0)
		{
			alert("Your shopping cart is currently empty");
			return false;
		}
		else
		{
			window.open("shopping_cart.php", "_self");
			return true;
		}
	}

	if(frmObj.pidxx.type=="select-one")
	{
		pidxxval=frmObj.pidxx.value;
	}
	else
	{
		//oObj= frmObj.all("pidxx");
		oObj= frmObj.pidxx;
		if(oObj!=null)
		{
			pidxxval=0
			for (i=0;i<oObj.length;i++ )
			{
				if(frmObj.pidxx[i].checked==true)
				{
					pidxxval=frmObj.pidxx[i].value
					break;
				}
			}
		}
	}
	if ((pidxxval) <= 0)
	{
		alert ("Please choose pad!");
		return false;
	}


	if (frmObj.pquantity.value=="" || frmObj.pquantity.value==0)
	{
		alert ("Please enter the quantity!");
		frmObj.pquantity.value ='';
		frmObj.pquantity.focus();
		return false;
	}
	if (frmObj.pquantity.value.indexOf('.') >= 1)
	{
		alert ("Please enter the Whole Number for quantity!");
		frmObj.pquantity.value ='';
		frmObj.pquantity.focus();
		return false;
	}
	if (!(frmObj.pquantity.value <= 99999 && frmObj.pquantity.value >= 0))
	{
		alert("Please enter a numeric value for quantity");
		frmObj.pquantity.value ='';
		frmObj.pquantity.focus();
		return false;
	}
	
	return true;
}

function getpid2(formName,allow,cartQty,btnval)
{
	var frmObj  =  eval( "document." + formName );
	frmObj.btn.value = btnval.value;
    if(btnval.value=="View Cart")
	{
		if(cartQty==0)
		{
			alert("Your shopping cart is currently empty");
			return false;
		}
		else
		{
			window.open("shopping_cart.php", "_self");
			return true;
		}
	}
	if(btnval.value=="Check Out")
	{
		var pqty = eval(frmObj.pquantity.value);
		if(allow==0 && pqty<0)
		{
			alert("Your shopping cart is currently empty");
			return false;
		}
	}
	if (frmObj.pquantity.value=="" || frmObj.pquantity.value==0)
	{
		alert ("Please enter the quantity!");
		frmObj.pquantity.focus();
		return false;
	}
	if (frmObj.pquantity.value.indexOf('.') >= 1)
	{
		alert ("Please enter the Whole Number for quantity!");
		frmObj.pquantity.focus();
		return false;
	}
	if (!(frmObj.pquantity.value <= 99999 && frmObj.pquantity.value >= 0))
	{
		alert("Please enter a numeric value for quantity");
		frmObj.pquantity.focus();
		return false;
	}
	if(frmObj.pidxx.type=="select-one")
	{
		pidxxval=frmObj.pidxx.value;
	}
	else
	{
		oObj= frmObj.all("pidxx");
		if(oObj!=null)
		{
			pidxxval=0
			if(oObj.length!=null)
			{
				for (i=0;i<oObj.length;i++ )
				{
					if(frmObj.pidxx[i].checked==true)
					{
						pidxxval=frmObj.pidxx[i].value
						break;
					}
				}
			}
			else
			{
				if(frmObj.pidxx.checked==true) pidxxval=frmObj.pidxx.value;
			}
		}
	}
	if ((pidxxval) <= 0)
	{
		alert ("Please choose Hedstrom Pad!");
		return false;
	}
	return true;
}
function allowInteger(e)
{ 
	var unicode=e.charCode? e.charCode : e.keyCode;	 	
	if (unicode!=8)
	{ //if the key isn't the backspace key (which we should allow)
		if (unicode<48 || unicode>57) //if not a number
		{			
			return false; //disable key press
		}
	}
}

function gethedpadSize(pid, pad_size, pid_name)
{
	
	var obj=eval("document."+pid_name+"."+pid_name+"_pid");	
	obj.value=pid;
	var whereToWrite = pad_size;   
	var strVariables = 'action=PadSize_price&pid='+pid;
	makeRequest('ajax_function.php?'+strVariables, whereToWrite);
	qty = document.getElementById(pid_name+"pquantity");	
	qty.value = "1";	
	document.getElementById(pid_name+"_total").innerHTML="loading...";
	setTimeout("getPadTotal('"+pid_name+"');", 1000);
}

function getPadTotal(divName)
{
	var pidObj=eval("document."+divName+"."+divName+"_pid");
	pid = pidObj.value;
	if(pid ==''){
		alert('please select product of any size.');
		return false;
	}
	if(typeof eval("document."+divName+"."+divName+"_pid.value")=="undefined")
	{
	}else{
	qty = document.getElementById(divName+"pquantity").value;
	var whereToWrite = divName+"_total";   
	var strVariables = 'action=PadPriceDetail&pid='+pid+'&qty='+qty;
	makeRequest('ajax_function.php?'+strVariables, whereToWrite);
	}
}