// JavaScript Document

function CheckForm()
{
 
if(document.webmail.stencil_parts_number.value.replace(/ /g,'')=='')
{
alert("Problem: \n\nErrors have occured during the process of your form. Please make the following corrections: Customer Part number you have not entered, please check and enter it.")
document.webmail.stencil_parts_number.focus();
 return false;	
}	



 if(escape(document.webmail.stencil_parts_number.value).indexOf("%u")!=-1) 
{alert("Problem: \n\nThe Customer's Part Number Input box with Chinese characters.")
document.webmail.stencil_parts_number.focus();
 return false;	
}	





 if(document.webmail.Stencil_type[15].checked==true)
{
if(document.webmail.length_of_stencil.value.replace(/ /g,'')==''||isNaN(document.webmail.length_of_stencil.value) )
{alert("Problem: \n\nPlease Enter the length of stencil.")
document.webmail.length_of_stencil.focus();
 return false;	}

if(document.webmail.width_of_stencil.value.replace(/ /g,'')==''||isNaN(document.webmail.width_of_stencil.value))
{alert("Problem: \n\nPlease Enter the width of stencil.")
document.webmail.width_of_stencil.focus();
 return false;	}


}	
 

 
 
 
if(document.webmail.stencil_side.value==0)
{
alert("Problem: \n\nErrors have occured during the process of your form. Please make the following corrections: You must make a selection for stencil side.")
document.webmail.stencil_side.focus();
 return false;	
}	



if(document.webmail.stencil_thickness.value==0)
{
alert("Problem: \n\nErrors have occured during the process of your form. Please make the following corrections: You must make a selection for stencil thickness.")
document.webmail.stencil_thickness.focus();
 return false;	
}	


if(document.webmail.lead_free_stencil.value==0)
{
alert("Problem: \n\nErrors have occured during the process of your form. Please make the following corrections: You must make a selection for Lead free application.")
document.webmail.lead_free_stencil.focus();
 return false;	
}	


if(document.webmail.printer_type.value.replace(/ /g,'')=='')
{
alert("Problem: \n\nPlease Enter the Printer Type.")
document.webmail.printer_type.focus();
 return false;	
}	


if(document.webmail.fiducial_data.value==0)
{
alert("Problem: \n\nErrors have occured during the process of your form. Please make the following corrections: You must make a selection for Fiducial mark.")
document.webmail.fiducial_data.focus();
 return false;	
}	



if(document.webmail.is_panelized.value==0)
{
alert("Problem: \n\nErrors have occured during the process of your form. Please make the following corrections: You must make a selection for board panelized.")
document.webmail.is_panelized.focus();
 return false;	
}	


if(document.webmail.print_confirmation.value==0)
{
alert("Problem: \n\nErrors have occured during the process of your form. Please make the following corrections: You must make a selection for Check Plot Verification.")
document.webmail.print_confirmation.focus();
 return false;	
}	



 if(escape(document.webmail.stencil_additional_questions.value).indexOf("%u")!=-1) 

{
alert("Problem: \n\nThe Additional questions Input box with Chinese characters.")
document.webmail.stencil_additional_questions.focus();
 return false;	
}	









}

function change_color(obj)
{
document.getElementById('line'+obj).style.backgroundColor='#00EE00';

for (i = 0; i <=14; i++)
if(i!=obj)
document.getElementById('line'+i).style.backgroundColor='';

}


function reset_color(obj)
{
for (i = 0; i <=14; i++)

document.getElementById('line'+i).style.backgroundColor='';

}






var xPos;
var yPos;

function showToolTip(msg,ev){
ev= ev || window.event; 
var mousePos = mouseCoords(ev) 

    xPos = mousePos.x;
    yPos = mousePos.y;

   var toolTip = document.getElementById("toolTip");
   toolTip.innerHTML = "<p>"+msg+"</p>";
   toolTip.style.top = yPos + "px";
   toolTip.style.left = xPos + "px";
   toolTip.style.visibility = "visible";
   
}

function hideToolTip(){
   var toolTip = document.getElementById("toolTip");
   toolTip.style.visibility = "hidden";
}



function mouseCoords(ev) 
{ 
if(ev.pageX || ev.pageY){ 
return {x:ev.pageX, y:ev.pageY}; 
} 
return { 
x:ev.clientX + document.body.scrollLeft - document.body.clientLeft, 
y:ev.clientY + document.body.scrollTop - document.body.clientTop 
}; 
} 


function show_stencil_thickness()
{
var	infor="Notice: \n\nThe Stencil Thickness is very important for the smallest component pads. If you do not know your best choice, just take 'Select for Me, please'.";
alert(infor);

}


function check_this(e)

{ var event = e||window.event;

if (event.keyCode)
if ( event.keyCode!=46 &&  event.keyCode!=8 && ( event.keyCode<48 ||  event.keyCode>57)) 
 event.returnValue=false

if (event.which)
if (event.which!=46 &&  event.which!=8 &&(event.which<48 ||event.which>57)) 
 event.preventDefault()

}


function check_key(e)

{ var event = e||window.event;

if (event.keyCode)
if (event.keyCode==33 || event.keyCode==44 || event.keyCode==39)
 event.returnValue=false

if (event.which)
if (event.which==33 || event.which==44 ||event.which==39) 
 event.preventDefault()

}
