// JavaScript Document


var visible=true; 
function Change2(OrdersNum,pic) 
//var visible4=true; 
{ 
var bt4=document.getElementById(OrdersNum); //the id number of customer information-box 
var tu=document.getElementById(pic); //the id number of customer information-box 


if(visible) 
{ 
bt4.style.display="block"; 
visible=false; 
tu.src = "PCB-fabrication-images/sshow.jpg";
} 
else 
{ 
bt4.style.display="none"; 
visible=true; 
tu.src = "PCB-fabrication-images/shidden.jpg";
} 

} 



function show_status()
{
document.getElementById('get_quotation_button').style.display='none';
document.getElementById('get_quotation_status').style.display='block';
document.getElementById('back_shopping').style.display='none';
	
}











function check_shipping_company()
{
	
if (document.webmail.Final_shipping_fee[0].checked==true)
document.webmail.shipping_company.value='UPS';
if (document.webmail.Final_shipping_fee[1].checked==true)
document.webmail.shipping_company.value='DHL';
if (document.webmail.Final_shipping_fee[2].checked==true)
document.webmail.shipping_company.value='FedEx';
if (document.webmail.Final_shipping_fee[3].checked==true)
document.webmail.shipping_company.value='Air Freight';



//document.webmail.submit.style.color='#990000';
//document.webmail.submit.style.fontWeight='bold';
//document.webmail.submit.value='Generating the quote now, please wait...';
}

function check_shipping_company1()
{
	
if (document.webmail.Final_shipping_fee[0].checked==true)
document.webmail.shipping_company.value='FedEx';
if (document.webmail.Final_shipping_fee[1].checked==true)
document.webmail.shipping_company.value='DHL';
if (document.webmail.Final_shipping_fee[2].checked==true)
document.webmail.shipping_company.value='UPS';
if (document.webmail.Final_shipping_fee[3].checked==true)
document.webmail.shipping_company.value='Air Freight';

//document.webmail.submit.style.color='#990000';
//document.webmail.submit.style.fontWeight='bold';
//document.webmail.submit.value='Generating the quote now, please wait...';

}

function check_shipping_company2()
{
if (document.webmail.Final_shipping_fee[0].checked==true)
document.webmail.shipping_company.value='UPS or DHL';
if (document.webmail.Final_shipping_fee[1].checked==true)
document.webmail.shipping_company.value='FedEx';
if (document.webmail.Final_shipping_fee[2].checked==true)
document.webmail.shipping_company.value='Air Freight';


//document.webmail.submit.style.color='#990000';
//document.webmail.submit.style.fontWeight='bold';
//document.webmail.submit.value='Generating the quote now, please wait...';



}



function fillBillAddr(box)
{

	if (box.checked)
	{
		box.form.elements["bill_address"].value = box.form.elements["shipping_address"].value;
		box.form.elements["bill_address2"].value = box.form.elements["shipping_address2"].value;
		box.form.elements["bill_city"].value = box.form.elements["shipping_city"].value;
		box.form.elements["bill_state"].value = box.form.elements["shipping_state"].value;
		box.form.elements["bill_zip_code"].value = box.form.elements["shipping_zip_code"].value;
		box.form.elements["bill_country"].value = box.form.elements["shipping_country"].value;
     	box.form.elements["bill_name"].value = box.form.elements["Receiver_Name"].value;
     	box.form.elements["bill_company"].value = box.form.elements["Receiver_Company"].value;
     	box.form.elements["bill_phone"].value = box.form.elements["shipping_phone"].value;
	}

return true;

}




function check_update(ok)
{
if (ok.checked)
{document.show_billing_shipping_address.Submit.disabled=false;
document.show_billing_shipping_address.Submit.style.color='#0000FF';
}
else
{document.show_billing_shipping_address.Submit.disabled=true;
document.show_billing_shipping_address.Submit.style.color='#CCCCCC';}
}

function check_country(kk)
{ if (kk.value!='')  
kk.value=kk.value.toUpperCase() 
else 
kk.value='USA'

}




function change(){ 

var divId = document.getElementById('div2_1');
divId.style.visibility='visible'; 
divId.style.zIndex = "2";
var v_left=(document.body.clientWidth-divId.clientWidth)/2; 
var v_top=(document.body.clientHeight-divId.clientHeight)/2+150; 
divId.style.left=v_left; 
divId.style.top=v_top;
 var m = "mask";
 var newMask = document.createElement("div");
    newMask.id = m;
    newMask.style.position = "absolute";
    newMask.style.zIndex = "1";
    _scrollWidth = Math.max(document.body.scrollWidth,document.documentElement.scrollWidth);
    _scrollHeight = Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
    newMask.style.width = _scrollWidth + "px";
    newMask.style.height = _scrollHeight + "px";
    newMask.style.top = "0px";
    newMask.style.left = "0px";
    newMask.style.background = "#33393C";
    newMask.style.filter = "alpha(opacity=40)";
    newMask.style.opacity = "0.40";
    document.body.appendChild(newMask);
} 

function go_back(action,Prevous_Order_ID)
{if (Prevous_Order_ID=='N/A')
location.href=action;
else
location.href='../'
}