
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_ddlState.value=="")
	{
		alert('Please enter Ship To State');
		document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_ddlState.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 length = parseInt(document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_length.value)
		var width =  parseInt(document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_width.value)
		var height = parseInt(document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_height.value)
		
		var totalweight;

		totalweight = productQty /  cartonqty

		totalweight = totalweight * cartonweight

		//window.open('http://ns5.powerweave.com/FreightEstimatorPkgwise/Default.aspx?appname=PremiumASI&fromcity=Las Vegas&fromstate=NV&Fromzip=89120&Fromcountry=US&Tostate=' + document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_ddlState.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=PremiumASI&uspsuserpassword=premiumasi&fedexAccountNumber=123007360&fedexMeterNumber=5829159&UPSAccesslicensenumber=DC3BC2699A733D08&UPSUserID=premiumasi&UPSPassword=premiumasi&UPSShippernumber=744905&showfedex=Y&FedexRateType=L' , 'getfreightestimates', 'width=525,height=600,left=250,top=50,scrollbars=yes,status =1');
		//window.open('http://ns5.powerweave.com/FreightEstimtorPkgDimension/Default.aspx?appname=PremiumASI&fromcity=LasVegas&fromstate=NV&Fromzip=89120&Fromcountry=US&Tostate=' + document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_ddlState.value + '&ToZip=' + document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_freightzip.value + '&ToCountry=' + document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_freightcountrycode.value + '&L='+ length + '&W='+ width + '&H='+ height + '&weight='+ totalweight +'&productQty='+ productQty + '&cartonqty=' + cartonqty +'&cartonweight=' + cartonweight +'&uspsuserid=PremiumASI&uspsuserpassword=premiumasi&fedexAccountNumber=123007360&fedexMeterNumber=5829159&UPSAccesslicensenumber=DC3BC2699A733D08&UPSUserID=premiumasi&UPSPassword=premiumasi&UPSShippernumber=744905&showups=N&showfedex=Y&FedexRateType=L', 'getfreightestimates', 'width=525,height=600,left=250,top=50,scrollbars=yes,status =1');
		window.open('http://ns5.powerweave.com/PremiumAsiFreight/Default.aspx?appname=PremiumASI&fromcity=LasVegas&fromstate=NV&Fromzip=89120&Fromcountry=US&Tostate=' + document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_ddlState.value + '&ToZip=' + document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_freightzip.value + '&ToCountry=' + document.aspnetForm.ctl00_cphTemplateContent_ProductDetails1_freightcountrycode.value + '&L='+ length + '&W='+ width + '&H='+ height + '&weight='+ totalweight +'&productQty='+ productQty + '&cartonqty=' + cartonqty +'&cartonweight=' + cartonweight +'&uspsuserid=PremiumASI&uspsuserpassword=premiumasi&fedexAccountNumber=123007360&fedexMeterNumber=5829159&UPSAccesslicensenumber=DC3BC2699A733D08&UPSUserID=premiumasi&UPSPassword=premiumasi&UPSShippernumber=744905&showfedex=Y&showups=N&FedexRateType=L', 'getfreightestimates', 'width=525,height=600,left=250,top=50,scrollbars=yes,status =1');
	}
}

