// JavaScript Document GPS 06/03/2006

function ProdWindow(ipart,iwn) {
      //window.open("http://" + this.location.hostname + "/pro/gex.exe/pcatdtl0?ipartno=" + ipart,"W" + iwn,
      //"toolbar=no,location=no,directories=no,menubar=no,status=no,resizable=yes,scrollbars=yes,innerwidth=960,dependent=yes,screenX=32,screenY=32")
      //
	  location.href = "http://" + this.location.hostname +  "/pro/gex/pcatdtl0?ipartno=" + ipart ;
	   }

function getRefToDiv(divID,oDoc) {
  if( document.getElementById ) {
    return document.getElementById(divID); }
  if( document.all ) {
    return document.all[divID]; }
  if( !oDoc ) { oDoc = document; }
  if( document.layers ) {
    if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
      //repeatedly run through all child layers
      for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
        //on success, return that layer, else return nothing
        y = getRefToDiv(divID,oDoc.layers[x].document); }
    return y; } }
  return false;
}
function showDiv(divID_as_a_string) {
  //get a reference as above ...
  myReference = getRefToDiv(divID_as_a_string);
  if( !myReference ) {
    window.alert('Icompatible  browser');
    return; //don't go any further
  }
  //now we have a reference to it
  if( myReference.style ) {
    //DOM & proprietary DOM
    myReference.style.visibility = 'visible';
	myReference.style.display = 'inline';
  } else {
    //layers syntax
    myReference.visibility = 'show';
	myReference.display = 'inline' ;
  }
}

function hideDiv(divID_as_a_string) {
  //get a reference as above ...
  myReference = getRefToDiv(divID_as_a_string);
  if( !myReference ) {
    window.alert('Icompatible browser');
    return; //don't go any further
  }
  //now we have a reference to it
  if( myReference.style ) {
    //DOM & proprietary DOM
    myReference.style.visibility = 'hidden';
	myReference.style.display = 'none';
  } else {
    //layers syntax
    myReference.visibility = 'hide';
	myReference.display = 'none' ;
  }
}

function GetCookie(name) {
   var result = null;
   var myCookie = " " + document.cookie + ";";
   var searchName = " " + name + "=";
   var startOfCookie = myCookie.indexOf(searchName)
   var endOfCookie;
   if (startOfCookie != -1) {
      startOfCookie += searchName.length; // skip past cookie name
      endOfCookie = myCookie.indexOf(";",startOfCookie);
      result =
         unescape(myCookie.substring(startOfCookie,endOfCookie));
   }
   return result;
}

function Getlogdin() {
            var inorout = GetCookie("logdin");
			if (inorout == 'yes') {
			 hideDiv('logilbl');
			 showDiv('dtllbl');
			 showDiv('logolbl');
			 
			 }			
			else {
			 hideDiv('logolbl');
			 hideDiv('dtllbl');
			 showDiv('logilbl');		 
			 } 
			 
/*			var lng = GetCookie("lang");
			if (lng=='english') {
			                     showDiv('searchboxen');
			}
			else { 
			      if (lng=='french') {
			                          showDiv('searchboxfr');
			      }
			      else {
				        if (lng=='german') {
			                                showDiv('searchboxge');
				        }
				        else {
				              if (lng=='spanish') {
			                                       showDiv('searchboxge');
				              }
				              else {
				                    showDiv('searchboxen');
				              }
	 					}
				  }
			}
			*/
		 }
		 
function Getlogdout() {
            var inorout = GetCookie("logdin");
			if (inorout == 'yes') {
			   window.location.href="https://" + this.location.hostname + "/secure/gex/secure/logout";
			 
			 }			
			else
			 {
			 	window.location.href="https://" + this.location.hostname + "/secure/gex/secure/Prologin";
			 } 
			
		 }		
		  
function Getmydtls() {
            var inorout = GetCookie("logdin");
			if (inorout == 'yes') {
			   window.location.href="https://" + this.location.hostname + "/secure/gex/secure/MyDetails";
			 }			
						
		 }		
		