function IsNumericFreight(sText)
{
   var ValidChars = "0123456789."
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
   { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
      {
         IsNumber = false;
      }
   }
   return IsNumber;
   }
function ShowRateEstimates()
{
	var show=true;
	if (document.all.freightproductqty.value=="")
	{
		alert('Please enter Product Quantity');
		document.all.freightproductqty.focus();
		show=false;
		return false;
	}
	if (!IsNumericFreight(document.all.freightproductqty.value))
	{
		alert('Please enter numeric values only');
		document.all.freightproductqty.focus();
		show=false;
		return false;
	}
	if (document.all.freightstate.value=="")
	{
		alert('Please enter Ship To State');
		document.all.freightstate.focus();
		show=false;
		return false;
	}
	if (document.all.freightzip.value=="")
	{
		alert('Please enter Ship To Zip');
		document.all.freightzip.focus();
		show=false;
		return false;
	}
	if (document.all.freightcountrycode.value=="")
	{
		alert('Please enter Ship To Country Code');
		document.all.freightcountrycode.focus();
		show=false;
		return false;
	}
	
	if (show==true)
	{
		//alert('open popupnow');
		var totalweight;
		totalweight = (parseInt(document.all.freightproductqty.value) /  parseInt(document.all.cartonqty.value))
		totalweight = totalweight * parseInt(document.all.cartonweight.value)
		//alert(totalweight);
		//window.open('http://ns5.powerweave.com/FreightEstimatorV1/Default.aspx?appname=graphik&fromcity=DANSVILLE&fromstate=NY&Fromzip=14437&Fromcountry=US&Tostate=' + document.all.freightstate.value + '&ToZip=' + document.all.freightzip.value + '&ToCountry=' + document.all.freightcountrycode.value + '&Weight='+ totalweight +'&uspsuserid=232POWER6607&uspsuserpassword=&fedexAccountNumber=237234766&fedexMeterNumber=7228820&UPSAccesslicensenumber=6BFDF101E5228644&UPSUserID=graphikpromo&UPSPassword=promo2&UPSShippernumber=47E56W' , 'getfreightestimates', 'width=490,height=640,left=250,top=50,scrollbars=yes,status =1');
		  window.open('http://ns5.powerweave.com/FreightEstimatorPkgwise/Default.aspx?appname=shepenco&fromcity=Shelbyville&fromstate=TN&Fromzip=37160&Fromcountry=US&Tostate='+document.all.freightstate.value+'&ToZip='+document.all.freightzip.value+'&ToCountry='+document.all.freightcountrycode.value+'&Weight='+totalweight+'&productQty='+document.all.freightproductqty.value+'&cartonqty='+document.all.cartonqty.value+'&cartonweight='+document.all.cartonweight.value+'&uspsuserid=232POWER6607&uspsuserpassword=&fedexAccountNumber=037009563&fedexMeterNumber=5931526&UPSAccesslicensenumber=DC4224C87E14FD34&UPSUserID=shepencofr&UPSPassword=shepencofr&UPSShippernumber=310603' , 'getfreightestimates', 'width=490,height=640,left=250,top=50,scrollbars=yes,status =1');
	}
}