function contactUs(nam,phone,email1,email2,email3) {

	var email1_index = '0';
	var email2_index = '1';
	var email3_index = '2';
	var phone_index = '3';
	var name_index = '4';
	
 var hrefString = 'https://appserv.northropgrumman.com/RFIFormsWeb/getForm.do?formId=8&'+name_index+'='+escape(nam)+'&'+email1_index+'='+escape(email1)+'&'+phone_index+'='+escape(phone)
	 if(email2 != '') {
		 hrefString += '&'+email2_index+'='+escape(email2);
	 }//if
	 
	 if(email3 != '') {
		 hrefString += '&'+email3_index+'='+escape(email3);
	 }//if
	 
   document.location.href = hrefString;
}
function openPop(link){
   eval("window.open(link, '', 'width=650,height=400,left="+((screen.width-650)/2)+",top="+((screen.height-400)/2)+",scrollbars=1,resizable=1')"); 
}

function openWin(){
   newWin = eval("window.open('', 'newWin', 'width=650,height=500,left="+((screen.width-650)/2)+",top="+((screen.height-500)/2)+",directory=1,toolbar=1,menubar=0,status=0,location=1,scrollbars=1,resizable=1')"); 
   newWin.focus();
}

function showDiv() {
    if(document.getElementById('Layer1'))
      document.getElementById('Layer1').style.visibility = 'hidden'; 
    document.getElementById('Layer2').style.visibility = 'visible'; 
    document.getElementById('Layer3').style.visibility = 'visible';
    if(document.getElementById('flash'))
      document.getElementById('flash').style.visibility = 'hidden';            
}

function hideDiv() {
  document.images.product.src = "/images/botnav/products.gif";  
  if(document.getElementById('Layer1'))  
    document.getElementById('Layer1').style.visibility = 'visible'; 
  document.getElementById('Layer2').style.visibility = 'hidden'; 
  document.getElementById('Layer3').style.visibility = 'hidden';
  if(document.getElementById('flash'))
    document.getElementById('flash').style.visibility = 'visible';        
}

function autoSize() {
    
   document.write('<center><a id="windowAdjuster" >&nbsp;</a></center>');
   winAdjuster = document.getElementById("windowAdjuster");

   Ht = getTop(winAdjuster)+48;
  
   if ( Ht>(screen.height-60 ) ){
       Ht = screen.height-60;
   }
   if(window.opener) {
     window.resizeTo(700,450);
     window.moveTo( ((screen.width-700)/2), ((screen.height-450)/2) );
   }
}

function getTop(winAdjuster) {
    if (winAdjuster.offsetParent) {
        return (winAdjuster.offsetTop + getTop(winAdjuster.offsetParent));
    } else {
        return (winAdjuster.offsetTop);
    }
}

function showName(prod) {
   if(document.getElementById) {
     document.getElementById('board').innerHTML = prod;
   }
}

function resetName() {
   if(document.getElementById) {
     document.getElementById('board').innerHTML = "MOVE YOUR MOUSE OVER THUMBNAIL AND CLICK FOR MORE INFORMATION";
   }
}

/* function contactUs() {
	 alert('Test');
   fileName = getPrName();
   email = prEmail[fileName];
   phone = prPhone[fileName];
   nam = prName[fileName];
   document.location.href = '/cgi-bin/contact.pl?name='+nam+'&email='+email+'&phone='+phone;
} */

function openPdf() {
   nam = getPrName();
   pdf = prPdf[nam];
  if(pdf) {
     window.open(pdf,'','');
  } else {
     alert("No brochure is available for this product. \nPlease click on \"Contact Us\" for more information");
  }
}

function getPrName() {
    
  nam = window.location.href.split("/")[4];
  if(nam == "products") {
    nam = (window.location.href.split("/")[5]).split(".")[0];
  } 
  return nam;   
}

