function popupon() {
      document.getElementById("popupDiv").className="popupOn";
      }
      function popupoff() {
      document.getElementById("popupDiv").className="popupoff";
      }
      
function pushBack(pointer) {
        var text = pointer.firstChild.data ;
        // note : strips any leading spaces!
         document.getElementById('Catlook').value = (text.replace(/^\W+/,'')).replace(/\W+$/,'') ;
         document.getElementById('GFSeaDiv').className = 'GFpopoff' ;
         //document.getElementById('Catlook').focus() ;
         //alert(document.getElementById('Catlook').value) ;
         EWDSEART() ;
        }
        
function pushBacka(pointer) {
        var text = pointer.firstChild.data ;
         document.getElementById('Catlooka').value = (text.replace(/^\W+/,'')).replace(/\W+$/,'') ;
         document.getElementById('GFSeaDiva').className = 'GFpopoff' ;
         //alert(document.getElementById('Catlook').value) ;
         //document.getElementById('Catlooka').value = (text.replace(/^\W+/,'')).replace(/\W+$/,'') ;
         //alert(document.getElementById('Catlooka').value) 
         EWDSEARTB() ;
        }
        
function clear(pointer) {
        var text = pointer.firstChild.data ;
        // note : strips any leading spaces!
         document.getElementById('SearList').value ='' ;
         document.getElementById('CatSel').focus() ;
        }

function localControl(e) {
        if (e.keyCode == 9) {
       document.getElementById("GFSeaDiv").className = "GFpopoff" ;
	    }
      }
      
function startEWDApp() {
       EWD.ajax.base = "https://www.goodfellow.com/ewdphp/catalogue/" ;
       document.getElementById("contentWrapper").innerHTML="" ;
       document.getElementById("homeContentWrapper").innerHTML="" ;
       document.getElementById("dropdowns").innerHTML="" ;
       document.getElementById("wrapperHome").style.background="transparent" ;
       document.getElementById("wrapper").style.background="transparent" ;
      }

function EWDRND() {
      startEWDApp()
      //document.getElementById("dropdowns").innerHTML="" ;
      document.body.id="folder1" ;
      EWD.ajax.getFragment("GFRandD.php","gcWrapper") ;
      }
      
function LoadLHS() {
       EWD.ajax.getFragment("GFLHS.php","GCLeft") ;
       }
       
function LoadRHS() {
       EWD.ajax.getFragment("GFCatInit.php","GCRight") ;
       }
      
function EWDINP(e) {
	if(window.event) // IE
	  {
	  keyp = e.keyCode;
	  }
	else if(e.which) // Netscape/Firefox/Opera
	  {
	  keyp = e.which;
	  }
       //var keyp = document.getElementById("txtgsearch").keyCode
       //alert(keyp)
       if (keyp == 13) { 
         EWDRNDS();
         }
       }
      
function startEWDAppST() {
       EWD.ajax.base = "https://www.goodfellow.com/ewdphp/catalogue/" ;
       document.getElementById("contentWrapper").innerHTML="" ;
       document.getElementById("dropdowns").innerHTML="" ;
       document.getElementById("wrapper").style.background="transparent" ;
      }
      
function EWDRNDST() {
      startEWDAppST()
      document.body.id="folder1" ;
      Lang = document.getElementById('DocLang').value ;
      EWD.ajax.getFragment("GFRandDS.php?Lang=" + Lang,"gcRight") ;
      }
      
function EWDSEART() {

      document.body.id="folder1" ;
      GS = document.getElementById('Catlook').value ;
      EWD.ajax.getFragment("GFCatSeaRei.php?CL=" + GS,"GCRight") ;
      }
      
function EWDSEARTB() {

      document.body.id="folder1" ;
      GS = document.getElementById('Catlooka').value ;
      EWD.ajax.getFragment("GFCatSeaRei.php?CL=" + GS,"GCRight") ;
      }
     
function EWDRNDA() {
      document.body.id="folder1" ;
      EWD.ajax.getFragment("GFRandD.php","gcWrapper") ;
      }
      
function EWDRNDSold() {
      //alert(document.getElementById('txtgsearch').value) ;
      GSear = document.getElementById('txtgsearch').value ;
      startEWDApp() ;
      
      document.body.id="folder1" ;
      EWD.ajax.getFragment("GFRandDT.php?GSear=" + GSear,"gcWrapper") ;
      }
      
function EWDRNDS() {
      //alert(document.getElementById('txtgsearch').value) ;
      GSear = document.getElementById('txtgsearch').value ;
      GSear = GSear + "$" + document.getElementById('__selLang').value ;
           
      document.location="https://www.goodfellow.com/ewdphp/catalogue/GFHomees.php?GSear=" + GSear ;
      }

 function EWDRNDC() {
       //alert(document.getElementById('txtgsearch').value) ;
       GSear = document.getElementById('txtgsearch').value ;
       startEWDApp() ;
       
       document.body.id="folder1" ;
       EWD.ajax.getFragment("GFRandDTC.php?GSear=" + GSear,"gcWrapper") ;
      }
      
