
function ShowRateEstimates()
{
	var show=true;
	if (document.aspnetForm.ctl00_cphTemplateContent_freightproductqty.value=="")
	{
		alert('Please enter Product Quantity');
		document.aspnetForm.ctl00_cphTemplateContent_freightproductqty.focus();
		show=false;
		return false;
	}
	if (!IsNumericFreight(document.aspnetForm.ctl00_cphTemplateContent_freightproductqty.value))
	{
		alert('Please enter numeric values only');
		document.aspnetForm.ctl00_cphTemplateContent_freightproductqty.focus();
		show=false;
		return false;
	}
	if (document.aspnetForm.ctl00_cphTemplateContent_freightstate.value=="")
	{
		alert('Please enter Ship To State');
		document.aspnetForm.ctl00_cphTemplateContent_freightstate.focus();
		show=false;
		return false;
	}
	if (document.aspnetForm.ctl00_cphTemplateContent_freightzip.value=="")
	{
		alert('Please enter Ship To Zip');
		document.aspnetForm.ctl00_cphTemplateContent_freightzip.focus();
		show=false;
		return false;
	}
	if (document.aspnetForm.ctl00_cphTemplateContent_freightcountrycode.value=="")
	{
		alert('Please enter Ship To Country Code');
		document.aspnetForm.ctl00_cphTemplateContent_freightcountrycode.focus();
		show=false;
		return false;
	}
	
	
    
	if (show==true)
	{
		var productQty=parseInt(eval(document.aspnetForm.ctl00_cphTemplateContent_freightproductqty.value))
		
		var cartonqty = parseInt(document.aspnetForm.ctl00_cphTemplateContent_cartonqty.value)
		var cartonweight =  parseInt(document.aspnetForm.ctl00_cphTemplateContent_cartonweight.value)
		var cartonLength = parseInt(document.aspnetForm.ctl00_cphTemplateContent_CartonLength.value)
		var cartonWidth = parseInt(document.aspnetForm.ctl00_cphTemplateContent_CartonWidth.value)
		var cartonHeight = parseInt(document.aspnetForm.ctl00_cphTemplateContent_CartonHeight.value)
		var totalweight;

		totalweight = productQty /  cartonqty

		totalweight = totalweight * cartonweight

		//window.open('http://ns5.powerweave.com/FreightEstimatorPkgwise/Default.aspx?appname=Tagmaster&fromcity=Evanston&fromstate=IL&Fromzip=60202&Fromcountry=US&Tostate=' + document.aspnetForm.ctl00_cphTemplateContent_freightstate.value + '&ToZip=' + document.aspnetForm.ctl00_cphTemplateContent_freightzip.value + '&ToCountry=' + document.aspnetForm.ctl00_cphTemplateContent_freightcountrycode.value + '&weight='+ totalweight +'&productQty='+ productQty + '&cartonqty=' + cartonqty +'&cartonweight='+ cartonweight +'&uspsuserid=tagmaster&uspsuserpassword=tagmaster&fedexAccountNumber=194788185&fedexMeterNumber=5777154&UPSAccesslicensenumber=8C38DAB244EE4824&UPSUserID=tagmaster&UPSPassword=tagmaster&UPSShippernumber=604437&showfedex=Y&FedexRateType=L' , 'getfreightestimates', 'width=523,height=640,left=250,top=50,scrollbars=yes,status =1');
		
		window.open('http://ns5.powerweave.com/freighttagmaster/Default.aspx?appname=Tagmaster&fromcity=Evanston&fromstate=IL&Fromzip=60202&Fromcountry=US&Tostate=' + document.aspnetForm.ctl00_cphTemplateContent_freightstate.value + '&ToZip=' + document.aspnetForm.ctl00_cphTemplateContent_freightzip.value + '&ToCountry=' + document.aspnetForm.ctl00_cphTemplateContent_freightcountrycode.value + '&weight='+ totalweight +'&productQty='+ productQty + '&cartonqty=' + cartonqty +'&cartonweight='+ cartonweight +'&L='+ cartonLength + "&W=" + cartonWidth + "&H=" + cartonHeight +'&uspsuserid=tagmaster&uspsuserpassword=tagmaster&fedexAccountNumber=194788185&fedexMeterNumber=5777154&UPSAccesslicensenumber=8C38DAB244EE4824&UPSUserID=tagmaster&UPSPassword=tagmaster&UPSShippernumber=604437&showfedex=Y&FedexRateType=L' , 'Tagmaster', 'width=523,height=640,left=250,top=50,scrollbars=yes,status =1');
	}
}
