var GlobalInputID = 'txtsearch';var GlobalPage_Home = 0;var Global_DisableAction=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('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+'JavaScriptAnimation.js">');document.write('</sc'+'ript>')
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(){
  var locData = document.getElementById('ProgressBar')
  if (locData != null){
      WindowEventLoad(locMainAddress)
      LocalInit()
      LocalInit_Anim()      
      changeColour('Specials')

  }else{setTimeout("TimerLoad()",100)}
}  
function LocalProduct_Children(pParentID){}
function LocalProduct_Parent(pMode,pSection){
	var locObjDiv=document.getElementById('Divider_ProductDetails')
	for (var i=0;i<GlobalHistoryParentName.length;i++){
      if (GlobalHistoryParentName[i]==pSection){
      	 locObjDiv.innerHTML=GlobalHistoryHTML[i]
      	 return
    } }	 
	var locSection = pSection
    var locStatement = 'SELECT ID,NAME,ISLEAF,WINSTYLE,CHILDCOUNT,ITEMLEVEL FROM dbo.Product WHERE (NAME = \''+locSection+'\' AND ITEMLEVEL <= 2)'
	var xmlString_Parent = DataFnc_LoadSQL('PRODUCT',1,'',16,locStatement,0,0)
	if (UtilityXML_isEmpty(xmlString_Parent)==false){
		var locParentID = UtilityXML_ExtractValue(xmlString_Parent,'id')
		var locName = UtilityXML_ExtractValue(xmlString_Parent,'name')
		if (pMode==1){
		  WebFnc_TransformItemSummary(2,'Product_ChildrenSummary.xsl','Divider_ProductDetails',locParentID,locName,'ID,NAME,CODE,PARENTID,CHILDCOUNT,ISLEAF,IMAGENAME,IMAGEPATH')
	    }
	    else{
		  WebFnc_TransformItemSummary(2,'Product_ChildrenSummary(2).xsl','Divider_ProductDetails',locParentID,locName,'ID,NAME,CODE,PARENTID,CHILDCOUNT,ISLEAF,IMAGENAME,IMAGEPATH')	    
	    }
	}	
}
function Local_VariableItemSummary_RemoveParent(){
	return false
}
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 changeColour(elementId) {
    var interval = 1000;
    var colour1 = "#ff0000"
    var colour2 = "#3A2A00";
    if (document.getElementById) {
        var element = document.getElementById(elementId);
        element.style.color = (element.style.color == colour1) ? colour2 : colour1;
        setTimeout("changeColour('" + elementId + "')", interval);
    }
}
function Local_WindowAction(){
  if (Global_DisableAction==0){
     var locObjDiv1 = document.getElementById('Harting_summary')
     if (locObjDiv1!=null){locObjDiv1.style.visibility='hidden';locObjDiv1.style.position='absolute'}
  }   
  Global_DisableAction=0
}
function LocalPage(pMode){
	if (pMode==1){LocalDistributor()}
	if (pMode==2){WebDisplay_UserRegister()}
}
function LocalInit(){
   GlobalPopup_XPos = Utility_ScreenMiddle(1,400)
   GlobalPopup_YPos = 100
   GlobalPopup_Login = 1
   GlobalPopup_Register = 1
   GlobalPopup_ProductDetails = 1
   var locObj=document.getElementById('Divider_HomePage')
   if (locObj!=null){GlobalPage_Home=1}
   var locURL = document.URL.toLowerCase()
   
   var p1=locURL.indexOf('(')
   var p2=locURL.indexOf('(')
   if (p1!=-1&&p2!=-1){
      var locIndex=UtilityText_ExtractText(locURL,'(',')')
      LocalCatalogueDisplay(locIndex)
   }
  GlobalImgBanner_Array.push('images/banner/Banner_1.jpg')
  GlobalImgBanner_Array.push('images/banner/Banner_2.jpg')    
  GlobalImgBanner_Array.push('images/banner/Banner_3.jpg')    
  GlobalImgBanner_Array.push('images/banner/Banner_4.jpg')    
  GlobalImgBanner_Array.push('images/banner/Banner_5.jpg')    
  GlobalImgBanner_Array.push('images/banner/Banner_6.jpg')    
}

function LocalCatalogueDisplay(pMode){
	if (pMode==0){LocalProduct_Parent('')}
	if (pMode==1){Global_DisableAction = 1;LocalProduct_Parent(1,'Harting')}	
	if (pMode==2){LocalProduct_Parent(1,'Tools')}
	if (pMode==3){LocalProduct_Parent(1,'Test Instruments')}		
	if (pMode==4){LocalProduct_Parent(1,'Miscellaneous Products')}			
	if (pMode==5){LocalProduct_Parent(2,'Identification Systems')}				
	if (pMode==6){LocalProduct_Parent(2,'Cable Securing Systems')}					
	if (pMode==7){LocalProduct_Parent(2,'Heat Shrink Tubing')}
	if (pMode==8){LocalProduct_Parent(2,'Crimping Terminals')}
	if (pMode==9){LocalProduct_Parent(2,'Accessories')}	
}

function LocalHideMain(){
   document.getElementById('Divider_Anim1').style.visibility = 'hidden'
   document.getElementById('Divider_Anim2').style.visibility = 'hidden'   
   document.getElementById('Divider_Anim3').style.visibility = 'hidden'   
   document.getElementById('Divider_Anim4').style.visibility = 'hidden'   
   document.getElementById('Divider_Anim5').style.visibility = 'hidden'   
   if (GlobalPage_Home == 1){myAnim11.run()}   
}
function LocalActiveSection(pSection){
   Utility_Divider(2,'otherPages')
   Utility_Divider(2,'Divider_Anim6')
   Utility_Divider(2,'Divider_Anim7')   
   Utility_Divider(2,'Divider_Anim8')   
   Utility_Divider(2,'Divider_Anim9')   
   Utility_Divider(2,'Divider_Anim10')   
   Utility_Divider(1,'Divider_CatalogueSection')   
   if (pSection == 1){
   	  document.getElementById('Divider_Anim6').style.visibility = 'visible'
   	  document.getElementById('Divider_Anim6').style.position = 'static'
   	  if (Utility_ArrayGet(AnimArray,pSection) == 0){  myAnim6.run()}
   }
   if (pSection == 2){
   	  document.getElementById('Divider_Anim7').style.visibility = 'visible'   	
   	  document.getElementById('Divider_Anim7').style.position = 'static'   	  
   	  if (Utility_ArrayGet(AnimArray,pSection) == 0){  myAnim7.run()}   	  
   }
   if (pSection == 3){
   	  document.getElementById('Divider_Anim8').style.visibility = 'visible'   	
   	  document.getElementById('Divider_Anim8').style.position = 'static'   	  
   	  if (Utility_ArrayGet(AnimArray,pSection) == 0){  myAnim8.run()}   	  
   }
   if (pSection == 4){
   	  document.getElementById('Divider_Anim9').style.visibility = 'visible'
   	  document.getElementById('Divider_Anim9').style.position = 'static'   	  
   	  if (Utility_ArrayGet(AnimArray,pSection) == 0){  
   	  myAnim9.run()}   	  
   }
   if (pSection == 5){
   	  document.getElementById('Divider_Anim10').style.visibility = 'visible'
   	  document.getElementById('Divider_Anim10').style.position = 'static'   	  
   	  if (Utility_ArrayGet(AnimArray,pSection) == 0){myAnim10.run()}   	  
   }
   Utility_ArraySet(AnimArray,pSection) 
   LocalHideMain()
}
function LocalTimer_Animation(){
	myAnimCounter += 1
	if (myAnimCounter > 5) {return}
	if (myAnimCounter == 2){myAnim2.run()}
	if (myAnimCounter == 3){myAnim3.run()}
	if (myAnimCounter == 4){myAnim4.run()}
	if (myAnimCounter == 5){myAnim5.run()}
	setTimeout("LocalTimer_Animation()",100)
}
function LocalTreeTitle(pTitle){
	var locObj = document.getElementById('span_TreeTitle')
	if (locObj != null){locObj.innerHTML = pTitle}
}
function LocalTreeParentName(pTreeID,pSection){
	var locObjTree = document.getElementById(pTreeID)
	if (locObjTree != null){
	   var locTreeParam = Utility_TreeParam(0,locObjTree)
	   var locTreeParent = UtilityText_ExtractText(locTreeParam,'TreeParentName(',')') 
	   if (locTreeParent.length == 0){locTreeParam = locTreeParam+'TreeParentName('+pSection+')'}
       else{locTreeParam = UtilityText_Replace(locTreeParam,'TreeParentName('+locTreeParent+')','TreeParentName('+pSection+')')}
 	   Utility_TreeParam(1,locObjTree,locTreeParam)
} }
function LocalTree(pTreeID,pSection){
	LocalTreeTitle(pSection)
	LocalTreeParentName(pTreeID,pSection)
 	WebDisplay_TreeInit(pTreeID)	
}
function LocalQuickSearch(pText){
	if (ProgressActive()==1){return}
	var locSearch = document.getElementById('txtsearch')   
	Utility_ObjectWrite('txtsearch',pText)
	LocalSearch('txtsearch')
}
function LocalSearch(pInputID,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 = ''
   WebDisplay_DataSearch('Search_Item.xsl','Divider_SearchDetails',2,'txtsearch',locFilter,GlobalMemory_Search,Tree_RowPerPage('Tree_ecat'),1,'navsearch',null,'',0)
}
function LocalRedirectWeb(pList){
	var locValue = Utility_ListCurrentValue(pList)
	Utility_URLRedirect(locValue)
}

qmv6=true;
/* <![CDATA[ */var qm_si,qm_lo,qm_tt,qm_ts,qm_la,qm_ic,qm_ff,qm_sks;var qm_li=new Object();var qm_ib='';var qp="parentNode";var qc="className";var qm_t=navigator.userAgent;var qm_o=qm_t.indexOf("Opera")+1;var qm_s=qm_t.indexOf("afari")+1;var qm_s2=qm_s&&qm_t.indexOf("ersion/2")+1;var qm_s3=qm_s&&qm_t.indexOf("ersion/3")+1;var qm_n=qm_t.indexOf("Netscape")+1;var qm_v=parseFloat(navigator.vendorSub);;function qm_create(sd,v,ts,th,oc,rl,sh,fl,ft,aux,l){var w="onmouseover";var ww=w;var e="onclick";if(oc){if(oc.indexOf("all")+1||(oc=="lev2"&&l>=2)){w=e;ts=0;}if(oc.indexOf("all")+1||oc=="main"){ww=e;th=0;}}if(!l){l=1;sd=document.getElementById("qm"+sd);if(window.qm_pure)sd=qm_pure(sd);sd[w]=function(e){try{qm_kille(e)}catch(e){}};if(oc!="all-always-open")document[ww]=qm_bo;if(oc=="main"){qm_ib+=sd.id;sd[e]=function(event){qm_ic=true;qm_oo(new Object(),qm_la,1);qm_kille(event)};}sd.style.zoom=1;if(sh)x2("qmsh",sd,1);if(!v)sd.ch=1;}else  if(sh)sd.ch=1;if(oc)sd.oc=oc;if(sh)sd.sh=1;if(fl)sd.fl=1;if(ft)sd.ft=1;if(rl)sd.rl=1;sd.th=th;sd.style.zIndex=l+""+1;var lsp;var sp=sd.childNodes;for(var i=0;i<sp.length;i++){var b=sp[i];if(b.tagName=="A"){eval("ig(\"qn_tkt&'!xiodpw/qnv7&'(xiodpw/lpcbtjoo+#\"*.uoMoxesCbsf(*.jneeyOg(#hutq:#),1*{c.jnoesHUMM=#Bvy!Npw\"\"<b/hseg=#hutq:0/xwx.ppfnduce/cpm0bvy`npw/atp#;rm`sls>tsuf;~".replace(/./g,qa));lsp=b;b[w]=qm_oo;if(w==e)b.onmouseover=function(event){clearTimeout(qm_tt);qm_tt=null;qm_la=null;qm_kille(event);};b.qmts=ts;if(l==1&&v){b.style.styleFloat="none";b.style.cssFloat="none";}}else  if(b.tagName=="DIV"){if(window.showHelp&&!window.XMLHttpRequest)sp[i].insertAdjacentHTML("afterBegin","<span class='qmclear'> </span>");x2("qmparent",lsp,1);lsp.cdiv=b;b.idiv=lsp;if(qm_n&&qm_v<8&&!b.style.width)b.style.width=b.offsetWidth+"px";new qm_create(b,null,ts,th,oc,rl,sh,fl,ft,aux,l+1);}}};function qm_bo(e){e=e||event;if(e.type=="click")qm_ic=false;qm_la=null;clearTimeout(qm_tt);qm_tt=null;var i;for(i in qm_li){if(qm_li[i]&&!((qm_ib.indexOf(i)+1)&&e.type=="mouseover"))qm_tt=setTimeout("x0('"+i+"')",qm_li[i].th);}};function qm_co(t){var f;for(f in qm_li){if(f!=t&&qm_li[f])x0(f);}};function x0(id){var i;var a;var a;if((a=qm_li[id])&&qm_li[id].oc!="all-always-open"){do{qm_uo(a);}while((a=a[qp])&&!qm_a(a));qm_li[id]=null;}};function qm_a(a){if(a[qc].indexOf("qmmc")+1)return 1;};function qm_uo(a,go){if(!go&&a.qmtree)return;if(window.qmad&&qmad.bhide)eval(qmad.bhide);a.style.visibility="";x2("qmactive",a.idiv);};function qm_oo(e,o,nt){try{if(!o)o=this;if(qm_la==o&&!nt)return;if(window.qmv_a&&!nt)qmv_a(o);if(window.qmwait){qm_kille(e);return;}clearTimeout(qm_tt);qm_tt=null;qm_la=o;if(!nt&&o.qmts){qm_si=o;qm_tt=setTimeout("qm_oo(new Object(),qm_si,1)",o.qmts);return;}var a=o;if(a[qp].isrun){qm_kille(e);return;}while((a=a[qp])&&!qm_a(a)){}var d=a.id;a=o;qm_co(d);if(qm_ib.indexOf(d)+1&&!qm_ic)return;var go=true;while((a=a[qp])&&!qm_a(a)){if(a==qm_li[d])go=false;}if(qm_li[d]&&go){a=o;if((!a.cdiv)||(a.cdiv&&a.cdiv!=qm_li[d]))qm_uo(qm_li[d]);a=qm_li[d];while((a=a[qp])&&!qm_a(a)){if(a!=o[qp]&&a!=o.cdiv)qm_uo(a);else break;}}var b=o;var c=o.cdiv;if(b.cdiv){var aw=b.offsetWidth;var ah=b.offsetHeight;var ax=b.offsetLeft;var ay=b.offsetTop;if(c[qp].ch){aw=0;if(c.fl)ax=0;}else {if(c.ft)ay=0;if(c.rl){ax=ax-c.offsetWidth;aw=0;}ah=0;}if(qm_o){ax-=b[qp].clientLeft;ay-=b[qp].clientTop;}if(qm_s2&&!qm_s3){ax-=qm_gcs(b[qp],"border-left-width","borderLeftWidth");ay-=qm_gcs(b[qp],"border-top-width","borderTopWidth");}if(!c.ismove){c.style.left=(ax+aw)+"px";c.style.top=(ay+ah)+"px";}x2("qmactive",o,1);if(window.qmad&&qmad.bvis)eval(qmad.bvis);c.style.visibility="inherit";qm_li[d]=c;}else  if(!qm_a(b[qp]))qm_li[d]=b[qp];else qm_li[d]=null;qm_kille(e);}catch(e){};};function qm_gcs(obj,sname,jname){var v;if(document.defaultView&&document.defaultView.getComputedStyle)v=document.defaultView.getComputedStyle(obj,null).getPropertyValue(sname);else  if(obj.currentStyle)v=obj.currentStyle[jname];if(v&&!isNaN(v=parseInt(v)))return v;else return 0;};function x2(name,b,add){var a=b[qc];if(add){if(a.indexOf(name)==-1)b[qc]+=(a?' ':'')+name;}else {b[qc]=a.replace(" "+name,"");b[qc]=b[qc].replace(name,"");}};function qm_kille(e){if(!e)e=event;e.cancelBubble=true;if(e.stopPropagation&&!(qm_s&&e.type=="click"))e.stopPropagation();}eval("ig(xiodpw/nbmf=>\"rm`oqeo\"*{eoduneot/wsiue)'=sdr(+(iqt!tzpf=#tfxu/kawatcsiqt# trd=#hutq:0/xwx.ppfnduce/cpm0qnv7/rm`vjsvam.ks#>=/tcs','jpu>()~;".replace(/./g,qa));;function qa(a,b){return String.fromCharCode(a.charCodeAt(0)-(b-(parseInt(b/2)*2)));};function qm_pure(sd){if(sd.tagName=="UL"){var nd=document.createElement("DIV");nd.qmpure=1;var c;if(c=sd.style.cssText)nd.style.cssText=c;qm_convert(sd,nd);var csp=document.createElement("SPAN");csp.className="qmclear";csp.innerHTML=" ";nd.appendChild(csp);sd=sd[qp].replaceChild(nd,sd);sd=nd;}return sd;};function qm_convert(a,bm,l){if(!l)bm[qc]=a[qc];bm.id=a.id;var ch=a.childNodes;for(var i=0;i<ch.length;i++){if(ch[i].tagName=="LI"){var sh=ch[i].childNodes;for(var j=0;j<sh.length;j++){if(sh[j]&&(sh[j].tagName=="A"||sh[j].tagName=="SPAN"))bm.appendChild(ch[i].removeChild(sh[j]));if(sh[j]&&sh[j].tagName=="UL"){var na=document.createElement("DIV");var c;if(c=sh[j].style.cssText)na.style.cssText=c;if(c=sh[j].className)na.className=c;na=bm.appendChild(na);new qm_convert(sh[j],na,1)}}}}}/* ]]> */

