// JavaScript Document
function fillShipAddr(box)
{if (box.checked)
	{
		box.form.elements["shipping_address"].value = box.form.elements["address_1"].value;
		box.form.elements["shipping_address2"].value = box.form.elements["address_2"].value;
		box.form.elements["shipping_city"].value = box.form.elements["city"].value;
		box.form.elements["shipping_state"].value = box.form.elements["state"].value;
		box.form.elements["shipping_zip_code"].value = box.form.elements["zip_code"].value;
		box.form.elements["shipping_country"].value = box.form.elements["Country"].value;
        box.form.elements["Receiver_Name"].value =box.form.elements["custom_name"].value;
        box.form.elements["Receiver_Company"].value =box.form.elements["company_name"].value;
        box.form.elements["shipping_phone"].value =box.form.elements["phone_number"].value;             
	//	alert("x_ShipCity="+box.form.elements["x_address"].value);
	}

return true;

}

function fillBillAddr(box)
{

	if (box.checked)
	{
		box.form.elements["bill_address"].value = box.form.elements["address_1"].value;
		box.form.elements["bill_address2"].value = box.form.elements["address_2"].value;
		box.form.elements["bill_city"].value = box.form.elements["city"].value;
		box.form.elements["bill_state"].value = box.form.elements["state"].value;
		box.form.elements["bill_zip_code"].value = box.form.elements["zip_code"].value;
		box.form.elements["bill_country"].value = box.form.elements["Country"].value;
     	box.form.elements["bill_name"].value = box.form.elements["custom_name"].value;
     	box.form.elements["bill_company"].value = box.form.elements["company_name"].value;
        box.form.elements["bill_phone"].value =box.form.elements["phone_number"].value;             
	//	alert("x_ShipCity="+box.form.elements["x_address"].value);
	}

return true;

}

function change_ucase(kk,what)
{if (kk.value.replace(/ /g,'')=='') 
{alert('Please Enter '+what );
kk.focus()}
else
kk.value=kk.value.toUpperCase();


}


function show_AEmail()

{if (document.update.AEmail_control.checked==true)

{document.getElementById("A_Email").style.display='block';document.getElementById("Alternative_Emails").innerHTML='Hide My Alternative Emails'}
else

{document.getElementById("A_Email").style.display='none';document.getElementById("Alternative_Emails").innerHTML='Show My Alternative Emails'}

}


function checkall()

