    var locCount = 0
    var locLastSection = ''
	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 locAddress = myURL+'/Library/'
	var locMainAddress = myURL
	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/' 
	}
	else if(myDomain.toLowerCase().indexOf('websites_ecatalogue') != -1 || myURL.toLowerCase().indexOf('websites_ecatalogue') != -1 || myURL.indexOf('file://') != -1)
	{
        locMainAddress = 'http://196.30.166.51/qaCatalogue'
        locAddress = 'http://196.30.166.51/qaCatalogue/Library/' 
	}
	document.write('<sc'+'ript')
	document.write(' type="text/javascript"')
	document.write(' language="JavaScript"')
	document.write(' src="'+locAddress+'JavaScriptWindowEvent.js">')
	document.write('</sc'+'ript>')
   //------------ JavaScriptLibrary.js ---------------
   document.write('<sc'+'ript')
   document.write(' type="text/javascript"')
   document.write(' language="JavaScript"')
   document.write(' src="'+locAddress+'JavaScriptLibrary.js">')
   document.write('</sc'+'ript>')
   //------------ JavaScriptDataFnc.js ---------------
   document.write('<sc'+'ript')
   document.write(' type="text/javascript"')
   document.write(' language="JavaScript"')
   document.write(' src="'+locAddress+'JavaScriptDataFnc.js">')
   document.write('</sc'+'ript>')
   //------------ JavaScriptTree.js ---------------
   document.write('<sc'+'ript')
   document.write(' type="text/javascript"')
   document.write(' language="JavaScript"')
   document.write(' src="'+locAddress+'JavaScriptTree.js">')
   document.write('</sc'+'ript>')
   //------------ JavaScriptUtility.js ---------------
   document.write('<sc'+'ript')
   document.write(' type="text/javascript"')
   document.write(' language="JavaScript"')
   document.write(' src="'+locAddress+'JavaScriptUtility.js">')
   document.write('</sc'+'ript>')
   //------------ JavaScriptBasket.js ---------------
   document.write('<sc'+'ript')
   document.write(' type="text/javascript"')
   document.write(' language="JavaScript"')
   document.write(' src="'+locAddress+'JavaScriptBasket.js">')
   document.write('</sc'+'ript>')
   setTimeout("TimerLoad()",1000)
	
function TimerLoad()
{
  var locData = document.getElementById('MainVariable_(ID)')
  if (locData == null)
  {
     locData = document.getElementById('CatalogueID)')
  }
  if (locData != null)
  {
      WindowEventLoad(locMainAddress)
  }
  else
  {
     setTimeout("TimerLoad()",1000);
  }
}  
function LocalSearch()
{
   var locTitle = window.location.href
   var locSearch = document.getElementById('txtsearch')   
   if (locTitle.toLowerCase().indexOf('products') == -1)
   {
       setTimeout("LocalOnLoad()", 1000);
	   var locURL = Utility_URL()
       window.location.href = locURL+'/products.html?autosearch='+locSearch.value
   }    
   else
   {
	  WebSearch_Clear()
	  var locFilter = ''
	  var locList = document.getElementById('supplist')
	  if (locList != null)
	  {
		 var locIndex = locList.selectedIndex
		 if (locIndex != 0)
		 {
			locFilter = locList.options[locIndex].text
			locFilter = 'CompanyName = \''+locFilter+'\''
		 }   
	  }
	  WebDisplay_DataSearch('Search_Item.xsl','Divider_SearchDetails',2,'txtsearch',locFilter,GlobalMemory_Search,Tree_RowPerPage('Tree_ecat'),1)
      // WebDisplay_Search(1,2)
   }
}
function LocalEnterKey(event)
{
   var locKey = Utility_EnterKey(event,'txtsearch',1)
   if (locKey == 13)
   {
      LocalSearch()
   }
}
function LocalTree(pSection)
{
	var locObj = document.getElementById('span_TreeTitle')
	var locSection  = ''
	if (pSection != null) {locSection = pSection}
	if (locLastSection == locSection) {return}
	locLastSection = locSection
	if (locObj != null)
	{
		if (pSection == null || pSection.length==0)
		{
		   locObj.innerHTML = 'Trans Electron eCatalogue'
		}
	    else
		{
		   locObj.innerHTML = locSection
	    }
	}
	var locObjTree = document.getElementById('Tree_ecat')
	if (locObjTree != null)
	{
	   var locTreeParam = Utility_TreeParam(0,locObjTree)
	   var locTreeParent = UtilityText_ExtractText(locTreeParam,'TreeParentName(',')') 
	   if (locTreeParent.length == 0)
	   {
	   	  locTreeParam = locTreeParam+'TreeParentName('+locSection+')'
	   }
       else
       {
       	  locTreeParam = UtilityText_Replace(locTreeParam,'TreeParentName('+locTreeParent+')','TreeParentName('+locSection+')')
       }
	   locTreeParam = Utility_TextReplace(locTreeParam,'TreeParentName()','')       
 	   Utility_TreeParam(1,locObjTree,locTreeParam)
 	   WebDisplay_TreeInit('Tree_ecat',1)
	}
	if (pSection != null && pSection.length>0)
	{
		Utility_Divider(1,'Divider_CompleteCatalogue')
	}
    else
	{
		Utility_Divider(2,'Divider_CompleteCatalogue')
	}
}
