// 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/button/hide_specfication.gif";
} 
else 
{ 
bt4.style.display="none"; 
visible=true; 
tu.src = "PCB-fabrication-images/button/show_specfication.gif";
} 

} 



function show_status()
{
show_Progress_bar("Generating the quote now,<br><br>please wait...");document.body.style.cursor='wait';
return true

}	
	












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(){ 
if(navigator.userAgent.indexOf('MSIE 6.0')!=-1)
{var x=document.getElementsByTagName("select")
for (i=0;i<x.length;i++)   
x[i].style.display='none';}
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+divId.clientHeight/2+20; 
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=90)";
    newMask.style.opacity = "0.90";
    document.body.appendChild(newMask);
} 

function go_back(Prevous_Order_ID)
{if (Prevous_Order_ID =='N/A') document.go_back_form.submit();else location.href='/';}





function show_cart_problem()
{var  cart_problem_id= document.getElementById('cart_problem');
cart_problem_id.style.visibility='visible'; 
cart_problem_id.style.zIndex = "2";
var v_left=(document.body.clientWidth-cart_problem_id.clientWidth)/2; 
var v_top= 10
cart_problem_id.style.left=v_left; 
cart_problem_id.style.top=v_top;
 
} 



function show_Progress_bar(msg)
{var Progress_bar_Id = document.getElementById('Progress_bar');
document.getElementById('Progress_bar_message').innerHTML=msg
Progress_bar_Id.style.visibility='visible'; 
Progress_bar_Id.style.zIndex = "2";
var v_left=(document.body.clientWidth-Progress_bar_Id.clientWidth)/2; 
var v_top= Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)-500
Progress_bar_Id.style.left=v_left; 
Progress_bar_Id.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 = "#666666";
    newMask.style.filter = "alpha(opacity=90)";
    newMask.style.opacity = "0.90";
    document.body.appendChild(newMask);
} 

window.onscroll=function () 
{
if(document.getElementById("Progress_bar"))	
if (document.getElementById("Progress_bar").style.visibility=='visible')	 
document.getElementById("Progress_bar").style.top=document.body.scrollTop+document.getElementById("Progress_bar").clientHeight-100
	}