{
var msg =' can not be empty !';
if (document.update.custom_name.value.replace(/ /g,'')=='')
{    alert('Problem: \n\nCustomer Name'+ msg);document.update.custom_name.focus();return false;}
	
if (document.update.custom_name.value.indexOf("'")!=-1)
{    alert('Problem: \n\nPlease Enter Correct Customer Name');document.update.custom_name.focus();return false;}	

if(escape(document.update.custom_name.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Customer Name Input box with Chinese characters.");document.update.custom_name.focus();return false;	}	



var custom_name_array=document.update.custom_name.value.replace(/(^\s*)|(\s*$)/g, "").split(" ");

if (custom_name_array.length<2||custom_name_array[custom_name_array.length-1]=='')
{alert('Problem: \n\nIllegal Customer Name');document.update.custom_name.focus();return false;}	

if(escape(document.update.company_name.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Company Input box with Chinese characters.");document.update.company_name.focus();return false;	}

if (document.update.password.value.replace(/ /g,'').length==0)
{ alert('Problem: \n\npassword'+ msg);document.update.password.focus();return false;}


if (document.update.password.value.indexOf("'")!=-1)
{ alert('Problem: \n\nPlease Enter Correct Password.');document.update.password.focus();return false;}

if(escape(document.update.password.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Password Input box with Chinese characters.");document.update.password.focus();return false;	}	


if (document.update.password.value.replace(/ /g,'').length>16)
{ alert('Problem: \n\nSorry, your password is over 16 bits. Try again, please.');document.update.password.focus();return false;}


if (document.update.phone_number.value.indexOf("'")!=-1)
{ alert('Problem: \n\nPlease Enter Correct Phone Number.');document.update.phone_number.focus();return false;}

if(escape(document.update.phone_number.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Phone Number Input box with Chinese characters.");document.update.phone_number.focus();return false;	}


if (document.update.Fax.value.indexOf("'")!=-1)
{ alert('Problem: \n\nPlease Enter Correct Fax Number.');document.update.Fax.focus();return false;}

if(escape(document.update.Fax.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Fax Input box with Chinese characters.");document.update.Fax.focus();return false;	}



if (document.update.address_1.value.replace(/ /g,'')=='')
{    alert('Problem: \n\nAddress 1'+ msg);document.update.address_1.focus();return false;}

if(escape(document.update.address_1.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Address 1 Input box with Chinese characters.");document.update.address_1.focus();return false;	}

if(escape(document.update.address_2.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Address 2 Input box with Chinese characters.");document.update.address_2.focus();return false;	}



if (document.update.city.value.replace(/ /g,'').length==0)
{alert('Problem: \n\nCity'+ msg);document.update.city.focus(); return false;}



if (document.update.city.value.indexOf("'")!=-1)
{ alert('Problem: \n\nPlease Enter Correct City.');document.update.city.focus(); return false;}

if(escape(document.update.city.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe City Input box with Chinese characters.");document.update.city.focus();return false;	}



if (document.update.state.value.replace(/ /g,'').length==0)
{    alert('Problem: \n\nState'+ msg);document.update.state.focus();return false;}

if (document.update.state.value.indexOf("'")!=-1)
{ alert('Problem: \n\nPlease Enter Correct State.');document.update.state.focus();return false;}


if(escape(document.update.state.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe State Input box with Chinese characters.");document.update.state.focus();return false;	}



if (document.update.zip_code.value.replace(/ /g,'').length==0)
{    alert('Problem: \n\nZip Code'+ msg);document.update.zip_code.focus(); return false;}


if (document.update.zip_code.value.indexOf("'")!=-1)
{    alert('Problem: \n\nPlease Enter Correct Zip Code.');document.update.zip_code.focus(); return false;}

if(escape(document.update.zip_code.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Zip Code Input box with Chinese characters.");document.update.zip_code.focus();return false;	}


if (document.update.Country.value.replace(/ /g,'').length==0)
{    alert('Problem: \n\nCountry'+ msg);document.update.Country.focus(); return false;}

if (document.update.Country.value.indexOf("'")!=-1)
{    alert('Problem: \n\nPlease Enter Correct Country.');document.update.Country.focus(); return false;}

if(escape(document.update.Country.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Country Input box with Chinese characters.");document.update.Country.focus();return false;	}




	
	

if (document.update.Receiver_Name.value.replace(/ /g,'').length==0)

{alert('Problem: \n\nReceiver Name'+msg);document.update.Receiver_Name.focus();return false;}

if (document.update.Receiver_Name.value.indexOf("'")!=-1)

{alert('Problem: \n\nPlease Enter a Correct Receiver Name.');document.update.Receiver_Name.focus();return false;}

var Receiver_Name_array=document.update.Receiver_Name.value.split(" ");
if (Receiver_Name_array.length<2)
{alert('Problem: \n\nIllegal Receiver Name.');document.update.Receiver_Name.focus();return false;}

if(escape(document.update.Receiver_Name.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Receiver Name Input box with Chinese characters.");document.update.Receiver_Name.focus();return false;	}

if(escape(document.update.Receiver_Company.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Receiver Company Input box with Chinese characters.");document.update.Receiver_Company.focus();return false;	}


if (document.update.shipping_address.value.replace(/ /g,'').length==0)

{alert('Problem: \n\nThe Shipping Address 1'+msg);document.update.shipping_address.focus();return false;}


if(escape(document.update.shipping_address.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Shipping Address 1 Input box with Chinese characters.");document.update.shipping_address.focus();return false;	}


if(escape(document.update.shipping_address2.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Shipping Address 2 Input box with Chinese characters.");document.update.shipping_address2.focus();return false;	}



if (document.update.shipping_city.value.replace(/ /g,'').length==0)

{alert('Problem: \n\nShipping City'+msg);document.update.shipping_city.focus();return false;}

if (document.update.shipping_city.value.indexOf("'")!=-1)

{alert('Problem: \n\nPlease Enter a Correct Shipping City.');document.update.shipping_city.focus();return false;}

if(escape(document.update.shipping_city.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Shipping City Input box with Chinese characters.");document.update.shipping_city.focus();return false;	}



if (document.update.shipping_state.value.replace(/ /g,'').length==0)

{alert('Problem: \n\nShipping State'+msg);document.update.shipping_state.focus();return false;}

if (document.update.shipping_state.value.indexOf("'")!=-1)

{alert('Problem: \n\nPlease Enter a Correct Shipping State.');document.update.shipping_state.focus();return false;}
	

if(escape(document.update.shipping_state.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Shipping State Input box with Chinese characters.");document.update.shipping_state.focus();return false;	}




if (document.update.shipping_zip_code.value.replace(/ /g,'').length==0)

{alert('Problem: \n\nShipping Zip Code'+msg);document.update.shipping_zip_code.focus();return false;}

if (document.update.shipping_zip_code.value.indexOf("'")!=-1)

{alert('Problem: \n\nPlease Enter a Correct Shipping Zip Code.');document.update.shipping_zip_code.focus();return false;}	


if(escape(document.update.shipping_zip_code.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Shipping Zip Code Input box with Chinese characters.");document.update.shipping_zip_code.focus();return false;	}

	
if (document.update.shipping_country.value.replace(/ /g,'').length==0)

{alert('Problem: \n\nShipping Country'+msg);document.update.shipping_country.focus();return false;}

if (document.update.shipping_country.value.indexOf("'")!=-1)

{alert('Problem: \n\nPlease Enter a Correct Shipping Country.');document.update.shipping_country.focus();return false;}	

if(escape(document.update.shipping_country.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Shipping Country  Input box with Chinese characters.");document.update.shipping_country.focus();return false;	}

	
if (document.update.shipping_phone.value.indexOf("'")!=-1)
{alert('Problem: \n\nPlease Enter Correct Shipping Phone Number.');document.update.shipping_phone.focus(); return false;}

if(escape(document.update.shipping_phone.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Shipping Phone Input box with Chinese characters.");document.update.shipping_phone.focus();return false;	}
	

	
	

if (document.update.bill_name.value.replace(/ /g,'').length==0)

{alert('Problem: \n\nBilling Name'+msg);document.update.bill_name.focus();return false;}

if (document.update.bill_name.value.indexOf("'")!=-1)

{alert('Problem: \n\nPlease Enter a Correct Billing Name.');document.update.bill_name.focus();return false;}


var bill_name_array=document.update.bill_name.value.split(" ");
if (bill_name_array.length<2)
{alert('Problem: \n\nIllegal Billing Name.');document.update.bill_name.focus();return false;}

if(escape(document.update.bill_name.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Billing Name Input box with Chinese characters.");document.update.bill_name.focus();return false;	}


if(escape(document.update.bill_company.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Billing Company Input box with Chinese characters.");document.update.bill_company.focus();return false;	}


if (document.update.bill_address.value.replace(/ /g,'').length==0)

{alert('Problem: \n\nBilling Address 1'+msg);document.update.bill_address.focus();return false;}

if(escape(document.update.bill_address.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Billing Address 1 Input box with Chinese characters.");document.update.bill_address.focus();return false;	}

if(escape(document.update.bill_address2.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Billing Address 2 Input box with Chinese characters.");document.update.bill_address2.focus();return false;	}


if (document.update.bill_city.value.replace(/ /g,'').length==0)

{alert('Problem: \n\nBilling City'+msg);document.update.bill_city.focus();return false;}

if (document.update.bill_city.value.indexOf("'")!=-1)

{alert('Problem: \n\nPlease Enter a Correct Billing City.');document.update.bill_city.focus();return false;}

if(escape(document.update.bill_city.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Billing City Input box with Chinese characters.");document.update.bill_city.focus();return false;	}



if (document.update.bill_state.value.replace(/ /g,'').length==0)

{alert('Problem: \n\nBilling State'+msg);document.update.bill_state.focus();return false;}

if (document.update.bill_state.value.indexOf("'")!=-1)

{alert('Problem: \n\nPlease Enter a Correct Billing State.');document.update.bill_state.focus();return false;}


if(escape(document.update.bill_state.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Billing State Input box with Chinese characters.");document.update.bill_state.focus();return false;	}


	
if (document.update.bill_zip_code.value.replace(/ /g,'').length==0)

{alert('Problem: \n\nBilling Zip Code'+msg);document.update.bill_zip_code.focus();return false;}

if (document.update.bill_zip_code.value.indexOf("'")!=-1)

{alert('Problem: \n\nPlease Enter a Correct Billing Zip Code.');document.update.bill_zip_code.focus();return false;}	

if(escape(document.update.bill_zip_code.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Billing Zip Code Input box with Chinese characters.");document.update.bill_zip_code.focus();return false;	}

	
	
if (document.update.bill_country.value.replace(/ /g,'').length==0)

{alert('Problem: \n\nBilling Country'+msg);document.update.bill_country.focus();return false;}

if (document.update.bill_country.value.indexOf("'")!=-1)

{alert('Problem: \n\nPlease Enter a Correct Billing Country.');document.update.bill_country.focus();return false;}		

if(escape(document.update.bill_country.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Billing Country Input box with Chinese characters.");document.update.bill_country.focus();return false;	}



	
if (document.update.bill_phone.value.indexOf("'")!=-1)
{alert('Problem: \n\nPlease Enter Correct Billing Phone Number.');document.update.bill_phone.focus(); return false;}	
	
if(escape(document.update.bill_phone.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Billing Phone Input box with Chinese characters.");document.update.bill_phone.focus();return false;	}
	
document.getElementById('update_wait_status').style.display='block';
document.getElementById('update_status').style.display='none';
	
	
if (true)
return true;
}



function NET30_Credit_Account_check(old_value)
{if (old_value=='yes')
{document.getElementsByName("NET30_Credit_Account")[0].checked=true}
else 
{document.getElementsByName("NET30_Credit_Account")[1].checked=true}
}
window.onscroll=function()
{var sc_top = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;var sc_left = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft;var sc_Height = document.documentElement.scrollHeight ? document.documentElement.scrollHeight : document.body.scrollHeight;if(sc_top<=100) document.getElementById("float_list_button").style.top=80+'px';if (sc_top+800>=document.documentElement.scrollHeight) document.getElementById("float_list_button").style.top=sc_top-500+'px';if(sc_top+800<sc_Height&&sc_top>300) document.getElementById("float_list_button").style.top=sc_top-240+'px';}
