Ext.ns('hecoLibrary');hecoLibrary.baseUri='http://www.heco.de/';if(document.domain=='www.heconnect.de'||document.domain=='heconnect.de'){hecoLibrary.baseUri='http://www.heconnect.de';};hecoLibrary.isEtrackerActive=true;var errorFormIsActive=false;var stopProgressBar=0;var timeoutArray=[];Ext.ux.leanGroupingView=Ext.extend(Ext.grid.GroupingView,{hideHeader:true,initComponent:function(){Ext.ux.leanGroupingView.superclass.initComponent.apply(this,arguments);},initTemplates:function(){Ext.grid.GroupingView.superclass.initTemplates.call(this);this.state={};var sm=this.grid.getSelectionModel();sm.on(sm.selectRow?'beforerowselect':'beforecellselect',this.onBeforeRowSelect,this);if(!this.startGroup){if(!this.hideHeader){this.startGroup=new Ext.XTemplate('<div id="{groupId}" class="x-grid-group {cls}">','<div id="{groupId}-hd" class="x-grid-group-hd" style="{style}"><div class="x-grid-group-title">',this.groupTextTpl,'</div></div>','<div id="{groupId}-bd" class="x-grid-group-body">');}else{this.startGroup=new Ext.XTemplate('<div id="{groupId}" class="x-grid-group {cls}">','<tpl if="values.rs.length &gt; 1">','<div id="{groupId}-hd" class="x-grid-group-hd" style="{style}"></div>','<div id="{groupId}-bd" class="x-grid-group-body">','</tpl>');}}
this.startGroup.compile();this.endGroup='</div></div>';},interceptMouse:Ext.emptyFn});hecoLibrary.et=function(){return{sset:function(tlink,purpose){var inputBox=Ext.get('searchInputBox');var svalue;if(inputBox){svalue=inputBox.dom.value;}
Ext.Ajax.request({url:hecoLibrary.baseUri+'index.php?eID=hecoLibraryAjax',params:{functionName:'sset',tlink:tlink,purpose:purpose,value:svalue,l:0},method:'POST',success:function(){}});}};}();hecoLibrary.navigation=function(){var idArray;var activeMenu;return{createMenu:function(name){var el=Ext.get('nav'+name);var tid=0,menu,doc=Ext.getDoc();var li=Ext.get('nav'+name);var a=li.child("a");var span=a.child("span");var imgCopy;var imgNormal;var hideMenu=function(){if(menu){menu.hide();el.setStyle('text-decoration',"");doc.un('mouseover',handleOver);doc.un('mousedown',handleDown);imgNormal=Ext.get("ak_img_"+name);}};var handleOver=function(e,t){if(t!=el.dom&&t!=menu.dom&&!e.within(el)&&!e.within(menu)){hideMenu();}};var handleDown=function(e){if(!e.within(menu)){hideMenu();}};var showMenu=function(){clearTimeout(tid);tid=0;var boxButton=el.getBox();if(!menu){imgNormal=Ext.get("ak_img_"+name);if(imgNormal!==null){menu=new Ext.Layer({hideMode:'display'},'submenu_akid'+name);}else{menu=new Ext.Layer({shadow:'sides',hideMode:'display'},'submenu_akid'+name);}
menu.applyStyles("width:134px");if(imgNormal!==null){var imgNormalBox=imgNormal.getBox();var boxheight=imgNormalBox.y-el.getBox().y+imgNormalBox.height;menu.applyStyles("height:"+boxheight+"px");}
else{if(Ext.get("ak_img_inside"+name)){Ext.get("ak_img_inside"+name).applyStyles("display:none");}}
var imgBig=Ext.get("ak_img_big"+name);if(imgBig){var aTag=Ext.get('nav'+name).query('a');imgCopyLink=Ext.DomHelper.insertAfter("table"+name,{tag:'a',id:'ak_img_a'+name,href:aTag[0].href,style:'width:'+(imgBig.width)+'px'},true);imgCopy=Ext.DomHelper.insertFirst("ak_img_a"+name,{tag:'img',src:imgBig.dom.src,style:'width:'+(imgBig.width)+'px'},true);}}
menu.hideMenu=hideMenu;menu.el=el;if(this.activeMenu&&menu!=this.activeMenu){this.activeMenu.hideMenu();}
this.activeMenu=menu;if(!menu.isVisible()){menu.show();menu.alignTo(el,'tl-tl?');menu.sync();doc.on('mouseover',handleOver,null,{buffer:17});doc.on('mousedown',handleDown);if(imgCopy){imgCopy.applyStyles({position:"absolute"});imgCopy.applyStyles({width:"170px"});imgCopy.alignTo(menu,'b-b?');imgCopy.fadeIn({endOpacity:0,easing:'easeIn',duration:0.4});}}};el.on('mouseover',function(e){if(!tid){tid=showMenu.defer(17);}});el.on('mouseout',function(e){if(tid&&!e.within(el,true)){clearTimeout(tid);tid=0;}});if(Ext.get("ak_img_"+name)){Ext.get("ak_img_"+name).on('mouseover',function(e){if(!tid){tid=showMenu.defer(17);}});Ext.get("ak_img_"+name).on('mouseout',function(e){});}
if(Ext.get("ak_child_cat_"+name)){Ext.get("ak_child_cat_"+name).on('mouseover',function(e){if(!tid){tid=showMenu.defer(17);}});Ext.get("ak_child_cat_"+name).on('mouseout',function(e){});}
if(Ext.get("submenu_akid"+name)){Ext.get("submenu_akid"+name).on('mouseover',function(e){if(!tid){tid=showMenu.defer(17);}});}},registerByAjax:function(languageId){var myObject;Ext.Ajax.request({url:hecoLibrary.baseUri+'index.php?eID=hecoLibraryAjax',params:{functionName:'ajaxGetArticleClassIds',l:languageId},method:'GET',success:function(test){myObject=eval('('+test.responseText+')');if(myObject){for(var key in myObject){if(Ext.get(String(myObject[key])).dom.className=="current"){currentId=myObject[key];}
createMenu(String(myObject[key]));registerSearchLi(String(myObject[key]));}}}});},init:function(){var closure=this;Ext.select("#hecoMainNavigation > li").each(function(e){var id=String(e.dom.id);closure.createMenu(id.substr(3,id.length));});var articleClassIdArray=new Array();var counter=articleClassIdArray.length;}};}();hecoLibrary.Slide=function(){return{registerButtonForSlide:function(obj){var source=obj.source;var event=obj.event;var targetElement=obj.targetElement;var direction=obj.direction;var hideSourceAtClickEnabled=obj.hideSourceAtClickEnabled;var hideVisibleTargetNeighboursEnabled=obj.hideVisibleTargetNeighboursEnabled;var callback;var callbefore;var animationMode='easeIn';var duration=0.5;if(obj.callback){callback=obj.callback;}
if(obj.callbefore){callbefore=obj.callbefore;}
if(obj.animationMode){animationMode=obj.animationMode;}
if(obj.duration){duration=obj.duration;}
if(!Ext.isArray(targetElement)){if(Ext.get(source)&&source!==null&&event!==null&&Ext.get(targetElement)&&targetElement!==null&&direction!==null){var targetArray=[];if(!Ext.isArray(targetElement)){targetArray[0]=(targetElement);}else{targetArray=targetElement;}
if(hideSourceAtClickEnabled===true){targetArray.unshift(source);}
Ext.get(source).on(event,this.slideText.createDelegate(this,[{'targetElement':targetArray,'direction':direction,'callback':callback,'callbefore':callbefore,'animationMode':animationMode,'duration':duration}],true));}}},simplySlideElement:function(targetElement,direction){var e,t,o;if(targetElement!==null&&direction!==null){this.slideText(e,t,o,{'targetElement':targetElement,'direction':direction});}},slideText:function(e,t,o,obj){var communicationObject={};if(obj.callbefore){obj.callbefore(communicationObject);}
var animationMode='easeOut';var duration=0.5;var targetArray=[];if(obj.animationMode){animationMode=obj.animationMode;}
if(obj.duration){duration=obj.duration;}
if(!Ext.isArray(obj.targetElement)){targetArray[0]=obj.targetElement;}else{targetArray=obj.targetElement;}
for(var index=0;index<targetArray.length;index++){var slideMe=Ext.get(''+targetArray[index]);switch(obj.direction){case'up':if(slideMe.isVisible()){slideMe.slideOut('t',{easing:animationMode,duration:0.5,remove:false,useDisplay:true});}
break;case'down':if(!slideMe.isVisible()){slideMe.slideIn('t',{easing:animationMode,duration:0.5});}
break;case'both':if(!slideMe.isVisible()){slideMe.enableDisplayMode();slideMe.slideIn('t',{easing:animationMode,duration:0.5,remove:false,useDisplay:true});}else{slideMe.enableDisplayMode();slideMe.slideOut('t',{easing:animationMode,duration:0.5,remove:false,useDisplay:true});}
break;default:slideMe.enableDisplayMode().toggle();break;}
if(obj.callback){obj.callback(communicationObject);}}}};}();hecoLibrary.contactMap=function(){var imageSrc="fileadmin/images/kontakt/map/";return{registerButtonForToolTip:function(targetIdArray,targetTitleArray,targetImageArray){if(Ext.isArray(targetIdArray)&&Ext.isArray(targetTitleArray)&&Ext.isArray(targetImageArray)){if(targetIdArray.length==targetTitleArray.length&&targetTitleArray.length==targetImageArray.length){for(var i=0;targetIdArray.length>i;i++){if(Ext.get(targetIdArray[i])){new Ext.ToolTip({target:targetIdArray[i],title:targetTitleArray[i],html:'<img src="'+imageSrc+targetImageArray[i]+'"/>',trackMouse:true,hideDelay:1,showDelay:1,width:150,height:60});function highlightLink(i){}
highlightLink(i);}}}}}};}();hecoLibrary.PDFonTheFlyIsLoadingFlag='';hecoLibrary.PDFonTheFly=function(){return{request:function(vSelectedData,l,catId){if(Ext.get('downloadsHeader')){if(hecoLibrary.PDFonTheFlyIsLoadingFlag!=1){hecoLibrary.PDFonTheFlyIsLoadingFlag=1;if(Ext.get('avgPDFLoadingTime')){var pbar4=new Ext.ProgressBar({text:'',id:'pbar4',textEl:'p4text',cls:'custom',width:300,renderTo:'p4'});var Runner=function(){var f=function(v,pbar,btn,count,cb){return function(){if(v>count){if(btn){btn.dom.disabled=false;}
cb();}else{if(pbar.id=='pbar4'){var i=v/count;if(stopProgressBar!=1){if(stopProgressBar!=1){pbar.updateProgress(i,Math.round(100*i)+'% completed...');}}}else{pbar.updateProgress(v/count,'Loading item '+v+' of '+count+'...');}}};};return{run:function(pbar,btn,count,cb){if(btn){btn.dom.disabled=true;}
var ms=(1000*count)/count;for(var i=1;i<(count+2);i++){timeoutArray[i]=setTimeout(f(i,pbar,btn,count,cb),i*ms);}}};}();Runner.run(pbar4,'',parseInt(Ext.get('avgPDFLoadingTime').dom.innerHTML),function(){hecoLibrary.Slide.simplySlideElement('progressBar','toggle');});}
var ajaxRequest=Ext.Ajax.request({url:hecoLibrary.baseUri+'index.php?eID=hecoLibraryAjax',params:{functionName:'WScreatePDFonTheFly',l:l,catId:catId,vSelectedData:vSelectedData},method:'GET',success:function(val){stopProgressBar=1;hecoLibrary.Slide.simplySlideElement('progressBar','toggle');for(var j=timeoutArray.length-1;j>-1;j--){clearTimeout(timeoutArray[j]);}
response=Ext.decode(val.responseText);Ext.fly('generatePDFonTheFlyWaiting').update('');Ext.DomHelper.append('PDF',{tag:'img',cls:'pdfButton',src:'./fileadmin/templates/yaml_31_090120/examples/heco/css/heco/images/buttons/button-pdf_20x20.gif'});Ext.DomHelper.append('PDF',{tag:'a',html:response.title,href:response.url,target:'_blank',onclick:'ET_Event.eventStart("Download", "'+response.url+'", "'+response.title+'")'});if(vSelectedData==3){Ext.DomHelper.append('PDF',{tag:'br'});Ext.DomHelper.append('PDF',{tag:'img',cls:'pdfButton',src:'./fileadmin/templates/yaml_31_090120/examples/heco/css/heco/images/buttons/button-pdf_20x20.gif'});Ext.DomHelper.append('PDF',{tag:'a',html:response.titleTechnical,href:response.urlTechnical,target:'_blank',onclick:'ET_Event.eventStart("Download", "'+response.urlTechnical+'", "'+response.titleTechnical+'")'});}}});}
if(!errorFormIsActive){errorFormIsActive=true;var errorForm=new Ext.FormPanel({buttonalign:'left',width:500,url:hecoLibrary.baseUri+'index.php?eID=hecoLibraryAjax&functionName=receiveErrorByUser&catId='+catId+'&type=errorPDF&vSelectedData='+vSelectedData,items:[{xtype:'label',id:'progressBarWaitingMessage',forceLayout:true,name:'pdfDescription',html:'<h2>Bitte haben Sie einen Augenblick Geduld</h2>Die folgenden PDFs werden mit aktuellen Daten aus unserem Warenwirtschaftssystem erstellt. Dies kann einige Sekunden in Anspruch nehmen.'},{xtype:'label',forceLayout:true,name:'pdf',html:'<div id="PDF" style="float:left;width:500px;height:auto;padding-bottom:3px;"></div>',}]});errorForm.render('PDFonTheflyForm');}}}};}();hecoLibrary.toggleExpander=function(el){Ext.get(el).toggleClass('toggleExpander');}
Ext.onReady(function(){hecoLibrary.navigation.init();hecoLibrary.Slide.registerButtonForSlide({source:'downloadsHeader',event:'click',targetElement:'downloadsWrapper',direction:'both',animationMode:'easeIn',duration:10,callback:function(){hecoLibrary.PDFonTheFly.request(hecoLibrary.PDFonTheFly.requestConfig.mode,hecoLibrary.PDFonTheFly.requestConfig.l,hecoLibrary.PDFonTheFly.requestConfig.catId);}});if(Ext.get("ShowForcedLogout")){alert("Sie wurden durch einen anderen Computer mit den gleichen Anmeldedaten ausgeloggt.");if(Ext.get('myHecoIFrame')){hecoLibrary.Slide.simplySlideElement('myHecoIFrame','toggle');}}
var technicalHeader=Ext.get('technicalHeader');if(technicalHeader!==null){technicalHeader.on('click',function(e){hecoLibrary.Slide.simplySlideElement('technicalWrapper','toggle');});};if(Ext.get('ArticleTableHTML')){Ext.get('ArticleTableHTML').applyStyles({display:"none"});}
var myObject;registerSearchLi('0');var activeSearchMenu;function createDropDownMenu(name,dropDownMenu,alignTo,width,alignPos,mode){var mode=mode;var width=width;var alignPos=alignPos;var alignToEl=Ext.get(alignTo);var el=Ext.get(name);var tid=0,menu,doc=Ext.getDoc();if(el){var handleSearchOver=function(e,t){if(t!=el.dom&&t!=menu.dom&&!e.within(el)&&!e.within(menu)){}};var hideSearchMenu=function(){if(menu){menu.hide();doc.un('mouseover',handleSearchOver);doc.un('mousedown',handleSearchDown);}}
var handleSearchDown=function(e){if(!e.within(menu)){hideSearchMenu();}}
var showSearchMenu=function(){clearTimeout(tid);tid=0;if(!menu){menu=new Ext.Layer({hideMode:'display'},'submenu_'+name);menu.applyStyles("width:"+width+"px");if(mode=="keyup"){el.addListener('keyup',searchHandlerKeyUp.createDelegate(this,'submenu_'+name,true));}}
menu.hideSearchMenu=hideSearchMenu;menu.el=el;if(activeSearchMenu&&menu!=activeSearchMenu){activeSearchMenu.hideSearchMenu();}
activeSearchMenu=menu;if(!menu.isVisible()){menu.show();menu.alignTo(alignToEl,alignPos);menu.sync();doc.on('mouseover',handleSearchOver,null,{buffer:150});doc.on('mousedown',handleSearchDown);}}
el.on(mode,function(e){if(!tid){tid=showSearchMenu.defer(150);}});el.on('mouseout',function(e){if(tid&&!e.within(el,true)){clearTimeout(tid);tid=0;}});}}
createDropDownMenu('searchInputBox','submenu_searchInputBox','searchnav','358','tl-bl?','keyup');createDropDownMenu('shortnameIndex','submenu_shortnameIndex','standardThemesNavigation','750','tr-tr?','click');createDropDownMenu('shortnameIndex','submenu_shortnameIndex','standardThemesNavigation','750','tr-tr?','mouseover');function registerSearchLi(name){if(Ext.get("hecoSearchLi"+name)){Ext.get("hecoSearchLi"+name).on('click',function(e){if(Ext.get('hecoSearch')){Ext.get('currentActiveSearchSpan').dom.innerHTML=Ext.get(e.target).dom.innerHTML;activeSearchMenu.hide();}
Ext.get('hiddenSearchValue').dom.value=name;})}}
var searchHandlerKeyUp=function(e,t,o,submenu){var inputBox=Ext.get('searchInputBox');if(inputBox){inputBox.dom.value=t.value;}
var submenuObject=Ext.get(submenu);Ext.Ajax.request({url:hecoLibrary.baseUri+'index.php?eID=hecoLibraryAjax',params:{functionName:'ajaxGetSearchResultsSuggest',l:l,value:t.value},method:'POST',success:function(val){if(val.responseText!=""){if(submenuObject!==null&&submenuObject.getStyle("display")=='none'){submenuObject.applyStyles({display:"block"});submenuObject.dom.innerHTML=val.responseText;}else{submenuObject.dom.innerHTML=val.responseText;}}else{submenuObject.applyStyles({display:"none"});}}})};var searchInputBox=Ext.get('searchInputBox');if(searchInputBox){var searchInputBoxValue=Ext.get('searchInputBoxText').getValue();searchInputBox.on('focus',function(e){var currentSearchInputBoxValue=Ext.get('searchInputBoxText').getValue();if(searchInputBoxValue==searchInputBox.getValue()){searchInputBox.dom.value="";}});searchInputBox.on('blur',function(e){if(searchInputBox.dom.value==""){searchInputBox.dom.value=searchInputBoxValue;}});}
var activeMenu,currentId;var l=Ext.get('languageIdHidden').dom.value;var ldifference=l*100000;var catId=Ext.get('catIdHidden').dom.value;if(Ext.get('ArticleTableGridTechnical')){showProgress('Downloading grid settings...','loadingBox','active');var grid;var store;Ext.Ajax.request({url:hecoLibrary.baseUri+'index.php?eID=hecoLibraryAjax&functionName=GetGridColumPropertiesTechnical&l='+l+'&catId='+catId+'&tableWidth=480',success:function(val){Ext.fly('ArticleTableGridTechnical').update('');response=Ext.decode(val.responseText);store=new Ext.data.GroupingStore({url:hecoLibrary.baseUri+'index.php?eID=hecoLibraryAjax&functionName=WSgetStoreDataTechnical&l='+l+'&catId='+catId,reader:new Ext.data.XmlReader({record:'column',id:'UID'},response.WSgetStoreIndizesTechnical),groupField:'Group',sortInfo:{field:'Sort',direction:"desc"}});store.load({callback:function(success){if(success){var amountOfRows=store.getCount();if(amountOfRows>11){var groupingView=new Ext.ux.leanGroupingView({forceFit:true,groupTextTpl:''});}else{var groupingView=new Ext.ux.leanGroupingView({scrollOffset:2,forceFit:true,groupTextTpl:''});}
showProgress('Downloading grid settings...','loadingBox','inactive');grid=new Ext.grid.GridPanel({renderTo:'ArticleTableGridTechnical',view:groupingView,height:300,width:500,stripeRows:true,store:store,columns:response.WSgetGridColumnPropertiesTechnical})}}});}});};function showProgress(msg,aim,status){var loadingBox=Ext.get(aim);if(status=='active'){if(loadingBox&&loadingBox.getStyle("display")=='none'){hecoLibrary.Slide.simplySlideElement(aim,'toggle');}
Ext.get(aim).alignTo('col1_content','c-c?');Ext.fly(aim).update('<div class="loading-indicator2"></div>');}
else{if(loadingBox&&loadingBox.getStyle("display")!='none'){hecoLibrary.Slide.simplySlideElement(aim,'toggle');Ext.fly(aim).update('');}}}
var idArray=new Array('area75','area81','area84','area78','area72','area68','area215','area76');var titleArray=new Array('Frankfurt','Berlin','Remchingen','Bielefeld','N&uuml;rnberg','Warschau','Br&uuml;nn','Export');var imgArray=new Array('frankfurt-map-rgb.jpg','berlin-map-rgb.jpg','remchingen-map-rgb.jpg','bielefeld-map-rgb.jpg','nuernberg-map-rgb.jpg','warschau-map-rgb.jpg','brnn-map-rgb.jpg','export-map-rgb.jpg');hecoLibrary.contactMap.registerButtonForToolTip(idArray,titleArray,imgArray);if(hecoLibrary.isEtrackerActive){var el=Ext.get('lastShownArticlesBox');if(el){el.on('mousedown',function(event,target,options){if(hecoLibrary.isEtrackerActive){ET_Event.eventStart('Klick%20auf%20zuletzt%20gesehener%20Artikel',target.href,'click','');}},null,{delegate:'a'});}
var el=Ext.get('recommendedArticles');if(el){el.on('click',function(event,target,options){ET_Event.eventStart('Klick%20auf%20Sie%20wollen%20zu',target.href,'click','');},null,{delegate:'a'});}
var el=Ext.get('imageMenuThumbnails');if(el){el.on('click',function(event,target,options){ET_Event.eventStart('Klick auf Thumbnail',target.title,'click');});}
var el=Ext.get('technicalHeader');var uid=Ext.get('catIdHidden').getValue();if(el){el.on('click',function(){ET_Event.eventStart('Klick auf technische Beschreibung',uid,'click');});}}
document.onkeydown=cancelArrowKeys;function cancelArrowKeys(e){try{var e=window.event||e;var key=e.charCode?e.charCode:e.keyCode?e.keyCode:0;if(key==38||key==40){event.returnValue=false;}}
catch(Exception){return false;}}
var searchInputBox=Ext.get('searchInputBox');if(searchInputBox){document.onactivate=searchInputBox.focus();}
Ext.get('searchInputBox').on('keyup',function(){if(Ext.get('searchInputBox').getValue()=='clear'){Ext.Ajax.request({url:hecoLibrary.baseUri+'index.php?eID=hecoLibraryAjax&functionName=clearSession',method:'GET',success:function(val){alert(val.responseText);}});}});hecoLibrary.getChildElement=function(id){var el=Ext.get(id);var visible=el.getStyle('visibility');if(visible=='hidden'){el.applyStyles({position:'relative',visibility:'visible',left:'0px',top:'0px'});}else{el.applyStyles({position:'absolute',visibility:'hidden',left:'-10000px',top:'-10000px'});}}});