function EWDSEA() {
       //alert(document.getElementById('Catlook').value) ;
       //alert(document.getElementById('Catlook').keyCode) ;
       //keyCode = document.getElementById('Catlook').keyCode ;
       // cCde = document.getElementById('Catlook').value 
       //alert
       //if (e.keyCode == 13) {
       //      alert("keyCode=13") ;
       //       document.getElementById('Catlook').keyCode = 23 ;
       //       //document.getElementById('GFSeaDiv').className = 'GFpopoff' ;
       //                 
       //    }
      
       }
    
function startEWDINDA() {
       EWD.ajax.base = "/ewdphp/catalogue/" ;
       document.getElementById("dropdowns").innerHTML="" ;
       document.getElementById("wrapperHome").style.background="transparent" ;
       document.getElementById("wrapper").style.background="transparent" ;
      }
      
function EWDINDAS() {
      //alert(document.getElementById('Indexsearch').value) ;
      GSear = document.getElementById('Indexsearch').value ;
      GLang = document.getElementById('Indexlang').value ;
      //alert(GLang) ;
      GSeara = GSear + "$" + GLang
      //alert(GSeara)
      startEWDINDA() ;
      
      document.body.id="folder1" ;
      EWD.ajax.getFragment("GFRandDS.php?GSear=" + GSeara,"GCRight") ;
      }
      
function EWDHEAS() {
      GSear = document.getElementById('selform').value ;
      GLang = document.getElementById('Indexlang').value ;
      GSeara = GSear + "$" + GLang
      startEWDINDA() ;
      
      document.body.id="folder1" ;
      EWD.ajax.getFragment("GFRandDS.php?GSear=" + GSeara,"GCRight") ;
      }    

function EWDHEASA() {
      //alert(this.value) ;
      //GSear = this.value ;
      //alert(document.getElementById('selform').value) ;
      GSear = document.getElementById('selform').value ;
      GLang = document.getElementById('Indexlang').value ;
      GSeara = GSear + "$" + GLang ;
      //alert(GSeara) ;
      startEWDINDA() ;
      document.body.id="folder1" ;
  
      EWD.ajax.getFragment("GFRandDUR.php?GSear=" + GSeara,"GCRight") ;
      }


function dsumm() {
      //alert('Emptying dsumm') ;
       //document.getElementById('dsumm').innerHTML = ''
       }
       
function nodsumm() {
       }


function GFAlerta() {
       alert('Searet') ;
       }

function IORDCLO() {
     document.getElementById("Iorders").innerHTML="" ;
     }
function IORDSHO() {
     var popupPointer = document.getElementById('Iorders') ;
        popupPointer.className='Iorderon' ;
     }
      
function popup(obj) {
        var popupPointer = document.getElementById('popupDiv') ;
        popupPointer.className='popupOn' ;
        var y = EWD.utils.findPosY(obj) ;
        var x = EWD.utils.findPosX(obj) ;
        popupPointer.style.top = y + 10 + "px" ;
        popupPointer.style.left = 0 + "px" ;
      }
      
function GFpopup(obj) {
        var popupPointer = document.getElementById('GFSeaDiv') ;
        popupPointer.className='GFpopOn' ;
        var y = EWD.utils.findPosY(obj) ;
        var x = EWD.utils.findPosX(obj) ;
        popupPointer.style.top = 60 + "px";
        popupPointer.style.left = 70 + "px" ;
      }
      
 function GFpopupi(obj) {
         var popupPointer = document.getElementById('GFSeaDiv') ;
         popupPointer.className='GFpopOn' ;
         var y = EWD.utils.findPosY(obj) ;
         var x = EWD.utils.findPosX(obj) ;
         popupPointer.style.top = 180 + "px";
         popupPointer.style.left = 100 + "px" ;
      }
      
 function GFpopQup(obj) {
         var popupPointer = document.getElementById('GFSeaDiva') ;
         popupPointer.className='GFpopOn' ;
         var y = EWD.utils.findPosY(obj) ;
         var x = EWD.utils.findPosX(obj) ;
         popupPointer.style.top = 190 + "px";
         popupPointer.style.left = 380 + "px" ;
      }
      
 function GFPopQClo(obj) {
  
          var popupPointer = document.getElementById('GFSeaDiva') ;
          popupPointer.className='GFpopoff' ;
      }
      
 function glossup(obj) {
        var popupPointer = document.getElementById('popupgloss') ;
        popupPointer.className='glossona' ;
        var y = EWD.utils.findPosY(obj) ;
        var x = EWD.utils.findPosX(obj) ;
        popupPointer.style.top = y - 100 + "px" ;
        popupPointer.style.left = 0 + "px" ;
      }
      
 function maskup(obj) {
         var popupPointer = document.getElementById('popupgloss') ;
         popupPointer.className='glossona' ;
         var y = EWD.utils.findPosY(obj) ;
         var x = EWD.utils.findPosX(obj) ;
         popupPointer.style.top = y - 150 + "px" ;
         popupPointer.style.left = 0 + "px" ;
      }
      
 function spemask(obj) {
           var popupPointer = document.getElementById('spemaskf') ;
           popupPointer.className='glossonb' ;
           var y = EWD.utils.findPosY(obj) ;
           var x = EWD.utils.findPosX(obj) ;
           popupPointer.style.top = y - 30 + "px" ;
           popupPointer.style.left = 0 + "px" ;
      }
      
 function spemclo(obj) {
           var popupPointer = document.getElementById('spemaskf') ;
           popupPointer.className='glossoffb' ;
          
      } 
      
 function Dmessup(obj) {
          var popupPointer = document.getElementById('lsmess') ;
          popupPointer.className='messona' ;
          var y = EWD.utils.findPosY(obj) ;
          var x = EWD.utils.findPosX(obj) ;
          popupPointer.style.top = 40 + "px" ;
          popupPointer.style.left = 0 + "px" ;
      }
       