function formVal() {
  doc = document.mainform ;
  if(doc.Customer_First.value=='') {
     alert(' Please provide your first name');
     doc.Customer_First.focus();
     return false;
  }else if(doc.Customer_Last.value=='') {
     alert(' Please provide your last name');
     doc.Customer_Last.focus(); 
     return false;
  }else if(doc.Customer_Tele.value=='') {
    alert(' Please provide a telephone number where we can reach you');
    doc.Customer_Tele.focus(); 
    return false;
  }else if(doc.Customer_Email.value=='') {
    alert(' Please provide an email address');
    doc.Customer_Email.focus(); 
    return false;
  }else if(!doc.Customer_Email.value.match('^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*$')) {
    alert(' Please provide a valid email address. The address you provided is not valid');
    doc.Customer_Email.focus(); 
    return false;
  }else if(doc.Customer_Company.value=='') {
    alert(' Please provide your company name');
    doc.Customer_Company.focus(); 
    return false;
	  }else if(doc.Customer_Country.value=='') {
    alert(' Please select your country');
    doc.Customer_Country.focus(); 
    return false;
  } else {
    document.cookie = "gnavsyscontactinfo="+doc.Customer_First.value+"**/**" +
                                            doc.Customer_Last.value+"**/**" +
                                            doc.Customer_Tele.value+"**/**" +
                                            doc.Customer_Email.value+"**/**" +
                                            doc.Customer_Company.value+"**/**" +
                                            doc.Customer_Address.value+"**/**" +
                                            doc.Customer_City.value+"**/**" +
                                            doc.Customer_State.value+"**/**" +
                                            doc.Customer_Country.value+"**/**" +
                                            doc.Customer_Zip.value+"**/**" + 
                                            doc.Customer_Web.value+";expires=Wednesday 2-Jan-2018 23:59:59";
    return true;                                        
  }
}


function readCookie() {
  if( document.cookie.indexOf("gnavsyscontactinfo=") != -1) {
    info = (  (  document.cookie.split("gnavsyscontactinfo=")[1]  ).split(';')[0] ).split("**/**");
    doc = document.mainform ;
    if(info[0] && info[0] != 'undefined')   doc.Customer_First.value = info[0];
    if(info[1] && info[1] != 'undefined')   doc.Customer_Last.value = info[1];
    if(info[2] && info[2] != 'undefined')   doc.Customer_Tele.value = info[2];
    if(info[3] && info[3] != 'undefined')   doc.Customer_Email.value = info[3];
    if(info[4] && info[4] != 'undefined')   doc.Customer_Company.value = info[4];
    if(info[5] && info[5] != 'undefined')   doc.Customer_Address.value = info[5];
    if(info[6] && info[6] != 'undefined')   doc.Customer_City.value = info[6];
    if(info[7] && info[7] != 'undefined')   doc.Customer_State.value = info[7];
    if(info[8] && info[8] != 'undefined')   doc.Customer_Country.value = info[8];
    if(info[9] && info[9] != 'undefined')   doc.Customer_Zip.value = info[9];
    if(info[10] && info[10] != 'undefined') doc.Customer_Web.value = info[10];
 }       
}

function readCookie() {
  if( document.cookie.indexOf("gnavsyscontactinfo=") != -1) {
    info = (  (  document.cookie.split("gnavsyscontactinfo=")[1]  ).split(';')[0] ).split("**/**");
    doc = document.mainform ;
    if(info[0] && info[0] != 'undefined')   doc.Customer_First.value = info[0];
    if(info[1] && info[1] != 'undefined')   doc.Customer_Last.value = info[1];
    if(info[2] && info[2] != 'undefined')   doc.Customer_Tele.value = info[2];
    if(info[3] && info[3] != 'undefined')   doc.Customer_Email.value = info[3];
    if(info[4] && info[4] != 'undefined')   doc.Customer_Company.value = info[4];
    if(info[5] && info[5] != 'undefined')   doc.Customer_Address.value = info[5];
    if(info[6] && info[6] != 'undefined')   doc.Customer_City.value = info[6];
    if(info[7] && info[7] != 'undefined')   doc.Customer_State.value = info[7];
    if(info[8] && info[8] != 'undefined')   doc.Customer_Country.value = info[8];
    if(info[9] && info[9] != 'undefined')   doc.Customer_Zip.value = info[9];
    if(info[10] && info[10] != 'undefined') doc.Customer_Web.value = info[10];
 }       
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function openPPWin() {
  PPWin = eval("window.open('','PPWin','width=650,height=550,left="+((screen.width-650)/2)+",top="+((screen.height-480)/2)+",scrollbars=1,resizable=1')");
  PPWin.focus();
}