    var myAnim = null;var myAnimCounter = 0;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 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.toLowerCase().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>')
    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>')
    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)
  	  LocalLoadSupplier()      
      LocalInit_Anim()  	  	  
  }
  else
  {
          setTimeout("TimerLoad()",100)
  }
}  
function LocalTree(pTreeID,pSection){
	//LocalTreeTitle(pSection)
	Tree_ParentSection(pTreeID,pSection)
 	WebDisplay_TreeInit(pTreeID)	
}
function LocalInit_Anim()
{
		YUI().use('anim', function(Y) {
			myAnim = new Y.Anim({
				node: '#Div_TreeAnim',
				from: { 
					 opacity: 0
				},																				
				to: { opacity: 1
				 }
				//easing: Y.Easing.backIn
			});
			function handleTween(e)
			{

			}
			function handleStart(e)
			{
			   var locObjTree = document.getElementById('Tree_ecat')
	           var locTreeParam = Utility_TreeParam(0,locObjTree)
	           locTreeParam = UtilityText_Replace(locTreeParam,'INIT[0]','INIT[1]')
 	           Utility_TreeParam(1,locObjTree,locTreeParam)	           
			   //Y.one('#Div_TreeAnim').setStyle('opacity',0)
			   WebDisplay_TreeInit('Tree_ecat')
			   myAnimCounter = 1
			}
			myAnim.set('duration', 2); 
			myAnim.on('start',handleStart)
			myAnim.on('tween',handleTween)
			Y.one('#Div_TreeAnim').setStyle('opacity',0)
            myAnim.run()			
			//Y.one('#Div_TreeAnim').setStyle('opacity',0)  //.on('click',handleClick)
			
		})
}		

function LocalSearch(pKeyEvent)
{
	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 = 'DATABASEID = \'EC-ZA-0-83\'' 	
    var locList = document.getElementById('supplist')
    if (locList != null)
    {
     var locIndex = locList.selectedIndex
     if (locIndex != null && 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,'navsearch',null,'',0)
}
function LocalLoadSupplier()
{
   var xmlString = DataFnc_LoadSQL('COMPANY',100,'',16,'SELECT ID,NAME,ParentID FROM dbo.Company WHERE (ParentID is NULL AND DATABASEID = \'EC-ZA-0-83\')',1)
   xmlString = DataFnc_FieldSort(xmlString,'name')
   Utility_ListFillXML('supplist',xmlString)
   locList = document.getElementById('supplist')
   if (locList != null)
   {
       var elOptNew = document.createElement('option')
       elOptNew.text = 'All Suppliers'
       elOptNew.value = ''
       locList.options.add(elOptNew,0)
       locList.selectedIndex = 0
   }   
}

function LocalEnterKey(event)
{
   var locKey = Utility_EnterKey(event,'txtsearch',1)
   if (locKey == 13)
   {
      LocalSearch()
   }
}

<!--
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) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); 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];}
}