var myAnim1 = null;var myAnim2 = null;var GlobalInputID = 'txtsearch';var GlobalAnim = null
var GlobalImgBanner_BtnSelect = '';var GlobalMainClosed = 0;var GlobalImgBanner_Timer = 1
var GlobalImgBanner_Duration = 7500;var GlobalImgBanner_Reset = 0;var GlobalImgBanner_SelectTD = ''
var GlobalImgBanner_Array = new Array();var GlobalImgBanner_StartCount = 0;var GlobalImgCurrent = ''
GlobalXML_Array = new Array()
var GlobalImgBanner_Mode = 1;var GlobalImgBanner_Max = 4;var GlobalPage_Home = 0;var GlobalImgNew = ''
GlobalImgBanner_Array.push('images/banner/Banner-MiningIndustry1.jpg')
GlobalImgBanner_Array.push('images/banner/Banner-Lighting.jpg')    
GlobalImgBanner_Array.push('images/banner/Banner-MiningIndustry2.jpg')
GlobalImgBanner_Array.push('images/banner/Banner-Lighting.jpg')    
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){
      anylinkmenu.init("menuanchorclass")
      WindowEventLoad(locMainAddress)
      LocalInit()       
      LocalBasketUpdate()
  }
  else{setTimeout("TimerLoad()",100)}
}  
function LocalInit(){
   GlobalPopup_XPos = Utility_ScreenMiddle(1,400)+'px'
   GlobalPopup_YPos = '100px'
   GlobalPopup_ProductDetails = 1
   //GlobalPopup_Login = 1
   //GlobalPopup_Register = 1
   var locObj = document.getElementById('Divider_Home')
   if (locObj != null){GlobalPage_Home = 1}
   var locURL = document.URL.toLowerCase()
   if (locURL.indexOf('aboutus') != -1) {Utility_HighlightSet(3,'TD_MenuTop2','TD_MenuTop','menutop')}	     
   else if (locURL.indexOf('contactus.html') != -1) {Utility_HighlightSet(3,'TD_MenuTop3','TD_MenuTop','menutop')}	     
   else if (locURL.indexOf('enquiry.html') != -1) {
      Utility_HighlightSet(3,'TD_MenuTop4','TD_MenuTop','mmenutop')   	   	   	
      var locObj = document.getElementById('Enquiry_Product')
      var locProduct = Utility_URLRetrieveParam('autofill','#')	
      if (locObj != null) {locObj.value = locProduct}
   }else{Utility_HighlightSet(3,'TD_MenuTop1','TD_MenuTop','menutop')}
}
function LocalLoginStart(){
	Screen_DividerDisplay('otherPages',1)
	Utility_Divider(1,'Div_ImgBanner1')
	Utility_Divider(1,'Div_ImgBanner2')
}
function LocalPage(pMode){
  if (pMode==1){WebDisplay_UserLogin()}
  if (pMode==2){WebDisplay_UserRegister()}  
  if (pMode==3){BasketDisplayCurrent(1,'QuoteDebtor')}  
  if (pMode==4){BasketDisplayHistory(1,'QuoteDebtor')}    
  if (pMode == 5){WebDisplay_ProductRequest('Product_Request.xsl','Divider_RegisterWindow','ProductRequest_')}
}
function LocalBasketUpdate(){
   var locCntItem = BasketTotal(1,'QuoteDebtor')
   var locCntQty  = BasketTotal(2,'QuoteDebtor')
   var locDiv1 = document.getElementById('quote_totalitem')
   var locDiv2 = document.getElementById('quote_totalqty')   
   if (locDiv1 != null && locDiv2 != null){
      if (locCntItem == 0){locDiv1.innerHTML = ' - Nb. of Items:<font style="font-family:Arial, Helvetica, sans-serif; font-size:10px; color:#000080">'+locCntItem+'</font>'}
      else{locDiv1.innerHTML = ' - Nb. of Items:<font style="font-family:Arial, Helvetica, sans-serif; font-size:10px; color:#C00000">'+locCntItem+'</font>'}
      if (locCntQty == 0){locDiv2.innerHTML = '- Total Quantity:<font style="font-family:Arial, Helvetica, sans-serif; font-size:10px; color:#000080">'+locCntQty+'</font>'}
      else{locDiv2.innerHTML = '- Total Quantity:<font style="font-family:Arial, Helvetica, sans-serif; font-size:10px; color:#C00000">'+locCntQty+'</font>'}
   } 
}
function LocalDisplayProduct(pSection,pIndex){
   var locID = GlobalXML_Array[pIndex]
   if (locID==null||locID.length==0){
      var locStatement = 'SELECT ID,NAME,PARENTID FROM dbo.Product WHERE (NAME LIKE \'%'+pSection+'%\' AND PARENTID IS NULL)'
      var xmlString = DataFnc_LoadSQL('PRODUCT',1,'',16,locStatement,0,0)
      var locID = UtilityXML_ExtractValue(xmlString,'id')
   	  GlobalXML_Array.push(locID)
   }
   if (locID!=null&&locID.length>0){
      WebFnc_TransformItemSummary(2,'Product_ChildrenSummary.xsl','Divider_ProductDetails',locID,pSection,'ID,PARENTID,CHILDCOUNT,ISLEAF,NAME,SEQUENCE,IMAGENAME,IMAGEPATH')
   }
}
function LocalTree(pTreeID,pSection){
	LocalTreeTitle(pSection)
	LocalTreeParentName(pTreeID,pSection)
 	WebDisplay_TreeInit(pTreeID)	
}
function LocalSearch(pInputID,pEvent){
   GlobalInputID = pInputID
   if (pEvent != null){
      var locKey = Utility_EnterKey(event,pInputID,1)
      if (locKey != 13){return}
   }
   GlobalInputID = pInputID
   var locTitle = window.location.href
   var locSearch = document.getElementById('txtsearch')   
   WebDisplay_DataSearch('Search_Item.xsl','Divider_SearchDetails',2,GlobalInputID,'',GlobalMemory_Search,Tree_RowPerPage('Tree_ecat'),1,'','','ID, Name, Code, ChildCount, InfoAmount1, InfoAmount2, ImageName, ImagePath')
}
function LocalUserDetails(){
}