function messoff(obj) {
          var popupPointer = document.getElementById('lsmess') ;
          popupPointer.className='messoffa' ;
            
      }
      
 function hdinfoff() {
      document.getElementById("popupgloss").className="hdinfoffa";
      }
      
 function hdinfon(obj) {
        var popupPointer = document.getElementById('popupgloss') ;
        popupPointer.className='hdinfona' ;
        var y = EWD.utils.findPosY(obj) ;
        var x = EWD.utils.findPosX(obj) ;
        popupPointer.style.top = y - 150 + "px" ;
        popupPointer.style.left = 0 + "px" ;
      }
      
 function shocaloff() {
       document.getElementById("shocals").className="shocaloffa";
       }
      
 function shocalon(obj) {
         var popupPointer = document.getElementById('shocals') ;
         popupPointer.className='shocalona' ;
       }
      
 function popupglossoff() {
      document.getElementById("popupgloss").className="glossoffa";
      }

function baskclose() {
            document.getElementById("popupgloss").className="glossoffa";
           
      }
      
 function popupgloss() {
        popupPointer = document.getElementById('popupgloss') ;
        popupPointer.className='glossona' ;
        var y = EWD.utils.findPosY(obj) ;
        var x = EWD.utils.findPosX(obj) ;
        popupPointer.style.top = y + 10 + "px" ;
        popupPointer.style.left = 0 + "px" ;
      }
function GFfocusa() {
       document.getElementById('Catlook').focus() ;
      }
 
function GFlogin() {
       document.getElementById('UserName').focus() ;
      }

function ccardoff() {
      //document.getElementById("CcardDets").className="ccrdoff";
	document.getElementById('CcardDets').innerHTML="";
      }

function ccardona(obj) {
        popupPointer = document.getElementById('CcardDets') ;
        popupPointer.className='ccrdon' ;
        var y = EWD.utils.findPosY(obj) ;
        var x = EWD.utils.findPosX(obj) ;
        popupPointer.style.top = y+20 + "px" ;
        popupPointer.style.left =x-150 + "px";
      }
function ccardon(obj) {
        document.getElementById('CcardDets').style.visibility="visible";
        document.getElementById('CcardDets').style.display="";
       }

function Passask(obj) {
         var username= document.getElementById("loginUsername").value
         var usermail= document.getElementById("loginEmail").value
        
      }
      
function GFprintDiv(divId,height,width,top,left,title,styleSrc,autoprint,path) {
if (!height) height= "800";
if (!width) width= "780";
if (!top) top= "200";
if (!left) left= "100";
var DateTime=document.getElementById('DateTime').value ;
var domNode=document.getElementById(divId);
var params="height="+height+",width="+width;
if (navigator.appName=='Netscape') {
params=params+',ScreenX='+left+',ScreenY='+top;
}
else {
params=params+',left='+left+',top='+top+',';
}
var outputWindow;
outputWindow=window.open("","",params);
outputWindow.document.open("text/html", "replace");
if (!title) title="Print";
outputWindow.document.write("<html><head><title>"+title+"</title>\n");
outputWindow.document.write("</head><body>\n");
if (!autoprint) outputWindow.document.write("<div id='printButton'><input type='button' value='Print' onClick='document.getElementById(\"printButton\").innerHTML=\"\" ; window.print()' /><hr/></div>\n");
outputWindow.document.write("<Table width='600'><tr><td class='GFG'>Goodfellow</td><td align='right' class='bTn'>"+DateTime+"</td></tr></table>\n");
outputWindow.document.write("<div id='add'></div>\n");
outputWindow.document.write("</body></html>\n");
outputWindow.document.close();
if (styleSrc) EWD.page.addStylesheet(outputWindow.document,styleSrc);
EWD.page.addStylesheet(outputWindow.document,'http://www.goodfellow.com/ewdphp/catalogue/styles/GFEWD.css');
EWD.page.addStylesheet(outputWindow.document,'http://wWw.goodfellow.com/ewdphp/catalogue/styles/Nucleus.css');
var importedMarkup=domNode.innerHTML;
outputWindow.document.getElementById('add').innerHTML=importedMarkup;
if (autoprint) {
outputWindow.print();
outputWindow.close();
}
}

