document.observe("dom:loaded",function(event){var bodyElement=$$('body').first();if(bodyElement){bodyElement.removeClassName('js-off');bodyElement.addClassName('js-on')};$$('a.externe-link, a[rel*=external], a[href^="http:"]').each(function(el){el.target='_blank'});$$('input.no-autocomplete').each(function(input){input.writeAttribute('autocomplete','off')});$$('input[type=submit]').each(function(el){el.observe('mouseover',function(event){el.addClassName('button-hover')});el.observe('mouseout',function(event){el.removeClassName('button-hover')})});var menudelay=1,menudelay_id,menudelayed;$$('div.dot').each(function(el){Event.observe(el,'mouseover',function(){if(menudelay_id>0){window.clearTimeout(menudelay_id);menudelayed.removeClassName('hover-ie')};el.addClassName('hover-ie')});Event.observe(el,'mouseout',function(){menudelay_id=Element.removeClassName.delay(menudelay,el,'hover-ie');menudelayed=el});Event.observe(el,"click",function(event){element=event.element();element=element.up("td");count=1;while(element.previous("td")!=undefined){element=element.previous("td");count++};th=element.previous("th");productName="";if(th!=undefined)productName=th.innerHTML;element=element.up("tbody").previous("thead").down("tr").down("th");for(i=0;i<count;i++)element=element.next("th");column="";if(element!=undefined)column=element.innerHTML;window.location=window.location+"/request/"+productName+"/"+column})});var tabledelay=1,tabledelay_id,tabledelayed;$$('div.table-hover').each(function(el){Event.observe(el,'mouseover',function(){if(tabledelay_id>0){window.clearTimeout(tabledelay_id);tabledelayed.removeClassName('table-hover-ie')};el.addClassName('table-hover-ie')});Event.observe(el,'mouseout',function(){tabledelay_id=Element.removeClassName.delay(tabledelay,el,'table-hover-ie');tabledelayed=el})});setValue($('zoeken-q'),'zoeken...');var lijst=$('opties');if(lijst){var url=getStrippedUrl()+'/print',item=new Element('li'),link=new Element('a',{id:'print','class':'none',href:url}).update('Print pagina').observe('click',function(event){event.stop();printPage(url)});item.appendChild(link);lijst.appendChild(item)};$$('.inklapbaar').each(function(el){el.addClassName('ingeklapt');var heading2=null;if(heading2=el.select('h2')[0])Event.observe(heading2,'click',function(event){el.toggleClassName('uitgeklapt')})})})
function setContactpersoonActive(contactClassname){if(contactClassname.indexOf('contactpersoonlink')!=-1)$$('dl.contact').each(function(contactpersoon){if(contactpersoon.hasClassName(contactClassname)){Effect.Appear(contactpersoon,{duration:0.5,delay:0.3})}else Effect.Fade(contactpersoon,{duration:0.3})})}
function getStrippedUrl(){var url=location.href,index=url.lastIndexOf('#');if(index!==-1)url=url.substr(0,index);if(url.charAt(url.length-1)=='/')url=url.substr(0,url.length-1);return url}
function printPage(url){popup=window.open(url,"help","width=720, height=700, top=100, left=100, toolbar=0, resizable=1, scrollbars=1, status=0.menubar=0, location=0, directories=0");popup.focus()}
function setValue(el,nieuwevalue){if(el!==null&&el.value==''){el.setAttribute('value',nieuwevalue);Event.observe(el,'focus',function(){if(el.value==nieuwevalue)el.value=''});Event.observe(el,'blur',function(){if(el.value=='')el.value=nieuwevalue})}}
function makeClickable(selector,classnameHover){$$(selector).each(function(el){var anchorElement=el.down('a.target');if(anchorElement)if(anchorElement.hasClassName('externe-link')){Event.observe(el,'click',function(event){window.open(anchorElement)})}else Event.observe(el,'click',function(event){location.href=anchorElement});Event.observe(el,'mouseover',function(event){el.addClassName(classnameHover)});Event.observe(el,'mouseout',function(event){el.removeClassName(classnameHover)})})};var dropliciousMenu=Class.create({showingUpDuration:0.3,hidingDuration:0.1,hideDelay:0,initialize:function(){$$("li.level1 a").invoke('observe','mousemove',this.linkMouseOver.bind(this));$$("li.level1 a").invoke('observe','mouseout',this.linkMouseOut.bind(this));$$("ul.drop").invoke('observe','mousemove',this.submenuMouseOver.bind(this));$$("ul.drop").invoke('observe','mouseout',this.submenuMouseOut.bind(this))},showUpEffect:function(e,effectDuration){if(!e.visible())new Effect.BlindDown(e,{duration:effectDuration,queue:{position:'end',scope:e.identify(),limit:2}})},hidingEffect:function(e,effectDuration){new Effect.BlindUp(e,{duration:effectDuration,queue:{position:'end',scope:e.identify(),limit:2}})},linkMouseOut:function(e){var dropElement=e.element().next();if(dropElement&&dropElement.hasClassName('active'))this.setDelayedHide(dropElement)},linkMouseOver:function(e){var dropElement=e.element().next();if(!dropElement)return;if(!dropElement.hasClassName('hidding'))dropElement.removeClassName('waitingtohide');if(!dropElement.hasClassName('active')){dropElement.addClassName('active');this.showUpEffect(dropElement,this.showingUpDuration)}},submenuMouseOut:function(e){var dropElement=e.findElement("ul");if(dropElement&&dropElement.hasClassName('active'))this.setDelayedHide(dropElement)},submenuMouseOver:function(e){var dropElement=e.findElement("ul");if(dropElement&&!dropElement.hasClassName('hidding'))dropElement.removeClassName('waitingtohide')},setDelayedHide:function(e){e.addClassName('waitingtohide');if(!e.hasClassName('hidding'))if(!e.hasClassName('hiddingtimerset')){e.addClassName('hiddingtimerset');(function(obj,e){obj.delayedHide(e)}).delay(this.hideDelay,this,e)}},delayedHide:function(e){e.removeClassName('hiddingtimerset');if(e.hasClassName('waitingtohide')){this.hidingEffect(e,this.hidingDuration);e.addClassName('hidding');(function(e){e.removeClassName('waitingtohide');e.removeClassName('hidding');e.removeClassName('active')}).delay(this.hidingDuration,e)}}});document.observe('dom:loaded',function(){new dropliciousMenu()})
