
function ShowRateEstimates()
{
	var show=true;
	if (document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_freightproductqty.value=="")
	{
		alert('Please enter Product Quantity');
		document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_freightproductqty.focus();
		show=false;
		return false;
	}
	if (!IsNumericFreight(document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_freightproductqty.value))
	{
		alert('Please enter numeric values only');
		document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_freightproductqty.focus();
		show=false;
		return false;
	}
	if (document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_ddlfreightstate.value=="")
	{
		alert('Please enter Ship To State');
		document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_ddlfreightstate.focus();
		show=false;
		return false;
	}
	if (document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_freightzip.value=="")
	{
		alert('Please enter Ship To Zip');
		document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_freightzip.focus();
		show=false;
		return false;
	}
	if (document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_freightcountrycode.value=="")
	{
		alert('Please enter Ship To Country Code');
		document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_freightcountrycode.focus();
		show=false;
		return false;
	}
	
	
   
	if (show==true)
	{
		var productQty=parseInt(eval(document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_freightproductqty.value))
		
		var cartonqty = parseInt(document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_cartonqty.value)
		var cartonweight =  parseInt(document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_cartonweight.value)
		var StateAbb = document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_StateAbb.value
		var ZipCode = document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_ZipCode.value
		var totalweight;

		totalweight = productQty /  cartonqty

		totalweight = totalweight * cartonweight

		//window.open('http://ns5.powerweave.com/FreightEstimatorPkgwise/Default.aspx?appname=Amerigreen&fromcity=Chicago&fromstate=IL&Fromzip=60632&Fromcountry=US&Tostate=' + document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_ddlfreightstate.value + '&ToZip=' + document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_freightzip.value + '&ToCountry=' + document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_freightcountrycode.value + '&weight='+ totalweight +'&productQty='+ productQty + '&cartonqty=' + cartonqty +'&cartonweight='+ cartonweight +'&uspsuserid=Amerigreen&uspsuserpassword=Amerigreen&fedexAccountNumber=060415633&fedexMeterNumber=5766083&UPSAccesslicensenumber=2C37D57883AD4240&UPSUserID=Amerigreen&UPSPassword=Amerigreen&UPSShippernumber=607960&showfedex=Y&FedexRateType=L' , 'getfreightestimates', 'width=525,height=600,left=250,top=50,scrollbars=yes,status =1');
		
		window.open('http://ns5.powerweave.com/FreightEstimatorPkgwise/Default.aspx?appname=Amerigreen&fromcity=Chicago&fromstate='+ StateAbb +'&Fromzip='+ ZipCode +'&Fromcountry=US&Tostate=' + document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_ddlfreightstate.value + '&ToZip=' + document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_freightzip.value + '&ToCountry=' + document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_freightcountrycode.value + '&weight='+ totalweight +'&productQty='+ productQty + '&cartonqty=' + cartonqty +'&cartonweight='+ cartonweight +'&uspsuserid=Amerigreen&uspsuserpassword=Amerigreen&fedexAccountNumber=060415633&fedexMeterNumber=5766083&UPSAccesslicensenumber=2C37D57883AD4240&UPSUserID=Amerigreen&UPSPassword=Amerigreen&UPSShippernumber=607960&showfedex=Y&FedexRateType=L' , 'getfreightestimates', 'width=525,height=600,left=250,top=50,scrollbars=yes,status =1');
	}
}
