pH8={};pH8.Version='2.0';pH8.CompatibleWithPrototype='1.6';if(Prototype.Version.indexOf(pH8.CompatibleWithPrototype)!==0&&console&&console.warn)
console.warn("This version of pH8 extensions is tested with Prototype "+pH8.CompatibleWithPrototype+" it may not work as expected with this version ("+Prototype.Version+")");pH8.Mixin={};Element.addMethods({getClassParameters:function(element,prefix){element=$(element);if(arguments.length<2){prefix='param';}
var regex=new RegExp(prefix+'-(\\w*)=(\\S*)','g');var params={};while((result=regex.exec(element.className))!=null){params[result[1]]=result[2];}
return params;},getClassParameter:function(element,param,prefix){if(arguments.length<3){prefix='param';}
var regex=new RegExp(prefix+'-'+param+'=(\\S*)');var parts=regex.exec(element.className);if(parts){return parts[1];}}});Object.extend(String.prototype,{isDigits:function(){return(this.match(/^\d+$/)!==null);}});Object.extend(Number.prototype,{isInteger:function(){return(Math.round(this)===this);}});;pH8.Storage=(function(){var _instance=null;return function(type){if(_instance!==null){return _instance;}
_instance=this;this.ttl=3600;this.set=function(name,value,ttl){ttl=ttl||this.ttl;var time=new Date();time.setTime(time.getTime()+ttl);document.cookie=name+'='+escape(Object.toJSON(value))+';expires='+time.toLocaleString();};this.get=function(name){var value=null;var cookie=document.cookie.match(name+'=([^;]+)');if(cookie){value=unescape(cookie[1].gsub('+','%20')).evalJSON(true);}
return value;};};})();;pH8.Dictionary=(function(){var _instance=null;var _list=null;return function(language){if(_instance!==null){return _instance;}
_instance=this;language=language||'';new Ajax.Request("/api/ajax.php?action=listDictionary&language="+language,{method:'get',onSuccess:function(transport){_list=transport.responseJSON;document.fire("dictionary:loaded");}});this.isLoaded=function(){return(null!==_list);};this.getText=function(key){if(_list[key]){return _list[key];}else{return key;}};};})();pH8.Mixin.needsDictionary={waitForDictionary:function(callback,language){var dictionary=new pH8.Dictionary(language);if(dictionary.isLoaded()){callback();}else{document.observe("dictionary:loaded",callback);}}};pH8.Mixin.needsTemplates={waitForTemplates:function(templates,callback){this._templatesLoadedCallback=callback;this._templateUrlsByName=new Hash(templates);this._templateNamesByUrl=new Hash();this.templates={};this._templateUrlsByName.each(function(pair){this._templateNamesByUrl.set(pair.value,pair.key);new Ajax.Request(pair.value,{method:'get',onSuccess:this.checkTemplates.bind(this)});}.bind(this));},checkTemplates:function(response){var name=this._templateNamesByUrl.get(response.request.url);if(name){var check=true;this.templates[name]=response.responseText;this._templateNamesByUrl.each(function(pair){if(!this.templates[pair.value]){check=false;}}.bind(this));if(check&&this._templatesLoadedCallback){this._templatesLoadedCallback();}}}};pH8.Pages=(function(){var _instance=null;var _list=null;return function(language){if(_instance!==null){return _instance;}
_instance=this;new Ajax.Request("/api/ajax.php?action=listPages",{method:'get',onSuccess:function(transport){_list=transport.responseJSON;console.log(_list);document.fire("pages:loaded");}});this.isLoaded=function(){return(null!==_list);};this.getList=function(){return _list;};this.getPage=function(key){if(_list[key]){return _list[key];}else{return key;}};};})();pH8.Mixin.needsPages={waitForPages:function(callback){var pages=new pH8.Pages();if(pages.isLoaded()){callback();}else{document.observe("pages:loaded",callback);}}};var general_rules={'#analytics-placeholder':function(){var params=this.getClassParameters();if(params.sid){pageTracker=_gat._getTracker(params.sid);if(params.target){pageTracker._trackPageview(unescape(params.target));}else{pageTracker._trackPageview();}}},'.hilite-keywords':function(){var hiliter=new KeywordHiliter("ajax.php",this);hiliter.options.elementTag='ABBR';hiliter.fetchKeywords();},'.no-javascript':function(){this.hide();},'.show-no-javascript':function(){this.show();}};Event.addBehavior(general_rules);var hyperlink_rules={'a.void:click':function(e){return false;},'a.popup:click':function(e){var params=this.getClassParameters();var width=params.width||684;var height=params.height||350;var top=params.top||200;var left=params.left||'50%';window.open(this.href,'PopUp','width='
+width
+',height='
+height
+',top='
+top
+',left='
+left
+',scrollbars=0,status=no,resizable=0,toolbar=0,titlebar=0,menubar=0,location=0');return false;},'a.external:click,a.new-window:click':function(e){if(!e.ctrlKey&&!e.altKey&&!e.shiftKey){window.open(this.href);return false;}},'a.status:mouseover':function(e){window.status=this.title;return true;},'a.status:mouseout':function(e){window.status='';return true;},'a.switch:click':function(e){var c=$(this.id.replace('-switch',''));var content=$(c.id+'-content');if(c){c.toggle();}
return false;},'a.tabswitch:click':function(e){var container=$(this.getAttribute('rel'));if(container){var other=$(container.getAttribute('rel'));if(other){container.addClassName('hide');other.removeClassName('hide');}}
return false;},'a.modal:click':function(e){var image=this.up().next().down('img');var dialog=new MUIL.Dialog.Image(image);return false;},'a.submit':function(e){var params=this.getClassParameters();var form=$(params.form);if(form){form.submit();}
return false;}};Event.addBehavior(hyperlink_rules);var form_rules={'form.auto-submit':function(e){this.submit();},'select.auto-submit:change':function(e){this.form.submit();},'input.auto-upper:blur':function(e){this.value=this.value.toUpperCase();},'input.auto-upper:change':function(e){this.value=this.value.toUpperCase();},'.default-value:blur':function(e){if(this.value==''){var params=this.getClassParameters();if(params.default_value!=''){this.value=params.default_value;this.addClassName('auto-clear');}}},'input.auto-blur:focus':function(e){this.className=this.className.replace('-off','-on');var fieldLabel=this.form.down('[for='+this.id+']');if(fieldLabel){fieldLabel.className=fieldLabel.className.replace('-off','-on');var image=fieldLabel.down('img');if(image){image.src=image.src.replace('_normal','_hover');}}
var fieldSet=this.up('fieldset');if(fieldSet&&fieldSet.up('fieldset')){var legend=fieldSet.down('legend');if(legend){legend.className=legend.className.replace('-off','-on');}}},'input.auto-blur:blur':function(e){this.className=this.className.replace('-on','-off');var fieldLabel=this.form.down('[for='+this.id+']');if(fieldLabel){fieldLabel.className=fieldLabel.className.replace('-on','-off');var image=fieldLabel.down('img');if(image){image.src=image.src.replace('_hover','_normal');}}
var fieldSet=this.up('fieldset');if(fieldSet&&fieldSet.up('fieldset')){var legend=fieldSet.down('legend');if(legend){legend.className=legend.className.replace('-on','-off');}}},'.auto-clear:focus':function(e){if(this.hasClassName('auto-clear')){this.value='';}
this.removeClassName('auto-clear');},'input.rollover:mouseover':function(el){if(!this.hasClassName('active')){this.className=this.className.replace('-normal','-hover');if(this.type=='image'){this.src=this.src.replace('_normal','_hover');}}},'input.rollover:mouseout':function(e){if(!this.hasClassName('active')){this.className=this.className.replace('-hover','-normal');if(this.type=='image'){this.src=this.src.replace('_hover','_normal');}}}};Event.addBehavior(form_rules);var rollover_rules={'img.rollover:mouseover':function(el){this.src=this.src.replace('_normal','_hover');return false;},'img.rollover:mouseout':function(el){this.src=this.src.replace('_hover','_normal');return false;}};Event.addBehavior(rollover_rules);var sponsors_rules={'ul.listing-sponsors':function(e){if(this.childElements().size()>1){new PeriodicalExecuter(function(pe){var current=this.down('.active');current.fade({duration:0.5,afterFinish:function(){current.removeClassName('active');next=(current.next()!=null)?current.next():current.adjacent('li')[0];next.addClassName('active').hide();next.appear({duration:0.5});}.bind(this)});}.bind(this),3);}}};Event.addBehavior(sponsors_rules);var analytics_rules={'a.tracker-goal-aanvraagformulier:click':function(event){event.stop();pageTracker._trackPageview('/targets/form/financial_support');document.location=this.href;return false;},'a.tracker-goal-car:click':function(event){event.stop();pageTracker._trackPageview('/targets/external/car');document.location=this.href;return false;},'.listing-spotlight a:click':function(event){event.stop();var params=this.getClassParameters();if(params.spotlight==1){var action='Spotlight 1 (linker spotlight)'}
if(params.spotlight==2){var action='Spotlight 2 (midden spotlight)'}
if(params.spotlight==3){var action='Spotlight 2 (rechter spotlight)'}
if(params.type=='image'){var label='klik op image van '+this.title}
if(params.type=='link'){var label='klik op lees meer van '+this.title}
pageTracker._trackEvent('Spotlights',action,label);if(params.external==1){window.open(this.href);}else{document.location=this.href;}
return false;},'.tracker-nav-calendar:click':function(event){event.stop();pageTracker._trackEvent('festival Agenda','hoofdnav','');document.location=this.href;return false;},'.tracker-nav-calendar-all:click':function(event){event.stop();pageTracker._trackEvent('festival Agenda','naar compleet overzicht','');document.location=this.href;return false;},'.tracker-nav-professionals:click':function(event){event.stop();pageTracker._trackEvent('Zakelijk','hoofdnav','');document.location=this.href;return false;},'.tracker-subnav-festivalsenevenementen:click':function(event){event.stop();pageTracker._trackEvent('Zakelijk','subnav','Festivals en Evenementen');document.location=this.href;return false;},'.tracker-goal-planindienen:click':function(event){event.stop();pageTracker._trackEvent('Zakelijk','plan indienen','');document.location=this.href;return false;},'.tracker-goal-aanvraagformulier:click':function(event){event.stop();pageTracker._trackEvent('Zakelijk','ondersteuning aanvragen','');document.location=this.href;return false;},'.tracker-extern-twitter:click':function(event){event.stop();pageTracker._trackEvent('Extern','naar Twitter',document.title);return false;},'.tracker-extern-youtube:click':function(event){event.stop();pageTracker._trackEvent('Extern','naar youtube',document.title);return false;},'.tracker-extern-facebook:click':function(event){event.stop();pageTracker._trackEvent('Extern','naar Facebook',document.title);return false;},'.tracker-extern-uitburo:click':function(event){event.stop();pageTracker._trackEvent('Extern','naar uitburo',document.title);document.location=this.href;return false;},'.tracker-ticket:click':function(event){event.stop();pageTracker._trackEvent('Tickets','klik op ticketpagina',this.title);document.location=this.href;return false;}};Event.addBehavior(analytics_rules);var flash_rules={'#flash-agenda-tag':function(e){var params=Element.getClassParameters(this);var FO={data:"/flash/mediaPlayerCalendarYouTube.swf",width:"543",height:"379",xi:"false",flashvars:{apiUrl:"/api/calendar",method:"getTagDetails",language:params.language,tagID:params.tagID},version:"9.0.0",params:{menu:"false",allowfullscreen:"true"}};swfobject.embedSWF(FO.data,this.id,FO.width,FO.height,FO.version,FO.xi,FO.flashvars,FO.params,FO.attributes);},'#flash-agenda':function(e){var params=Element.getClassParameters(this);var FO={data:"/flash/mediaPlayerCalendarYouTube.swf",width:"543",height:"379",xi:"false",flashvars:{apiUrl:"/api/calendar",method:"getEventDetails",language:params.language,eventID:params.eventID},version:"9.0.0",params:{menu:"false",allowfullscreen:"true"}};swfobject.embedSWF(FO.data,this.id,FO.width,FO.height,FO.version,FO.xi,FO.flashvars,FO.params,FO.attributes);},'#flash-home':function(e){var params=Element.getClassParameters(this);var FO={data:"/flash/mediaPlayerHome.swf",width:"685",height:"401",xi:"false",flashvars:{apiUrl:"/api/calendar",method:"getHomepageEvents",language:params.language},version:"9.0.0",params:{menu:"false",allowfullscreen:"true",allowScriptAccess:"always"}};swfobject.embedSWF(FO.data,this.id,FO.width,FO.height,FO.version,FO.xi,FO.flashvars,FO.params,FO.attributes);},'.spotlight-home-flash':function(e){var params=this.getClassParameters();if(params.spotlight==1){var action="Spotlight 1 (linker spotlight)";}
if(params.spotlight==2){var action='Spotlight 2 (midden spotlight)';}
if(params.spotlight==3){var action='Spotlight 2 (rechter spotlight)';}
var FO={data:"/flash/flashSpotlight.swf",width:"215",height:"170",xi:"false",flashvars:{swfUrl:escape(params.flashurl),redirectUrl:escape(params.redir),redirectTarget:escape(params.target),trackingEvent:escape("Spotlights"),trackingAction:escape(action),trackingLabel:escape("klik op flash van "+params.title)},version:"9.0.0",params:{menu:"false",allowfullscreen:"true",allowScriptAccess:"always"}};swfobject.embedSWF(FO.data,this.id,FO.width,FO.height,FO.version,FO.xi,FO.flashvars,FO.params,FO.attributes);}};Event.addBehavior(flash_rules);var google_maps_rules={'.location_map':function(){var params=Element.getClassParameters(this);if(GBrowserIsCompatible()&&params.latitude&&params.longitude){if(params.zoom){zoom=parseInt(params.zoom);}else{zoom=4;}
var map=new GMap2(this);map.setCenter(new GLatLng(params.latitude,params.longitude),zoom);if(params.markerLatitude&&params.markerLongitude){var markerPosition=new GLatLng(params.markerLatitude,params.markerLongitude);var markerOptions={};if(params.markerImage&&params.markerWidth&&params.markerHeight){markerOptions.icon=new GIcon();markerOptions.icon.iconSize=new GSize(params.markerWidth,params.markerHeight);markerOptions.icon.iconAnchor=new GPoint(1,params.markerHeight);markerOptions.icon.infoWindowAnchor=new GPoint(1,1);markerOptions.icon.image=params.markerImage;}
var marker=new GMarker(markerPosition,markerOptions);map.addOverlay(marker);}
var keyboardHandler=new GKeyboardHandler(map);map.addControl(new GSmallMapControl());}}}
Event.addBehavior(google_maps_rules);var calendar_filter_rules={'.genre-selection:change':function(event){pageTracker._trackEvent('festival Agenda','genre selectie',this.getValue());window.location=this.getValue();}};Event.addBehavior(calendar_filter_rules);