var locCount = 0
var myDomain = document.domain 
var myURL = document.URL 
if (myURL.toLowerCase().indexOf('.htm') != -1){
   var pu1 = myURL.lastIndexOf('/')  
   var pu2 = myURL.lastIndexOf('\\')  
   if (pu1 != -1 && pu1 > pu2){myURL = myURL.substring(0,pu1)}
   else{myURL = myURL.substring(0,pu2)}
}
var lng=myURL.length
if (myURL.substring(lng-1,lng)=='#'){myURL=myURL.substring(0,lng-1)}

var locAddress = myURL+'/Library/'
var locMainAddress = myURL
if(myDomain.toLowerCase().indexOf('websites_ecatalogue') != -1 || myURL.toLowerCase().indexOf('websites_ecatalogue') != -1 ||  myURL.toLowerCase().indexOf('file://') != -1){
   locMainAddress = 'http://196.30.166.51/qaCatalogue'
   locAddress = 'http://196.30.166.51/qaCatalogue/Library/' 
}
if(myDomain.toLowerCase().indexOf('localhost_ecat') != -1 || myURL.toLowerCase().indexOf('localhost_ecat') != -1){
   locMainAddress = 'http://localhost/onlinecatalogue/electronic%20catalogue' 
   locAddress = 'http://localhost/onlinecatalogue/electronic%20catalogue/Library/' 
}
document.write('<sc'+'ript');document.write(' type="text/javascript"');document.write(' language="JavaScript"');document.write(' src="'+locAddress+'JavaScriptWindowEvent.js">');document.write('</sc'+'ript>')
document.write('<sc'+'ript');document.write(' type="text/javascript"');document.write(' language="JavaScript"');document.write(' src="'+locAddress+'JavaScriptLibrary.js">');document.write('</sc'+'ript>')
document.write('<sc'+'ript');document.write(' type="text/javascript"');document.write(' language="JavaScript"');document.write(' src="'+locAddress+'JavaScriptDataFnc.js">');document.write('</sc'+'ript>')
document.write('<sc'+'ript');document.write(' type="text/javascript"');document.write(' language="JavaScript"');document.write(' src="'+locAddress+'JavaScriptTree.js">');document.write('</sc'+'ript>')
document.write('<sc'+'ript');document.write(' type="text/javascript"');document.write(' language="JavaScript"');document.write(' src="'+locAddress+'JavaScriptUtility.js">');document.write('</sc'+'ript>')
setTimeout("TimerLoad()",1000)
	
function TimerLoad(){
  if (document.readyState=='complete'){
	  GlobalPopup_XPos = Utility_ScreenMiddle(1,400)
      GlobalPopup_YPos = 30
      WindowEventLoad(locMainAddress)
      GlobalPopup_ProductDetails = 1
      EventTransform('','','otherPages')
  }
  else{setTimeout("TimerLoad()",1000)}
}  
function LocalInit(){
   var locURL = document.URL.toLowerCase()	
   if (locURL.indexOf('enquiry.html') != -1) { 
      var locObj = document.getElementById('Enquiry_Product')
      var locProduct = Utility_URLRetrieveParam('autofill','#')	
      if (locObj != null) {locObj.value = locProduct}
   }	     
}
function Local_TopLink(pInfo1,pInfo2){
   if (pInfo1==1){WebDisplay_ItemDetails(pInfo2)}
	if (pInfo1==2){
		var locObj=document.getElementById('txtsearch')
		locObj.value=pInfo2
		LocalSearch('txtsearch')
} }

function LocalSelect(pTD){
   //var locObjTD=document.getElementById(pTD)
   //locObjTD.bgColor='#333333'
}
function LocalQuickSearch(pText){
   document.getElementById('txtsearch').value=pText
   LocalSearch('txtsearch')
}	
function LocalSearch(pInputID,pKeyEvent){
	GlobalInputID = pInputID
	if (pKeyEvent != null){
       if (pKeyEvent != null && pKeyEvent != 0){
         var locKey = Utility_EnterKey(pKeyEvent,'',1)
         if (locKey != 13) {return}
       } 
    } 
    ProgressImageDisplay(true)
    setTimeout("TimerSearch1()",100)	
}
function TimerSearch1(){
 var locFilter = ''
 WebDisplay_DataSearch('Search_Item.xsl','Divider_SearchDetails',2,GlobalInputID,locFilter,GlobalMemory_Search,Tree_RowPerPage('Tree_ecat'),1,'navsearch',null,'',0)
}

