/* 
Copyright (c) 2009 Reinier Zevenhuijzen, Netherlands
http://www.framework-z.com

This file is available under the terms of the  MIT Licence: 
http://www.ibiblio.org/pub/Linux/LICENSES/mit.license
*/

function Z(a){if(this==window){if(typeof a=='function')return a();var b=Z.$(a,true);return b.__ZObject?b.__ZObject:new Z(b);}
this.elm=this.$=a;a.__ZObject=this;this.props={};}
Z.prototype={_:1,handle:function(a,b){Z.handle(this.elm,a,b);return this;},dehandle:function(a,b){Z.dehandle(this.elm,a,b);return this;},onClick:function(a,b){var c=this;return this.handle('click', function(e){var f;if(!b&&(c.tag()=='A'||(c.tag()=='INPUT'&&c.attribute('type')=='submit'))){f=Z.preventDefault(e);}
a.apply(null,arguments);return f;});},onContextmenu:function(a,b){var c=this;return this.handle('contextmenu', function(e){a.apply(null,arguments);if(!b)return Z.preventDefault(e);});},onBlur:function(a){return this.handle('blur',a)},onFocus:function(a){return this.handle('focus',a)},onChange:function(a){return this.handle('change',a)},onKeyup:function(a){return this.handle('keyup',a)},onKeydown:function(a){return this.handle('keydown',a)},onKeypress:function(a){return this.handle('keypress',a)},onMouseover:function(a){return this.handle('mouseover',a)},onMouseout:function(a){return this.handle('mouseout',a)},onMousemove:function(a){return this.handle('mousemove',a)},onMousedown:function(a){return this.handle('mousedown',a)},onMouseup:function(a){return this.handle('mouseup',a)},html:function(a,b){if(Z.undef(a))return this.elm.innerHTML;if(!b)this.elm.innerHTML=a;else this.elm.innerHTML+=a;return this;},text:function(a,b){var c='innerText' in this.elm?'innerText':'textContent';if(Z.undef(a))return this.elm[c];if(b)this.elm[c]+=a;else this.elm[c]=a;return this;},name:function(a){if(Z.undef(a))return this.elm.name;this.elm.name=v;return this;},value:function(a){if(Z.undef(a))return this.elm.value;this.elm.value=a;return this;},checked:function(a){if(Z.undef(a))return this.elm.checked;this.elm.checked=a;return this;},selected:function(a){if(Z.undef(isChecked))return this.elm.selected;this.elm.checked=selected;return this;},selectedIndex:function(a){if(Z.undef(isChecked))return this.elm.selectedIndex=a;this.elm.selectedIndex=a;return this;},options:function(){return this.elm.options;},clearOptions:function(){this.elm.options.length=0;return this;},addOption:function(a,b){var c;if(a instanceof Option)c=a;else {c=new Option();c.value=a;c.text=Z.isNull(b)?a:b;}
this.elm.options[this.elm.options.length]=c;return this;},style:function(a,b){if(a==='opacity'&&this.elm.currentStyle){if(Z.undef(b)){var c=this.elm.style.filter;if(c.z_startsWith('alpha(opacity='))return c.slice(14,c.length-1)/100;return 1;}
this.elm.style.filter='alpha(opacity='+(b*100)+')';this.elm.style.zoom=1;return this;}
if(Z.undef(b))return this.elm.style[a];else this.elm.style[a]=b;return this;},styles:function(a){for(var b in a)this.style(b,a[b]);return this;},computedStyle:function(a){return Z.computedStyle(this,a);},attribute:function(a,b){if(Z.undef(b))return this.elm.getAttribute(a);this.elm.setAttribute(a,b);return this;},hasAttribute:function(a){if(this.elm.hasAttribute)return this.elm.hasAttribute(a);return!Z.isNull(this.elm.getAttribute(a));},classes:function(){return this.elm.className.split(/\s+/);},addClass:function(a,b){if(!Z.isNull(b)&&!b){this.removeClass(a);return this;}
var c=this.classes();if(Array.z_contains(c,a))return this;c.push(a);this.elm.className=c.join(' ');return this;},removeClass:function(a){var b=this.classes();var c=Array.z_indexOf(b,a);if(c<0)return this;b.splice(c,1);this.elm.className=b.join(' ');return this;},hasClass:function(a){return Array.z_contains(this.classes(),a);},parent:function(){var a=this.elm.parentNode;return a?Z(a):null;},children:function(){return Z.zify(this.elm.childNodes,true);},child:function(a){return Z(this.elm.childNodes[a]);},childCount:function(){return this.elm.childNodes.length;},clear:function(){this.html('');return this;},remove:function(){if(!this.elm.parentNode)return;this.elm.parentNode.removeChild(this.elm);return this;},moveTo:function(a){this.remove();Z.$(a).appendChild(this.elm);return this;},append:function(a,b){if(b&&this.elm.firstChild){this.elm.insertBefore(Z.$(a),this.elm.firstChild);}
else this.elm.appendChild(Z.$(a));return this;},insertBefore:function(a){this.elm.parentNode.insertBefore(Z.$(a),this.elm);return this;},insertAfter:function(a){if(!this.elm.nextSibling)this.parent().append(a);else this.elm.parentNode.insertBefore(Z.$(a),this.elm.nextSibling)},clone:function(){var a=this.elm.cloneNode(true);Z.removeZObjectFromElement(a);a.id='';return Z(a);},contains:function(a){a=Z.$(a);while(a){if(a==this.$)return true;a=a.parentNode;}
return false;},containsEvent:function(a){return this.contains(Z.target(a));},tag:function(){return this.elm.tagName;},show:function(){Z.show(this);return this;},hide:function(){Z.hide(this);return this;},display:function(a){Z.display(this,a);return this;},shown:function(a){return Z.shown(this,a);},position:function(a){return Z.position(this.elm,a);},dimension:function(){return Z.dimension(this.elm);},property:function(a,b){if(Z.undef(b))return this.properties?this.properties[a]:null;if(!this.properties)this.properties={};this.properties[a]=b;},control:function(){return Z.ctrl(this);},getById:function(a,b){var c=this.getTemplateRoot();if(!c)return(!b&&!Z.$(a))?null:Z(a);var d=c['_'+a];if(!d&&b)throw new Error("Z object with id '"+a+"' not found in applied template.");return d;},getId:function(){return this.attribute('_id')||this.elm.id;},getTemplateRoot:function(){var a=this;while(a&&!a.template)a=a.parent();return a&&a.template?a:null;},getTemplatePrefix:function(){if(!this.template)throw new Error("This Z-object isn't a template root");if(!this.templatePrefix)this.templatePrefix=Z.generateID()+'_';return this.templatePrefix;},getTemplate:function(){var a=this.getTemplateRoot();return a?a.template:null;}}
Z.version=1.0;Z.buildVersion=55;Z.addToPrototype=function(a,b,c,d){Z.prototype.name=b;if('ZList' in Z){ZList.addToPrototype(a,b);}
if(d&&'timeframeBoundFunctions' in Z){Z.timeframeBoundFunctions[a]=true;}}
Z.hasZObject=function(a){return '__ZObject' in a;}
Z.removeZObjectFromElement=function(a){a.__ZObject=null;}
Z.zify=function(a,b){var c=a instanceof Array||b;var d=c?[]:{};if(c)for(var e=0;e<a.length;e++)d[e]=Z(a[e]);else for(var e in a)d[e]=Z(a[e]);return d;}
Z.create=function(a,b){var c=document.createElement(a);if(Z.def(b))c.id=b;return Z(c);}
Z.withNamespace=function(){var a=Array.prototype.slice.call(arguments,0);var b=arguments[arguments.length-1];if(typeof b==='function')a.pop();for(var c=0;c<a.length;c++){a[c]=Z.createNamespace(a[c]);}
if(typeof b==='function')b.apply(null,a);return a[0];};Z.elm=Z.$=function(a,b){if(typeof a==='object'){if(a instanceof Z)return a.elm;if('ZList' in window&&a instanceof ZList)return Z.$(a.first());return a;}
if(a&&a.charAt(0)=='~'){if(!window.ZSelect)throw new Error("Cannot use select patterns: ZSelect is not loaded.");return Z.$(ZSelect.select(a));}
var c=document.getElementById(a);if(b&&!c)throw new Error("Element with id '"+a+"' isn't found.");return c;};Z.style=function(a){return Z.$(a,true).style;};Z.computedStyle=function(a,b){var c=Z.$(a,true);return 'currentStyle' in c?c.currentStyle[b]:window.getComputedStyle(c,null)[b];};Z.show=function(a){var b=Z.$(a,true);b.style.display=Z.show.blocks[b.tagName]?'block':'inline';};Z.show.blocks={'DIV':1,'TABLE':1,'P':1,'TD':1,'TR':1,'BODY':1};Z.hide=function(a){Z.style(a,true).display='none';};Z.display=function(a,b){(b?Z.show:Z.hide)(a);};Z.shown=function(a,b){var c=Z.$(a,true);var d=!(c.style.display==='none'||(!c.style.display&&Z.computedStyle(c,'display')==='none'));	if(d&&b&&c.parentNode&&c.parentNode.nodeType==1)return Z.shown(c.parentNode,b);return d;};Z.undef=function(a){return typeof a==='undefined';};Z.def=function(a){return!Z.undef(a);};Z.isNull=function(a){return a===null||Z.undef(a);};Z.notnull=function(a){return!Z.isNull(a);};Z.ifnull=function(a,b){return Z.isNull(a)?b:a};Z.ifnot=function(a,b){return a?a:b;};Z.str=Z.toStr=function(a,b){return Z.isNull(a)?Z.ifnot(b,''):(a+'');};Z.html=Z.toHtml=function(a,b){a=Z.str(a).z_htmlEncode();if(b)a=a.replace(/\n/g,'<br />');return a;};Z.attr=Z.toAttr=function(a){return Z.str(a).z_attributeEncode();};Z.generateID=function(){return '_z_generatedID_'+Z.generateID.c++;};Z.generateID.c=0;Z.pos=function(a,b){return a>=0?a:b;};Z.createNamespace=function(a){if(typeof a==='object')return a;var b=a.split('.');var c=window;for(var d=0;d<b.length;d++){var e=b[d];c=e in c?c[e]:(c[e]={});}
return c;};Z.event=function(a){return a?a:window.event;};Z.target=function(a){a=Z.event(a);return Z.ifnot(a.target,a.srcElement);};Z.ztarget=function(a){var b=Z.target(a);return b?Z(b):null;};Z.handle=function(a,b,c,d){if(d)c=c.bind(d);if(b instanceof Array){Z.foreacha(b,function(f){Z.handle(a,f,c)});return c;}
a=Z.$(a);if(a.attachEvent)a.attachEvent('on'+b,c);else a.addEventListener(b,c,false);return c;};Z.dehandle=function(a,b,c){if(b instanceof Array){Z.foreacha(b,function(e){Z.dehandle(a,e,c)});return c;}
a=Z.$(a);if(a.detachEvent)a.detachEvent('on'+b,c);else a.removeEventListener(b,c,false);return c;};Z.onFinish=function(a){return Z.initializer.onFinish(a);}
Z.foreach=function(a,b,c){if(a instanceof Array)return Z.foreacha(a,b,c);return Z.foreacho(a,b,c);};Z.foreacho=function(a,b,c){for(var d in a){var e=b.call(c,a[d],d,a);if(Z.notnull(e))return e};return null;};Z.foreacha=function(a,b,c){for(var d=0;d<a.length;d++){var e=b.call(c,a[d],d,a);if(Z.notnull(e))return e};return null;};Z.where=function(a,b,c){var d=a instanceof Array?[]:{};for(var e in a)if(b.call(c,a[e],e,a))d[e]=a[e];return d;};Z.wherea=function(a,b,c){var d=[];for(var e=0;e<a.length;e++)if(e in a&&b.call(c,a[e],e,a))d.push(a[e]);return d;};Z.select=function(a,b,c,d){var e=a instanceof Array?[]:{};for(var f in array){var a=c.call(d,array[f],f,array);if(!b||Z.notnull(a))e.push(a);}
return e;};Z.selecta=function(a,b,c,d){var e=[];for(var f=0;f<a.length;f++){if(f in a){var g=c.call(d,a[f],f,a);if(!b||Z.notnull(g))e.push(g);}}
return e;};Z.clone=function(a,b){if(typeof a!=='object')return a;if(a instanceof Date)return new Date(a.getTime());var c=a instanceof Array,d=c?[]:{};if(c)for(var e=0;e<a.length;e++)d[e]=b?Z.clone(a[e],true):a[e];else for(var e in a)d[e]=b?Z.clone(a[e],true):a[e];return d;};Z.addTo=function(a,b){for(var c in b)a[c]=b[c];};Z.addNewTo=function(a,b){for(var c in b)if(!a[c])a[c]=b[c];};Z.isValidDate=function(a,b,c){var d=new Date(a,b,c);return d.getFullYear()==a&&d.getMonth()==b&&d.getDate()==c;}
Z.base=function(a,b,c){var d=Array.prototype.slice.call(arguments,3);var e=b.callee,f=c;var g=e.prototype,h=f.prototype;f.apply(a,d);var i={};for(var j in a)if(typeof a[j]==='function'&&a.hasOwnProperty(j))i[j]=a[j];for(var j in i)a[Z.basefuncID(j,e)]=i[j];if(g.__$baseConstr)return a;g.__$baseConstr=c;for(var j in h) {if(!h.hasOwnProperty(j)||typeof h[j]!=='function')continue;if(!g[j])g[j]=h[j];g[Z.basefuncID(j,e)]=h[j];}
return a;};Z.baseID=function(a){return!a.$baseID?a.$baseID=++Z.baseID.c:a.$baseID;};Z.baseID.c=0;Z.basefuncID=function(a,b){return '__$base_'+Z.baseID(b)+'_'+a;};Z.basefunc=function(a,b,c){var d=Array.prototype.slice.call(arguments,3);return a[Z.basefuncID(b,c)].apply(a,d);};Z.basefuncWithArgs=function(a,b,c,d){return a[Z.basefuncID(b,c)].apply(a,d);};Z.registerImplementsInterface=function(a,b){var c=a.callee.prototype;if(c.__$interfaceConstrs)return;var d=Array.prototype.slice.call(arguments,1);c.__$interfaceConstrs=d;};Z.isExtending=function(a,b){for(var c=a.__$baseConstr;c;c=c.prototype.__$baseConstr)if(c==b)return true;return false;};Z.isInstanceOf=function(a,b){if(a instanceof b||a.constructor==b)return true;return Z.isExtending(a,b);};Z.isExtendingOrImplementing=function(a,b){return Z.isExtending(a,b)||Z.isImplementing(a,b);};Z.isImplementing=function(a,b,c){if(c)return Z.checkInterface(a,b);if(typeof a!=='object'&&typeof a!=='function')return false;var d=a.__$interfaceConstrs;if(d&&Array.z_contains(d,b))return true;if(a.__$baseConstr)return Z.isImplementing(a.__$baseConstr.prototype,b);return false;};Z.checkInterface=function(a,b,c){var d=b.__$staticInstance;if(!d){d=new b();b.__$staticInstance=d;}
if(!c)c=[];for(var e in d){var f=a[e],g=d[e];if(typeof f!==typeof g)c.push(e);else if(typeof f==='object' &&!Z.isInstanceOf(f,g.constructor))c.push(e);}
return c.length==0;};Z.console=new function(){var a=window.console,b,c;var d=this;d.debug=d.log=function(h){f(h,'debug');}
d.warn=function(h){f(h,'warn');}
d.error=function(h){f(h,'error');}
function f(h,i){if(a){if('log' in a&&!('debug' in a))a.log(h);else a[i](h);}
else if(b){g();c.append(Z.create('div').text(h).addClass(i));}}
d.clear=function(){c.remove();c=null;}
function g(){if(c)return;c=Z.create('div').addClass('z_console');Z(document.body).append(c,true);c.html('<div><b>Javascript console</b> <a href="" onclick="Z.console.clear();return false;">clear</a></div>');Z.addCss('.z_console { background:white;color:black; border:1px solid red; padding:2px; } .z_console .warn { color:orange } .z_console .error { color:red }');}
d.enable=function(h){b=h;}}();Z.addTo(ZArray={},{indexOf:function(a,b){for(var c=0;c<a.length;c++)if(a[c]===b)return c;return-1;},contains:function(a,b){return ZArray.indexOf(a,b)>=0;},remove:function(a,b){var c=ZArray.indexOf(a,b);if(c<0)return false;a.splice(c,1);return true;},foreach:Z.foreacha});Z.addTo(ZObject={},{foreach:Z.foreacho});Z.withNamespace(function(){for(var a in ZArray){Array['z_'+a]=ZArray[a];}});Function.prototype.bind=function(a){var b=this;return function(){b.apply(a,arguments);}};(function(){Z.addTo(String.prototype,{z_contains:function(b){return this.indexOf(b)>=0;},z_lastIndexOf:function(b,c){if(Z.undef(c))c=this.length-1;for(var d=c;d>=0;d--)if(this.substr(d,b.length)==b)return d;return-1;},z_startsWith:function(b){return this.slice(0,Math.min(b.length,this.length))===b.toString();},z_endsWith:function(b){return this.slice(this.length-Math.min(b.length,this.length))===b.toString();},z_trim:function(){return this.replace(/^\s+/,'').replace(/\s+$/,'');},z_splitKeyValue:function(b){var c=this.indexOf(b);if(c<0)return{key:this,value:''};return{key:this.slice(0,c),value:this.slice(c+1)};},z_htmlEncode:function(){return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');},z_htmlDecode:function(){return this.replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&amp;/g,'&');},z_extractTextFromHtml:function(){var b=document.createElement('div');b.innerHTML=this;return Z(b).text();},z_attributeEncode:function(b){return this.z_htmlEncode().replace(b?"'":'"',b?'&#39;':'&quot;');},z_toNumber:function(b){b=ZConfig.CultureInfo.get(b);var c=this;c=c.replace(new RegExp('\\'+b.digitGroupSeparator,'g'),"");c=c.replace(new RegExp('\\'+b.decimalPoint),'.');return c-0;},z_pad:function(b,c){if(!c)c='0';var d=this;while(d.length<b)d=c+d;return d;},z_namedFormat:function(b){var c=this;for(var d in b){var e=Z.str(b[d]).replace(/\{/g,'{{').replace(/\}/g,'}}');var f=0;while((f=c.indexOf('{'+d+'}',f))>=0){if(f==0||c.charAt(f-1)!=='{'){c=c.slice(0,f)+e+c.slice(f+d.length+2);f+=e.length;}
else f+=d.length+2;}}
c=c.replace(/\{\{/g,'{');c=c.replace(/\}\}/g,'}');return c;},z_format:function(){for(var b=0,c={};b<arguments.length;b++)c[b]=arguments[b];return this.z_namedFormat(c);},z_capitalize:function(){var b=true,c=this;for(var d=0;d<c.length;d++){var e=c.charAt(d);if(b)c=c.slice(0,d)+e.toUpperCase()+c.slice(d+1);b=e==' '||e=='\t'||e=='\n'||e=='\f'||e=='\r';}
return c;}});})();Number.prototype.z_format=function(a,b){b=ZConfig.CultureInfo.get(b);var c=a.charAt(0);var d=c.toLowerCase();var e=a.slice(1)-0;if(a.length==1)e='a'-0;	var f=this;function g(o){return o.replace(/\./g,b.decimalPoint);}
if(d==='d')return f.toFixed(0).z_pad(isNaN(e)?0:e);if(d==='f')return g(f.toFixed(isNaN(e)?3:e));if(d==='g')return g(isNaN(e)?f.toString():f.toPrecision(e));if(d==='e')return g(f.toExponential(e>0?e:6));if(d==='n'){var h=f.toFixed(isNaN(e)?2:e);var i=e>0?h.slice(0,h.indexOf('.')):h;var j=e>0?h.slice(i.length+1):'';for(var k='',l=i.length-1,m=0;l>=0;l--,m++){if((m%b.digitGroupSize)==0&&m>0)k=b.digitGroupSeparator+k;k=i.charAt(l)+k;}
for(var n='',l=0,m=0;l<j.length;l++,m++){if((m%b.digitGroupSize)==0&&m>0)n=n+b.digitGroupSeparator;n=n+j.charAt(l);}
return k+(e>0?(b.decimalPoint+n):'');}
if(d==='y'){return Z.toFullYear(this,c==='Y',isNaN(e)?null:e).toString();}}
Z.addTo(Date.prototype,{z_isBefore:function(a,b){var c=this,d=a;if(b){c=c.z_clone();c.z_truncate();d=d.z_clone();d.z_truncate();}
return c.getTime()<d.getTime();},z_isAfter:function(a,b){var c=this,d=a;if(b){c=c.z_clone();c.z_truncate();d=d.z_clone();d.z_truncate();}
return c.getTime()>d.getTime();},z_isSameDay:function(a){return this.getDate()==a.getDate()&&this.getMonth()==a.getMonth()&&this.getFullYear()==a.getFullYear();},z_isToday:function(){return this.z_isSameDay(new Date());},z_addYears:function(a){return this.z_setFullYear(this.getFullYear()+a);},z_addMonths:function(a){return this.z_setMonth(this.getMonth()+a);},z_addDays:function(a){return this.z_addMilliseconds(a*1000*60*60*24);},z_addHours:function(a){return this.z_addMilliseconds(a*1000*60*60);},z_addMinutes:function(a){return this.z_addMilliseconds(a*1000*60);},z_addMilliseconds:function(a){return new Date(this.getTime()+a);},z_truncate:function(){return new Date(this.getFullYear(),this.getMonth(),this.getDay());},z_clone:function(){return new Date(this.getTime());},z_subtract:function(a){return new ZDateDifference(this,a);},z_format:function(a,b){b=b||ZConfig.culture;var c=b.lang;return a.replace(/\{/g,'{{').replace(/\}/g,'}}').replace(/DD/g,'{2}').replace(/D/g,'{3}').replace(/dd/g,this.getDate().z_format('D2')).replace(/d/g,this.getDate()).replace(/MMMM/g,'{0}').replace(/MMM/g,'{1}').replace(/MM/g,(1+this.getMonth()).z_format('D2')).replace(/M/g,(1+this.getMonth())).replace(/yyyy/g,this.getFullYear()).replace(/yy/g,(this.getFullYear()+'').slice(2)).replace(/mmmm/g,this.getMilliseconds().z_format('D4')).replace(/mm/g,this.getMinutes().z_format('D2')).replace(/ss/g,this.getSeconds().z_format('D2')).replace(/s/g,this.getSeconds()).replace(/hh/g,this.getHours().z_format('D2')).replace(/h/g,this.getHours()).z_format(c.months[this.getMonth()],c.monthsShort[this.getMonth()],b.lang.days[this.getDay()],b.lang.daysShort[this.getDay()]);}});(function(){var a=['setDate','setFullYear','setHours','setMilliseconds','setMinutes','setMonth','setSeconds','setTime','setUTCDate','setUTCFullYear','setUTCHours','setUTCMilliseconds','setUTCMinutes','setUTCMonth','setUTCSeconds',];Z.foreach(a,function(c){Date.prototype['z_'+c]=function(){var e=new Date(this.getTime());e[c].apply(e,arguments);return e;};});})();function ZDateDifference(a,b){this.date1=a;this.date2=b;}
Z.addTo(ZDateDifference.prototype,{round:function(a){return a>=0?Math.floor(a):Math.ceil(a)},totalMilliseconds:function(){return(this.date1.getTime()-(this.date1.getTimezoneOffset()*60*1000))-(this.date2.getTime()-(this.date2.getTimezoneOffset()*60*1000));},totalSeconds:function(){return this.totalMilliseconds()/(1000)},totalMinutes:function(){return this.totalMilliseconds()/(1000*60)},totalHours:function(){return this.totalMilliseconds()/(1000*60*60)},totalMonths:function(){return 12 *(this.date1.getFullYear()-this.date2.getFullYear())-(this.date2.getMonth()-this.date1.getMonth())-((this.date2.getDate()-this.date1.getDate())/31);},totalDays:function(){return this.totalMilliseconds()/(1000*60*60*24);},totalYears:function(){return this.totalMilliseconds()/(1000*60*60*24*365);},years:function(){return this.round(this.totalMilliseconds()/(1000*60*60*24*365));},months:function(){return this.round(this.totalMonths());},days:function(){return this.round(this.totalDays());},hours:function(){return this.round(this.totalHours()-(this.days()*24));},minutes:function(){return this.round(this.totalMinutes()-(this.days()*24*60)-(this.hours()*60));}});ZConfig=new function(){var a=this;var b='';a.setServer=function(m){b=m;}
a.getServer=function(){return b;}
a.isServer=function(m){return b==m;}
a.isLocalServer=function(){return a.isServer('local');}
a.isDevelopmentServer=function(){return a.isServer('development');}
a.isStagingServer=function(){return a.isServer('staging');}
a.isTestServer=function(){return a.isServer('test');}
a.isAcceptanceServer=function(){return a.isServer('acceptance');}
a.isProductionServer=function(){return a.isServer('production');}
var d={};a.setSetting=function(m,n){d[m]=n;}
a.getSetting=function(m){return d[m];}
var e=[];a.addCookieDomainRule=function(m,n){e.push({regex:m,domain:n});}
a.getCookieDomain=function(m){for(var n=e.length-1;n>=0;n--){var o=e[n];if(o.regex.test(m))return o.domain;}
var p=location.host;return/\..*\./.test(p)?p:'';}
var f=[];a.addCookieSecureRule=function(m,n){f.push({regex:m,secure:n});}
a.getSecureCookieRule=function(m){for(var n=f.length-1;n>=0;n--){var o=f[n];if(o.regex.test(m))return o.doSecure;}
return false;}
var g=null;a.setImagesPath=function(m){g=m;}
var h={};a.mapImagePath=function(m,n){h[m]=n;}
a.getImagesPath=function(){return Z.ifnull(g,Z.combinePaths(a.frameworkPath(),'images'));}
a.getImagePath=function(m){var m=Z.ifnot(h[m],m);if(Z.isAbsolutePath(m))return m;return Z.combinePaths(a.getImagesPath(),m);}
var i='Not all data was entered correctly. Please try to correct these items:';var j=null;var k='<div class="z_summary_icon" style="float:left;"><img src="{icon}" border="0" /></div> <div class="z_summary_header" >{header}</div> <div class="z_summary_list">{list}</div> <div class="z_summary_footer">{footer}</div> <div style="clear:both" />';var l='.z_summary { background:#fdd;border:1px solid #b00; padding:8px; width:300px; } .z_summary_header { float:left; width:265px; padding-left:10px; padding-bottom:12px; } .z_summary_list { clear:left; } .z_summary_list ul { padding-left:10px; margin-top:0px; margin-left:5px;  } ';a.getSummaryFormat=function(){return k;}
a.setSummaryFormat=function(m){k=m;}
a.getSummaryCss=function(){return l;}
a.setSummaryCss=function(m){l=m;}
a.getSummaryHeader=function(){return i;}
a.setSummaryHeader=function(m){i=m;}
a.getSummaryFooter=function(){return j;}
a.setSummaryFooter=function(m){j=m;}
a.frameworkPath=function(m){if(!Z.undef(m))return Z._frameworkPath=m;if(!Z.undef(Z._frameworkPath))return Z._frameworkPath;var n=document.getElementsByTagName('script');for(var o in n){var p=n[o].src;if(!p)continue;var q=p.toLowerCase();var r=q.indexOf('/zsrc.js');if(r<0&&q.z_startsWith('zsrc.js'))r=0;if(r<0)r=q.indexOf('/z.js');if(r<0&&q.z_startsWith('z.js'))r=0;if(r<0)r=q.indexOf('/zcore.js');if(r<0&&q.z_startsWith('zcore.js'))r=0;if(r<0)r=q.indexOf('/zfull.js');if(r<0&&q.z_startsWith('zfull.js'))r=0;if(r<0)r=q.indexOf('/ztiny.js');if(r<0&&q.z_startsWith('ztiny.js'))r=0;if(r<0)continue;var m=p.slice(0,r);if(!Z.isAbsolutePath(m)){m=document.location.pathname;var s=Z.pos(m.z_lastIndexOf('/'),m.length);m=location.protocol+'//'+location.host+m.slice(0,s);}
return Z._frameworkPath=m;}
alert("The path of Framework Z couldn't be found automaticly. Please set the path explicitly using ZConfig.frameworkPath(...)");}}();ZConfig.CultureInfo=function(){this.decimalPoint=',';this.digitGroupSeparator='.';this.digitGroupSize=3;this.shortDateOrder=ZConfig.CultureInfo.ShortDateOrder.DDMMYYYY;this.shortDateSeparator=ZConfig.CultureInfo.ShortDateSeparator.Dash;this.firstDay=0;this.lang={};Z.addTo(this.lang,{months:['January','February','March','April','May','June','July','August','September','October','November','December'],monthsShort:['Jan','Febr','Mar','Apr','May','June','July','Aug','Sept','Oct','Nov','Dec'],days:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],daysShort:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],today:'today',holdCtrToMoveDownAYearholdShiftToMoveDown10Years:'Hold [ctrl] to move down a year, hold [ctrl+shift] to move down 10 years.',holdCtrToMoveUpAYearholdShiftToMoveUp10Years:'Hold [ctrl] to move up a year, hold [ctrl+shift] to move up 10 years.'});this.create=function(b){var c=Z.clone(this);for(var d in b)c[d]=b[d];return c;}};ZConfig.CultureInfo.ShortDateOrder={DDMMYYYY:1,MMDDYYYY:2,YYYYMMDD:3};ZConfig.CultureInfo.ShortDateSeparator={Slash:'/',Dash:'-',Dot:'.'};ZConfig.CultureInfo.get=function(a){if(!a)return ZConfig.culture;if(Z.isInstanceOf(a,ZConfig.CultureInfo))return a;if(typeof a==='object'){return ZConfig.culture.create(a);}
return ZConfig.culture;}
ZConfig.culture=new ZConfig.CultureInfo();ZConfig.emailPattern="^((\\w+)|(\\w+[!#$%&'*+\\-,./=?^_`{|}~\\w]*[!#$%&'*+\\-,/=?^_`{|}~\\w]))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,10}|[0-9]{1,3})(\\]?)$";ZUtil={};Z.addTo(ZUtil,{position:function(a,b){var c=0,d=0;var a=Z.$(a);var e=a;var f=a.style.position;if(!f||f==='static')a.style.position='relative';do{c+=a.offsetLeft;d+=a.offsetTop;a=a.offsetParent;}while(a!=null&&!b);e.style.position=f;return{x:c,y:d};},dimension:function(a){a=Z.$(a);return{w:a.offsetWidth,h:a.offsetHeight};},containsPosition:function(a,b){var c=Z.position(a);var d=Z.dimension(a);return b.x>c.x &&b.x<c.x+d.w&&b.y>c.y&&b.y<c.y+d.h	;},combinePaths:function(a,b){if(a.z_endsWith('/'))a=a.slice(0,a.length-1);if(b.z_startsWith('/'))b=b.slice(1);return a+'/'+b;},isAbsolutePath:function(a){return a.z_startsWith('/')||a.z_startsWith('http://')||a.z_startsWith('https://');},mousePosition:function(a){var b={x:0,y:0};if(!a)a=window.event;if(a.pageX||a.pageY)	{b.x=a.pageX;b.y=a.pageY;}
else if(a.clientX||a.clientY)	{b.x=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;b.y=a.clientY+document.body.scrollTop+document.documentElement.scrollTop;}
return b;},key:function(a){a=Z.event(a);return 'which' in a?a.which:a.keyCode;},Keys:{Backspace:8,Tab:9,Enter:13,Shift:16,Ctrl:17,Alt:18,Esc:27,PageUp:33,PageDown:34,End:35,Home:36,Left:37,Up:38,Right:39,Down:40,Insert:45,Delete:46,Digit0:48,Digit1:49,Digit2:50,Digit3:51,Digit4:52,Digit5:53,Digit6:54,Digit7:55,Digit8:56,Digit9:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,WinLeft:91,WinRight:92,Select:93,Numpad0:96,Numpad1:97,Numpad2:98,Numpad3:99,Numpad4:100,Numpad5:101,Numpad6:102,Numpad7:103,Numpad8:104,Numpad9:105,Multiply:106,Add:107,Subtract:109,DecimalPoint:110,Divide:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,Semicolon:186,EqualSign:187,Comma:188,Dash:189,Period:190,ForwardSlash:191,GraveAccent:192,OpenBracket:219,BackSlash:220,CloseBracket:221,SingleQuot:222},isControlKey:function(a){var b=a;return!((b>=47&&b<=90)||(b>=96&&b<=123)||(b>=186&&b<=192)||(b>=220&&b<=222));},isRightClick:function(a){a=Z.event(a);return 'which' in a?a.which==3:a.button==2;}   ,toFullYear:function(a,b,c){var a=Math.round(a-0);if(a>=100||a<=-100)return a;var d=new Date().getFullYear();var e=Math.floor(d/100)*100;a+=e;if(Z.isNull(b)){c=d-e;b=true;}
if(Z.isNull(c)){c=b?d-e:0;}
if(b){if(a<d-c)a+=100;}
else{if(a>d+c)a-=100;}
return a;},getTextboxSelection:function(a){if(document.selection)return document.selection.createRange().text;if(a.setSelectionRange)return a.value.substring(a.selectionStart,a.selectionEnd);else return '';},preventDefault:function(a){a=Z.event(a);if(a.preventDefault)a.preventDefault();return false;},query:function(a,b){return Z.queries(a,b)[0];},queries:function(a,b){if(!b)b=window.location.href;var c=b.indexOf('?');if(c<0)return [];var d=Z.pos(b.indexOf('#'),b.length);var e=b.slice(c+1,d).split('&');var f=[];for(var g in e){var h=e[g];var i=h.indexOf('=');if(decodeURIComponent(h.slice(0,i))==a)f.push(decodeURIComponent(h.slice(i+1)));}
return f;},addQuery:function(a,b,c){if(!a)a=window.location.href;var d=Z.pos(a.indexOf('#'),a.length);var e=a.substring(d);a=a.slice(0,d);if(c instanceof Array)Z.foreacha(c,function(g){a=Z.addQuery(a,b,g);});else{a+=a.indexOf('?')<0?'?':'&';a+=b+'='+Z.ifnot(encodeURIComponent,escape)(c);}
return a+e;},removeQuery:function(a,b){if(!a)a=window.location.href;var c=a.indexOf('?');if(c<0)return a;var d=Z.pos(a.indexOf('#'),a.length);var e=a.substring(d);var f=a.substring(0,c+1);var g=a.slice(c+1,d).split('&');	
var h=[];Z.foreacha(g,function(j){var k=Z.pos(j.indexOf('='),j.length);var l=decodeURIComponent(j.substring(0,k));if(l!=b)h.push(j);});f+=h.join('&');return f+e;},replaceQuery:function(a,b,c){return Z.addQuery(Z.removeQuery(a,b),b,c);},getCookie:function(a){var b=document.cookie.split(';');for(var c=0;c<b.length;c++){var d=b[c].split("=");if(d[0].z_trim()===a)return unescape(d[1]);}
return null;},setCookie:function(a,b,c,d,e,f,g){if(Z.isNull(c)&&Z.isNull(d))d=20*60;if(Z.isNull(d))d=0;if(Z.isNull(c))c=0;if(!f)f=ZConfig.getCookieDomain(a);if(Z.isNull(e))e=ZConfig.getSecureCookieRule(a);var h=(e===true||e==='always')||(e==='current'&&Z.isSecure())?';secure':'';document.cookie=a+"="+b +";expires="+new Date(new Date().getTime()+(d*1000)+(c*24*60*60*1000)).toUTCString()+";path="+(!g?'/':g)+(!f?'':';domain='+f)+h;},deleteCookie:function(a){Z.setCookie(a,'',-1,0);},isSecure:function(){return location.protocol=='https:';},addCss:function(a,b){var c=document.createElement('style');c.type='text/css';if(c.styleSheet)c.styleSheet.cssText=a;else c.appendChild(document.createTextNode(a));Z(document.getElementsByTagName('head')[0]).append(c,b);},formToObject:function(a,b,c){a=Z.$(a);var d={};function e(g,h,i){var j=d[h];var k=j;var l=Z.undef(j);var m= Z(g).hasAttribute('multiple');if(l&&!m){k=i;}
else{if(l)k=[];else if(!(j instanceof Array))k=[j];if(i instanceof Array){k=k.concat(i);}
else k.push(i);}
d[h]=k;}
Z.foreacha(a.elements,function(g){var h=Z.str(g.tagName).toLowerCase();var i=Z.str(g.type).toLowerCase();var j=g.name;if(!j&&!c)j=g.id;if(!j)return;if(h==='input'&&i==='radio'){if(g.checked)e(g,j,g.value);}
else if(h==='input'&&i==='checkbox'){if(g.checked)e(g,j,'on');}
else if(h==='select'&&g.multiple){e(g,j,Z.selecta(g.options,true,function(m){return m.selected?Z.ifnull(m.value,m.text):null;}));}
else if(h==='select'){var l=g.selectedIndex<0?null:g.options[g.selectedIndex].value;e(g,j,b?(g.selectedIndex<0?[]:[l]):l);}
else if(h==='input'&&(i==='submit'||i==='button')){}
else e(g,j,g.value);});return d;},queryToObject:function(a){var b={};if(!a)a=window.location.href;var c=a.indexOf('?');if(c<0)return b;var d=Z.pos(a.indexOf('#'),a.length);var e=a.slice(c+1,d);var f=e.split('&');for(var g=0;g<f.length;g++){var h=f[g];var i=Z.pos(h.indexOf('='),h.length);var j=decodeURIComponent(h.substring(0,i));if(!j)continue;var k=decodeURIComponent(h.substring(Math.min(h.length,i+1)));var l=b[j];if(l){if(l instanceof Array)l.push(k);else l=[l,k];}
else {l=k;}
b[j]=l;}
return b;},formValue:function(a,b){return Z.formValues(a,b)[0];},formValues:function(a,b){var c=Z.formToObject(a,b);return Z.getAsArray(c[b]);},formOrQueryValues:function(a,b){var c=Z.formValues(a,b);if(c.length)return c;return Z.queries(b);},formOrQueryValue:function(a,b){return Z.formOrQueryValues(a,b)[0];},getAsArray:function(a){if(Z.isNull(a))return [];if(a instanceof Array)return a;return [a];},bodyDimension:function(a,b){b=b||window;var c=b.document.body;var d=b.document.documentElement;var e='clientWidth' in c?{w:c.clientWidth,h:c.clientHeight}:'clientWidth' in d?{w:d.clientWidth,h:d.clientHeight}:{w:b.innerWidth,h:b.innerHeight};if(a){var f=Z.scrollDimension();return{h:Math.max(e.h,f.h),w:Math.max(e.w,f.w)};}
return e;},scrollDimension:function(a){a=a||window;var b=a.document.body;var c=a.document.documentElement;return 'innerWidth' in a?{w:a.innerWidth,h:a.innerHeight}:'clientWidth' in c?{w:c.clientWidth,h:c.clientHeight}:{w:b.clientWidth,h:b.clientHeight};},scrollPosition:function(a){a=a||window;var b=a.document.body;var c=a.document.documentElement;return 'pageXOffset' in a?{x:a.pageXOffset,y:a.pageYOffset}:{x:Math.max(b.scrollLeft,c.scrollLeft),y:Math.max(b.scrollTop,c.scrollTop)};},isIE6:function(){return/msie|MSIE 6/.test(navigator.userAgent);},isIE7:function(){return/msie|MSIE 7/.test(navigator.userAgent);},isIE:function(){return/msie|MSIE/.test(navigator.userAgent);},isOpera:function(){return/Opera\/\d/.test(navigator.userAgent);}});Z.addTo(Z,ZUtil);Z.addCss('.z_hidden { display:none; }');Z.ensureBackwardsCompatibillity=function(a){if(a<1){d(Array);d(String.prototype);d(Number.prototype);Date.isValid=Z.isValidDate;b();c();}
function b(){var e={'isImplementing':'implements','isExtending':'extends','isExtendingOrImplementing':'is','withNamespace':'namespace','registerImplementsInterface':'interface','isInstanceOf':'instanceof','buildVersion':false,'version':false,'timeframeBoundFunctions':false,'addToPrototype':false,'ensureBackwardsCompatibillity':false,'hasZObject':false,'removeZObjectFromElement':false,'isNull':'null'};for(var f in Z){if(f in ZUtil)continue;            var g=f.charCodeAt(0);if(g>=97&&g<=122&&f!='prototype'){var h=e[f];if(h===false)continue;if(!h)h=f;window['$'+h]=Z[f];}}}
function c(){var e=['addYears','addMonths','addDays','addHours','addMinutes','addMilliseconds','truncate'];Z.foreach(e,function(g){Date.prototype[g]=function(){this.setTime(Date.prototype['z_'+g].apply(this,arguments).getTime());return this;};});}
function d(e){for(var f in e){if(f.z_startsWith('z_')){var g=f.substring(2);e[g]=e[f];}}}}
function ZEvent(a,b){this.handlers={};	this.host=a;this.parent=null;if(b)this.registerEvents(b);}
ZEvent.register=function(a,b){if(a.events instanceof ZEvent){a.events.registerEvents(b);return;}
a.events=new ZEvent(a,b);a.addEventListener=a.events.add.bind(a.events);a.removeEventListener=a.events.remove.bind(a.events);}
ZEvent.prototype={_:1,registerEvents:function(a){var b=this.host;Z.foreach(a,function(d){b['on'+d.charAt(0).toUpperCase()+d.slice(1)]=function(f){return Z.handle(b,d,f);};});},add:function(a,b){a=a.toLowerCase();if(this._find(a,b)>=0)return false;if(!this.handlers[a])this.handlers[a]=[b];else{this.handlers[a]=Z.clone(this.handlers[a]);this.handlers[a].push(b);}
return true;},remove:function(a,b){a=a.toLowerCase();var c=this._find(a,b);if(c!=-1){this.handlers[a]=Z.clone(this.handlers[a]);this.handlers[a].splice(c,1);}
return c!=-1;},_find:function(a,b){a=a.toLowerCase();var c=this.handlers[a];return!c?-1:Array.z_indexOf(c,b);},fire:function(a,b){a=a.toLowerCase();var c=this.handlers[a];if(!c)return;if(!b)b={};if(!b.type)b.type=a;if(!b.target)b.target=this.host;var d=false;b.cancelBubble=function(){d=true;}
for(var f in c)c[f].call(this.host,b);if(this.parent&&!d)this.parent.events.fire(a,b);}}
Function.prototype.ensureLoaded=function(a){var b=this;return function(){var d=Array.prototype.slice.call(arguments);var e=this;a.load(function(){b.apply(e,d);});}}
ZLoader=function(a,b,c,d){if(this==window){e.notify();return;}
var e=this;e.baseUrl=Z.str(a,'');e.htmlElms=[];var f=false,g=false;var h=[],i=[];var j=0;ZEvent.register(e,['finish','start','finishOne']);function k(){Z.foreach(b,function(n){e.addScript(n);});Z.foreach(c,function(n){e.addHtml(n);});Z.foreach(d,function(n){e.addCss(n);});e.addFunction(function(n){n.notify();});}
e.addFunction=function(m,n){j++;if(n||g||f)m(e);	
else h.push(m);}
e.addLoader=function(m,n){e.addFunction(function(p){m.load(p.notify);},n);}
e.addCss=function(m,n){e.addFunction(function(){ZTransport.get(e.resolve(m),'css',function(){e.notify({url:m});});},n);}
e.addScript=function(m,n){e.addFunction(function(){ZTransport.get(e.resolve(m),'eval',function(){e.notify({url:m});});},n);}
e.addHtml=function(m,n,o,p){var q=document.createElement('div');e.htmlElms.push(q);Z.display(q,p);if(!o)document.body.appendChild(q);else Z(o).append(q);e.addFunction(function(){ZTransport.get(e.resolve(m),'text',function(t){q.innerHTML=t;e.notify({url:m});});},n);return q;}
e.hookUpEvent=function(m,n){j++;Z.handle(m,n,function(){e.notify();});}
e.hookedUpSomething=function(){j++;}
e.setPreload=function(m){if(!m)m=10000+Math.floor(Math.random()* 10000);var n=setInterval(function(){if(!ZTransport.requestCount){clearInterval(n);e.load();}},m);return e;}
e.resolve=function(m){if(m.z_startsWith('/')||m.z_startsWith('http://')||m.z_startsWith('https://'))return m;var n=e.baseUrl;if(n&&!n.z_endsWith('/'))n+='/';return n+m;}
e.load=function(m){if(f){if(m)m();return;}
if(m)i.push(m);if(g)return;g=true;e.events.fire('start');Z.foreach(h,function(o){o(e);});}
e.notify=function(m){e.events.fire('finishOne',m);if(!--j)e.notifyFullyLoaded();}
e.isLoaded=function(){return f;}
e.isLoading=function(){return g;}
e.notifyFullyLoaded=function(){if(f)return;f=true;g=false;e.events.fire('finish');Z.foreach(i,function(n){n();});}
k();}
ZLoader.predefined={};Z.initializer=new ZLoader();Z.handle(window,'load',function(){if(Z.isOpera()){setTimeout(function(){Z.initializer.load()},0);}
else Z.initializer.load();});ZTransport={};ZTransport.requestCount=0;ZTransport.submit=function(a,b,c,d,e){var f=!c;if(f)c=document.createElement('form');else{c=Z.$(c);while(c&&c.tagName!='FORM')c=c.parentNode;}
c.action=Z.str(a,document.location.href);c.method=Z.str(b,(!f&&c.method)?c.method:'get');c.target=Z.str(e,(!f&&c.target)?c.target:'_self');var g=[];var h=function(k,l){var m=document.createElement('input');m.type='hidden';m.name=k;m.value=l;c.appendChild(m);g.push(m);};Z.foreach(d,function(k,l){if(k instanceof Array)Z.foreacha(k,function(n){h(l,n);});else h(l,k);});if(f)document.body.appendChild(c);var j=document.createElement('input');j.type='submit';Z.hide(j);c.appendChild(j);j.click();if(f)Z(c).remove();Z.foreach(g,function(k){Z(k).remove();});Z(j).remove();}
ZTransport.ajax=function(a,b,c,d,e,f,g,h){var i=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP");i.onreadystatechange=function(){if(i.readyState!=4)return;if(i.status!=200){if(f)f(i);else if(ZTransport.errorFunction)ZTransport.errorFunction(i);return;}
ZTransport.requestCount--;var n=d=='json' ?ZJSON.parse(i.responseText,Z.ifnot(g,JSON_dateReviver)):d=='xml'?i.responseXML.documentElement:d=='text'?i.responseText:d=='request'?i:d=='eval'?eval(i.responseText):i.responseText;if(d=='css')Z.addCss(n);if(e)e(n);}
var k='get';var l=a;var m=null;b=Z.str(b,'get').toLowerCase();if(b=='json'){k='post';m=ZJSON.stringify(c,h);}
else if(b=='post'){k='post';m='';if(c)Z.foreach(c,function(n,o){m=Z.addQuery(m,o,n);});if(m.z_startsWith('?'))m=m.slice(1);}
else if(b=='get'){k='get';if(c)Z.foreach(c,function(n,o){l=Z.addQuery(l,o,n);});}
i.open(k,l,true);if(b=='json')i.setRequestHeader("Content-Type","application/json");if(b=='post')i.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ZTransport.requestCount++;i.send(m);}
ZTransport.get=function(a,b,c,d){return ZTransport.ajax(a,'get',null,b,c,d);}
ZTransport.errorFunction=function(){}
ZTransport.jsonp=function(a,b,c){if(b)Z.foreach(b,function(h,i){a=Z.addQuery(a,i,h);});var e=a.z_lastIndexOf('?');if(Z.pos(a.indexOf('?'),e)>=e)throw "No jsonp marker (?) was found in de baseUrl.";var f='jsonp_callback_'+ZTransport.jsonp.curID++;a=a.slice(0,e)+'ZTransport_'+f+a.slice(e+1);window["ZTransport_"+f]=function(){delete window["ZTransport_"+f];Z(g).remove();c.apply(null,arguments);};var g=document.createElement('script');g.src=a;g.type='text/javascript';document.body.appendChild(g);}
ZTransport.jsonp.curID=0;ZAjaxNetService=function(a,b){var c=this;c.url=a;c.version=b||ZAjaxNetService.version;c.applyTimezone=ZAjaxNetService.applyTimezone;if(c.version!="3.5"&&c.version!="2.0"){throw 'Unknown ajax.net version specified: '+c.version+'. Use "3.5" or "2.0"';}
c.call=function(h,i,j,k,l){var m=this.url+'/'+h;ZTransport.ajax(m,'json',i,'request',function(o){i=g(o.responseText);if(c.version=="3.5"&&i&&'d' in i)i=i.d;if(j)j(i,l);},function(o){var p=o.getResponseHeader('jsonerror')==='true';var q=!p?{Message:o.responseText,ExceptionType:'ServerError',StackTrace:''}:g(o.responseText);if(c.version=="3.5"&&q&&'d' in q)q=q.d;if(k)k(q,l);else if(c.onFailed)c.onFailed(q,l);else ZAjaxNetService.onFailed(q,l);},null,e);}
function e(h,i){if(this[h] instanceof Date){var j=this[h];var k=j.getTime()
if(c.applyTimezone&&k!=62135596800000)k-=j.getTimezoneOffset()*60000;return new ZAjaxNetDate("\"\\/Date("+k+")\\/\"");}
return i;}
function f(h){var i=/"\\\/Date\((-?\d+)\)\\\/"/;while(i.test(h)){var j=RegExp.lastParen-0;	
if(c.applyTimezone&&j!=62135596800000){j+=new Date(j).getTimezoneOffset()*60000;}
h=RegExp.leftContext+'new Date('+j+')'+RegExp.rightContext;}
return h;}
function g(h){h=f(h);return ZJSON.parse(h);}}
ZAjaxNetService.timezoneOffset=new Date().getTimezoneOffset()*60*1000;ZAjaxNetService.applyTimezone=true;ZAjaxNetService.minDate=new Date(62135596800000);ZAjaxNetService.version="3.5";ZAjaxNetService.onFailed=function(){};

//asd
if(!this.ZJSON){ZJSON={};}
(function(){function f(n){return n<10?'0'+n:n;}
if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z';};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}
var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}
function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
if(typeof rep==='function'){value=rep.call(holder,key,value);}
switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
gap+=indent;partial=[];if(value instanceof ZAjaxNetDate){return value.str}if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
v=partial.length===0?'[]':gap?'[\n'+gap+
partial.join(',\n'+gap)+'\n'+
mind+']':'['+partial.join(',')+']';gap=mind;return v;}
if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==='string'){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+
mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
if(typeof ZJSON.stringify!=='function'){ZJSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('ZJSON.stringify');}
return str('',{'':value});};}
if(typeof ZJSON.parse!=='function'){ZJSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}
return reviver.call(holder,key,value);}
cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+
('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
if(/^[\[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|new Date\(-?\d+\)|'[^'\\\n\r]*'|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?|[0-9a-zA-Z$]+\s*:/g, ']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
throw new SyntaxError('ZJSON.parse');};}})();
JSON_dateReviver=function(a,b){var c;if(typeof b==='string'){c=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(b);if(c){return new Date(Date.UTC(+c[1],+c[2]-1,+c[3],+c[4],+c[5],+c[6]));}}
return b;}
function ZAjaxNetDate(a){this.str=a;};ZBack={};ZBack.add=function(a,b,c){var d=++ZBack.currentIndex;ZBack._backObjs[d]={redo:a,save:b,title:c};ZBack._backObjs.length=d+1;if(d>0){var e=ZBack._backObjs[d-1];e.state=e.save?e.save():null;}
var f=ZConfig.frameworkPath()+'/zback_frame.html?i='+d+'&t='+new Date().getTime();if(ZBack._wind){ZBack._wind.location=f;}
else{var g=document.createElement('iframe');g.src=f;document.body.appendChild(g);Z.hide(g);}
if(c)document.title=c;return a;}
ZBack.currentIndex=-1;ZBack._backObjs=[];ZBack._wind=null;ZBack._callback=function(a,b){ZBack._wind=b;if(a!=ZBack.currentIndex&&ZBack._backObjs[a]){if(a>ZBack.currentIndex&&ZBack._backObjs.length>a+1){var c=ZBack._backObjs[a-1];c.state=c.save?c.save():null;}
else if(a<ZBack.currentIndex&&ZBack._backObjs.length>0){var d=ZBack._backObjs[a+1];d.state=d.save?d.save():null;}
ZBack.currentIndex=a;var e=ZBack._backObjs[a];e.redo(e.state);if(Z.notnull(e.title))document.title=backOj.title;}}
ZStyle=new(function(){var a=this;a.colors={aqua:'#00FFFF',black:'#000000',blue:'#0000FF',fuchsia:'#FF00FF',gray:'#808080',green:'#008000',lime:'#00FF00',maroon:'#800000',navy:'#000080',olive:'#808000',purple:'#800080',red:'#FF0000',silver:'#C0C0C0',teal:'#008080',white:'#FFFFFF',yellow:'#FFFF00'};var b=Z.isIE();a.currentStyle=function(d,e,f){if(f&&f[e]){return f[e];}
var g=null;if(e==='opacity'&&d.currentStyle&&b){g=d.currentStyle['filter'];if(g.z_startsWith('alpha(opacity=')){var h=a.parseStyle(g,e);h.unit='opacity';h.value/=100;return h;}
return{value:1,unit:'opacity'};}
if(e==='offsetHeight'||e==='offsetWidth'){var i=e==='offsetHeight';var j=d.style[i?'height':'width'];d.style[i?'height':'width']='100%';var k=d.style.display;Z.show(d);var l=a.parseStyle(i?d.offsetHeight:d.offsetWidth);d.style[i?'height':'width']=j;d.style.display=k;return l;}
if(e==='viewportHeight'||e==='viewportWidth'){var i=e==='viewportHeight';var l=a.currentStyle(d,i?'offsetHeight':'offsetWidth',f);var j=a.currentStyle(d,i?'height':'width',f).value;return{value:Math.round(j*100/l.value),unit:'%'};}
if(d.currentStyle&&b)g=d.currentStyle[e];else g=window.getComputedStyle(d,null)[e];return a.parseStyle(g,e);}
a.parseStyle=function(d,e){if(typeof d==='undefined')return{value:null,unit:''};if(typeof d==='number')return{value:d,unit:''};if(d.slice(0,'alpha(opacity='.length)=='alpha(opacity='){return{value:d.slice('alpha(opacity='.length,d.length-1)-0,unit:'alpha(opacity='};}
var f=ZStyle;if(d.charAt(0)=='#')return{value:f.parseHexColor(d),unit:'rgb'};if(d.substr(0,4)=='rgba')return{value:f.parseRgbColor(d),unit:'rgba'};if(d.substr(0,3)=='rgb')return{value:f.parseRgbColor(d),unit:'rgb'};if(f.colors[d])return{value:f.parseHexColor(f.colors[d]),unit:'rgb'};var g=d.match(/^(-?\d+\.?\d*)(\D*)$/);if(!g)return{value:d,unit:''};return{value:g[1]-0,unit:g[2]};}
a.parseRgbColor=function(d){var e=d.substring(d.indexOf('(')+1,d.length-1).split(',');for(var f in e)e[f]=e[f]-0;return e;}
a.parseHexColor=function(d){var e=function(g,h){return parseInt('0x'+(h==2?d.substr(g,h):(d.substr(g,h)+d.substr(g,h))))}
return d.length==4?[ e(1,1),e(2,1),e(3,1)]:[ e(1,2),e(3,2),e(5,2)]}
a.allowFloats={'-moz-opacity':1,'opacity':1}
a.styleToString=function(d,e,f){if(f=='alpha(opacity=')return 'alpha(opacity='+e+')';if(f=='rgb'||f=='rgba')return f+'('+e.join(',')+')';return e+''+f;}
a.setStyle=function(d,e,f,g){var h=f.value,i=f.unit;if(e=='opacity'&&d.currentStyle&&b){i='alpha(opacity=';h=h*100;e='filter';d.style.zoom=1;}
if(e==='viewportHeight'||e==='viewportWidth'){var j=e==='viewportHeight';var k=a.currentStyle(d,j?'offsetHeight':'offsetWidth',g);d.style[j?'height':'width']=h==100?'100%':Math.round(h*k.value/100)+'px';}
else d.style[e]=a.styleToString(e,h,i);}})();function ZTimeline(a){this.frame=new ZTimeframe(this,a);this.isStopped=false;this.runningCount=0;this.playIndex=0;this.currentFrames={};this.thisObj=a;this.lastFrame=this.frame;ZEvent.register(this,['finish','play','stop']);}
ZTimeline.prototype={_:1,play:function(){this.stop();this.runningCount=0;this.isStopped=false;this.playIndex++
this.events.fire('play');this._frameStarted(this.frame);this.frame.notify();return this;},stop:function(){this.isStopped=true;this.events.fire('stop');return this;},execute:function(){return this.frame.execute.apply(this.frame,arguments);},sleep:function(){return this.frame.sleep.apply(this.frame,arguments);},_frameStarted:function(a){this.runningCount++;this.currentFrames[a.id]=a;},_frameEnded:function(a){this.runningCount--;delete this.currentFrames[a.id];if(!this.runningCount&&!a.tasks.length){this.events.fire('finish');}}}
ZTimeline.prototype.play.zTimelineNotifierIndex=0;ZTimeline.notifier={};ZTimeline.thisObj={};ZTimeline.rate=35;ZTimeline.callee=null;ZTimeline._timer=null;ZTimeline._timerFuncs={};ZTimeline._timerCount=0;ZTimeline._timerIDCount=0;ZTimeline.addListener=function(a){a._zTimeframeTimerID=++ZTimeline._timerIDCount;ZTimeline._timerFuncs[ZTimeline._timerIDCount]=a;if(!ZTimeline._timerCount++)ZTimeline._timer=setInterval(function(){for(var c in ZTimeline._timerFuncs)ZTimeline._timerFuncs[c]();},ZTimeline.rate);}
ZTimeline.removeListener=function(a){delete ZTimeline._timerFuncs[a._zTimeframeTimerID];if(!--ZTimeline._timerCount)clearInterval(ZTimeline._timer);}
function ZTimeframe(a,b){this.tasks=[];this.isNotified=false;this.notify=this.notify.bind(this);this.timeline=a;this.id=++ZTimeframe._idCount;this.thisObj=b;ZEvent.register(this,['finish']);if(b){var c=this;for(var d in b){var e=b[d];if(this[d])continue;if(typeof e!=='function')continue;var f=function(h){this[d]=function(){var j=Array.prototype.slice.call(arguments);j.unshift(h);j.unshift(b);return c.executeWithThis.apply(c,j);}}.call(this,e);if(e.zTimelineNotifierIndex)this[d].zTimelineNotifierIndex=e.zTimelineNotifierIndex;}}}
ZTimeframe._idCount=0;ZTimeframe._taskCount=0;ZTimeframe.__task={};ZTimeframe.prototype={_:1,_callFunc:function(a){if(this.isStopped)return;this.timeline._frameStarted(this);ZTimeline.current=this.timeline;this._prepareTask(a);	
if(typeof a.func==='object'){ZTimeframe.__task[++ZTimeframe._taskCount]=a;var b='ZTimeframe.__task['+ZTimeframe._taskCount+'].func(';for(var c=0;c<a.args.length;c++){if(c>0)b+=',';b+='ZTimeframe.__task['+ZTimeframe._taskCount+'].args['+c+']';}
b+=')';eval(b);delete ZTimeframe.__task[ZTimeframe._taskCount];}
else {a.func.apply(a.obj||window,a.args);}
ZTimeline.current=null;if(!a.hasNotifier)a.notifier();},notify:function(){this.timeline._frameEnded(this);this.events.fire('finish');if(this.timeline.isStopped)return;for(var a=0;a<this.tasks.length;a++){this._callFunc(this.tasks[a]);}},executeWithThis:function(a,b){var c=[];for(var d=2;d<arguments.length;d++){c.push(arguments[d]);}
if(a==ZTimeline.thisObj)obj=this.thisObj;if(typeof b==='string')b=a[b];var e=new ZTimeframe(this.timeline,Z.ifnot(this.nextThisObj,this.thisObj));var f={obj:a,func:b,args:c,frame:e};this.tasks.push(f);return e;},execute:function(a){var b=Array.prototype.slice.call(arguments);b.unshift(null);return this.executeWithThis.apply(this,b);},subject:function(a){if(Z.undef(a))return this.thisObj;if(typeof a==='string')a=Z(a);this.nextThisObj=a;var b=this.execute(function(){});this.nextThisObj=null;return b;},_prepareTask:function(a){var b=this.timeline.playIndex;var c=this;a.notifier=function(){if(c.timeline.playIndex==b)a.frame.notify();}
var e=false;for(var f=0;f<a.args.length;f++){if(a.args[f]==ZTimeline.notifier){a.args[f]=a.notifier;e=true;}}
if(typeof a.func.zTimelineNotifierIndex==='number'){a.args[a.func.zTimelineNotifierIndex]=a.notifier;e=true;}
a.hasNotifier=e;},sleep:function(a){return this.execute(setTimeout,ZTimeline.notifier,a);}}
Function.prototype.execOnZTimeframe=function(a){var b=this;var c=function(){if(ZTimeline.current&&arguments.length>a){b.apply(this,arguments);}
else{var e=new ZTimeline(this);var f=Array.prototype.slice.call(arguments);f.unshift(b);f.unshift(this);var g=e.frame.executeWithThis.apply(e.frame,f).sleep(0);e.play();return g;}}
b.zTimelineNotifierIndex=c.zTimelineNotifierIndex=a;return c;}
Z.prototype.sleep=function(a,b){setTimeout(b,a);}.execOnZTimeframe(1);Z.prototype.timeframe=function(a){var b=new ZTimeline(this);var c=b.frame.sleep(0);if(!a)b.play();return c;};function ZTween(a,b,c,d){this.rate=window.ZTimeline?ZTimeline.rate:20;if(!c)c=200;b=Z.clone(b);var e={};var f=false;var g=0;var h=Math.ceil(c/this.rate);if(!d)d=new ZTween.PowerInterpolator(1);var i=d.calcFrames(h);var j=ZStyle.colors;var k=null;var l={};m();function m(){	
if(!ZStyle.currentStyle(a,'left').unit)a.style.left='0px';if(!ZStyle.currentStyle(a,'top').unit)a.style.top='0px';if(Z.def(b.viewportHeight)&&(ZStyle.currentStyle(a,'paddingTop').value ||ZStyle.currentStyle(a,'paddingBottom').value)){throw "There are paddings on the element for which you want to tween the viewport. Tweening can't work with paddings. Try to put the paddings in an inner div.";}
if('viewportHeight' in b){l['offsetHeight']=ZStyle.currentStyle(a,'offsetHeight');}
for(var s in b){var t=(b[s]+'').z_trim();var u=t.length>=2?t.substr(0,2):'';if(u=='+='||u=='-='||u=='%='||u=='/='){u=t.substr(0,2);t=t.substr(2);}else u='';if(!u&&t.indexOf('-',1)>=0){var v=t.split('-');t=v[1];e[s]=ZStyle.parseStyle(v[0]);ZStyle.setStyle(a,s,e[s]);}
t=ZStyle.parseStyle(t,s);var w=ZStyle.currentStyle(a,s,l);var x=w.value;if(u){if(u=='+=')t.value=x+t.value;if(u=='-=')t.value=x-t.value;if(u=='*=')t.value=x * t.value;if(u=='/=')t.value=Math.round(x/t.value);}
t.start=x;t.end=t.value;t.name=s;b[s]=t;if(w.unit==='pt'||t.unit==='pt')throw "ZTween doens't work with point units, please work with pixels for "+s;if(s==='viewportWidth' &&(ZStyle.currentStyle(a,'paddingLeft').value ||ZStyle.currentStyle(a,'paddingRight').value)){throw "There are left or right paddings on the element you want to tween the viewport off. Tweening can't work with paddings.";}
if(s==='viewportHeight' &&(ZStyle.currentStyle(a,'paddingTop').value ||ZStyle.currentStyle(a,'paddingBottom').value)){throw "There are top or bottom paddings on the element you want to tween the viewport off. Tweening can't work with paddings.";}}}
this.play=function n(s){if(!f)g=0;if(g>=h)return;this.timelineStopped=false;var t=this;if(window.ZTimeline&&ZTimeline.current){this.timeline=ZTimeline.current;stopFunc=function(){t.timelineStopped=true;};this.timeline.onStop(stopFunc);}
var v=(t.timeline?ZTimeline.addListener:setInterval)(function(){if(!t.timelineStopped){g+=1;p(g);}
if(t.timelineStopped||g>=h||k){t.timeline?ZTimeline.removeListener(arguments.callee):clearInterval(v);if(t.timeline)Z.dehandle(t.timeline,'end',stopFunc);if(s)s();}},this.rate);}
this.play.zTimelineNotifierIndex=0;this.frame=function(){return g;}
function p(s){for(var t in b){var u=b[t];q(u,s);}}
function q(s,t){var u=s.name;var v=ZStyle.currentStyle(a,u,l);var w=h-t;var x;if(v.value instanceof Array){x=[];for(var y=0;y<v.value.length;y++){x[y]=r(u,s.start[y],s.end[y],t);}}
else{var z=s.end-v.value;x=r(u,s.start,s.end,t);}
try{ZStyle.setStyle(a,u,{value:x,unit:v.unit},l);}catch(err){alert('Kon '+u+' niet instellen. Wellicht moet je eerst een beginwaarde in de html/css instellen.');k=err;}}
function r(s,t,u,v){var w=u-t;var x=i[v] * w+t;if(!ZStyle.allowFloats[s])x=Math.round(x);if(u>t)return Math.min(Math.max(x,t),u);return Math.min(Math.max(x,u),t);}}
ZTween.PowerInterpolator=function(a){this.calcFrames=function(c){var d=[];var e=Math.pow(c,a);for(var f=0;f<=c;f++){d[f]=Math.pow(f,a)/e;}
return d;}}
ZTween.BounceInterpolator=function(a,b,c){this.calcFrames=function(e){var f=[];var g=(!g&&g!==0)?15:g;g=Math.floor(e*b);c=(!c&&c!==0)?.1:c;var h=Math.pow(e-g,a);var i=0;for(;i<=e-g;i++){f[i]=Math.pow(i,a)/h;}
for(var j=0,k=1;i<e;i++,j++){f[i]=1-(k/g*c);if(j<g/2)k++;else k--;}
f[e]=1;return f;}}
ZTween.bounce=new ZTween.BounceInterpolator(2,.2,.2);ZTween.speedUp=new ZTween.PowerInterpolator(2);ZTween.slowDown=new ZTween.PowerInterpolator(.5);Z.prototype.tween=function(a,b,c,d){new ZTween(this.elm,a,b,c).play(d);}.execOnZTimeframe(3);Z.prototype.wipe=function(a,b,c,d,e){if(!c)c={};c.viewportHeight=a?0:100;if(a!=Z.shown(this)){if(e)e();return;}
this.style('height',a?'100%':'0px');this.style('overflow','hidden');this.show();var f=this;this.tween(c,b,d||ZTween.speedUp,function(){if(a)f.hide();if(e)e();});}.execOnZTimeframe(4);Z.withNamespace('ZSelect',function(a){a.foreach=d;a.select=b;a.count=c;a.check=y;function b(cb){var db=null;d(cb,function(fb,gb){db=fb;gb.stop=true;});return db?Z(db):null;}
function c(cb){var db=0;d(cb,function(fb,gb){db++;});return db;}
function d(cb,db){  
if(typeof cb==='string')cb={pattern:cb};var eb={stop:false};var fb=z.parse(cb.pattern);var gb=!cb.root;if(gb)cb.root=document;	
var hb=Z.$(cb.root);if(!hb)throw new Error("Root element does not exist.");var ib=!!hb.getElementsByClassName;var jb=null;	
kb();function kb(){for(var lb=0;lb<fb.length;lb++){var mb=fb[lb];var nb={};nb.parts=mb;nb.control=eb;nb.handler=db;nb.hasNativeGetByClass=ib;var ob=hb;var pb=mb[0][0].binder.looper;if(gb &&(pb==j||pb==l)){ob=jb=Z.here().$;}
if(f(nb,0,ob))return;}}}
function e(cb,db){if(db.length<=1||!cb.hasNativeGetByClass)return db;if(db[0].binder.matcher!=s)return db;for(var eb=1;eb<db.length;eb++){var fb=db[eb];if(fb.binder.matcher==w||fb.binder.matcher==v){ 
db.splice(eb,1);db.unshift(fb);return db;}}
return db;}
function f(cb,db,eb){if(db>=cb.parts.length){cb.handler(Z(eb),cb.control);}
else{       
var fb=cb.parts[db];var gb=e(cb,fb);gb[0].binder.looper(cb,db,eb,gb[0],gb);}
return cb.control.stop;}
function g(cb,db,eb,fb,gb,hb){for(var ib=0;ib<eb.length;ib++){var jb=eb[ib];if(fb&&!fb(jb,gb))continue;if(!r(jb,hb))continue;if(f(cb,db+1,jb))return;}}
function h(cb,db,eb,fb,gb){var hb=eb.getElementsByTagName(fb.name);g(cb,db,hb, null,fb,gb);}
function i(cb,db,eb,fb,gb){var hb=eb.getElementsByTagName('*');g(db,hb, null,fb,gb);}
function j(cb,db,eb,fb,gb){for(var hb=eb.parentNode;hb&&hb.nodeType==1;hb=hb.parentNode){if(!r(hb,gb))continue;if(f(cb,db+1,hb))return;}}
function k(cb,db,eb,fb,gb){for(var hb=eb.previousSibling;hb;hb=hb.previousSibling){if(hb.nodeType!=1) continue;if(!r(hb,gb))continue;if(f(cb,db+1,hb))return;}}
function l(cb,db,eb,fb,gb){k(cb,db,eb,fb,gb);if(cb.control.stop)return;j(cb,db,eb,fb,gb);}
function m(cb,db,eb,fb,gb){if(eb.getElementsByClassName){n(cb, db,eb,fb,gb);}
else{o(cb,db,eb,fb,gb);}}
function n(cb,db,eb,fb,gb){var hb=eb.getElementsByClassName(fb.name);g(cb,db,hb, null,fb,gb);}
function o(cb,db,eb,fb,gb){var hb=eb.getElementsByTagName('*');g(cb,db,hb, w,fb,gb);}
function p(cb,db,eb,fb,gb){var hb=document.getElementById(fb.name);if(hb)g(cb,db,[hb], null,fb,gb);}
function q(cb,db,eb,fb,gb){var hb=eb.getElementsByTagName('*');g(cb,db,hb, x,fb,gb);}
function r(cb,db,eb){for(var fb=eb?0:1;fb<db.length;fb++){var gb=db[fb];if(!gb.binder.matcher(cb,gb))return false;}
return true;}
function s(cb,db){return cb.tagName.toLowerCase()===db.name.toLowerCase();}
function t(cb,db){return true;}
function u(cb,db){return true;}
function v(cb,db){return cb.id===db.name;}
function w(cb,db){var eb=new RegExp('\\s'+db.name+'\\s');return eb.test(' '+cb.className+' ');}
function x(cb,db){var eb=db.attribute;var fb=cb.getAttribute(eb.name);var gb=!Z.isNull(fb);if(!gb)return false;if(!eb.operator)return true;if(eb.operator=='='){return fb===eb.value;}
if(eb.operator=='~='){var hb=new RegExp('\\s'+eb.value+'\\s');return hb.test(' '+fb+' ');}
if(eb.operator=='|='){return fb==eb.value||fb.z_startsWith(eb.value+'-');}
return false;}
function y(cb,db){cb=Z.$(cb);var eb=z.parse(db);for(var fb=0;fb<eb.length;fb++){var gb=eb[fb];var hb=gb.shift();if(!r(cb,hb,true))continue;var ib={};ib.parts=gb;ib.control={stop:false};ib.handler=function(kb,lb){lb.stop=true;};ib.hasNativeGetByClass=!!cb.getElementsByClassName;if(f(ib,0,cb))return true;}
return false;}
var z=new(function(){var cb={},db={};var eb=0,fb=50;this.parse=function(ib){var jb=cb[ib]||db[ib];if(jb)return hb(jb,true);jb=bb.parse(ib);(eb<fb?cb:db)[ib]=jb;eb++;if(eb==fb*2){cb={};eb=0;}
else if(eb==fb){db={};}
return hb(jb,true);}
function hb(ib,jb){if(typeof ib!='object')return ib;if(ib instanceof Date)return new Date(ib.getTime());var kb=ib instanceof Array,lb=kb?[]:{};if(kb)for(var mb=0;mb<ib.length;mb++)lb[mb]=jb?hb(ib[mb],true):ib[mb];else for(var mb in ib)lb[mb]=jb?hb(ib[mb],true):ib[mb];return lb;}})();var bb=new(function(){var cb=35;var db=46;var eb=95;var fb=45;var gb=42;var hb=94; 
var ib=61;var jb=91;var kb=93;var lb=['=','~=','|='];var mb={id:{matcher:v,looper:p},tag:{matcher:s,looper:h},className:{matcher:w,looper:m},attribute:{matcher:x,looper:q},star:{matcher:t,looper:i},parent:{matcher:u,looper:j},parentAndSiblings:{matcher:u,looper:l}};this.parse=nb;function nb(ob){if(ob.charAt(0)=='~')ob=ob.substr(1);var pb=[];var qb=[pb];var rb=0;sb();return qb;function sb(){while(tb()){}}
function tb(){if(!xb())return false;if(ob.charAt(rb)==','){if(!pb.length)throw new Error("Syntax error in pattern "+ob);pb=[];qb.push(pb);rb++;}
if(!xb())return false;var yb=[];while(rb<ob.length &&ob.charCodeAt(rb)>32&&ob.charAt(rb)!=','){       
var zb=ob.charCodeAt(rb);if(zb===cb){rb++;yb.push({name:wb(),binder:mb.id});}
else if(zb===db){rb++;yb.push({name:wb(),binder:mb.className});}
else if(zb===gb){if(yb.length>0&&!(yb.length==1 &&(yb[0].binder==mb.parent||yb[0].binder==mb.parentAndSiblings))){throw new Error("Syntax error in pattern "+ob);}
rb++;yb.push({name:null,binder:mb.star});}
else if(zb===hb){if(yb.length>0)throw new Error("Syntax error in pattern "+ob);rb++;if(ob.charCodeAt(rb)==ib){rb++;yb.push({name:null,binder:mb.parentAndSiblings});}
else yb.push({name:null,binder:mb.parent});}
else if(zb===jb){rb++;yb.push({attribute:ub(),binder:mb.attribute});}
else if((zb>=0x41&&zb<=0x5A)||(zb>=0x61&&zb<=0x7A)){if(yb.length>0&&!(yb.length==1 &&(yb[0].binder==mb.parent||yb[0].binder==mb.parentAndSiblings))){throw new Error("Syntax error in pattern "+ob);}
yb.push({name:wb(),binder:mb.tag});}
else{throw new Error("Syntax error in pattern "+ob);}}
if(!yb.length)throw new Error("Syntax error in pattern "+ob);pb.push(yb);return true;}
function ub(){var yb={name:'',value:'',operator:''};if(!xb())throw new Error("Syntax error in pattern "+ob);while(rb<ob.length){var zb=ob.charCodeAt(rb);if(vb(zb)){yb.name+=ob.charAt(rb);rb++;}
else break;}
if(!xb())return yb;for(var ac in lb){var bc=lb[ac];if(ob.substr(rb,bc.length)==bc){yb.operator=bc;   
rb+=bc.length;}}
if(yb.operator){if(!xb())throw new Error("Syntax error in pattern "+ob);var cc=ob.charAt(rb);if(cc!='\''&&cc!='\"')cc='';else rb++;while(rb<ob.length){var zb=ob.charAt(rb);if(cc&&zb===cc){rb++;                    if(!xb())throw new Error("Syntax error in pattern "+ob);break;}
else if(!cc&&zb===']'){yb.value=yb.value.z_trim();break;}
else{yb.value+=zb;rb++;}}}
if(ob.charAt(rb)!=']')throw new Error("Syntax error in pattern "+ob);rb++;return yb;}
function vb(yb){return(yb>=0x61&&yb<=0x7A)||(yb>=0x41&&yb<=0x5A)|| yb===eb ||(yb>=0x30&&yb<=0x39)|| yb===fb;   }
function wb(){var yb='';while(rb<ob.length){var zb=ob.charCodeAt(rb);if(vb(zb)){yb+=ob.charAt(rb);rb++;}
else{break;}}
return yb;}
function xb(){  
while(rb<ob.length){var yb=ob.charCodeAt(rb);if(yb>32)return true;rb++;}
if(rb>=ob.length)return false;}       }})(); });function ZList(a,b){if(this==window){return new ZList(a,b);}
var c=this;c.isTimeframeBound=b;c.foreach=null;c.where=d;c.toArray=m;c.toElementArray=n;c.until=g;c.selectAll=h;c.select=i;c.first=j;c.union=k;c.toList=o;c.execTimeframeFunc=l;    
if(a==null){c.foreach=s;}
else if(a instanceof Z){c.foreach=q;}
else if(typeof a=='function'){c.foreach=a;}
else if(a instanceof Array){c.foreach=r;}
else if(typeof a==='string'){if(a.charAt(0)=='~')c.foreach=p;else {a=Z(a);c.foreach=r;}}
else if(a instanceof Object){c.foreach=p;}
else{throw new Error("Unsupported selector: "+a);}
function d(t){if(typeof t=='function'){return f(t);}
else if(typeof t=='string'){return e(t);}
else{throw new Error('The first parameter should be either a function or a selector pattern.');}}
function e(t){return f(function(v){if(c.isTimeframeBound)v=v.subject();return v.check(t);});}
function f(t){var u=new ZList(function(w){c.foreach(function(y,z){if(t(y))w(y,z);});},c.isTimeframeBound);return u;}
function g(t){var u=new ZList(function(w){c.foreach(function(y,z){var ab=c.isTimeframeBound?y.subject():y;if(t(ab))z.stop=true;else w(y,z);});},c.isTimeframeBound);return u;}
function h(t){var u=new ZList(function(w){c.foreach(function(y,z){if(c.isTimeframeBound)y=y.subject();y.selectAll(t).foreach(function(bb,cb){w(bb,cb);if(cb.stop)z.stop=true;});});},c.isTimeframeBound);return u;}
function i(t){return h(t).first();}
function j(){var t=null;c.foreach(function(v,w){w.stop=true;t=v;});return t;}
function k(t){var u=c;var v=t instanceof ZList?t:new ZList(t);var w=new ZList(function(y){var z={stop:false};function ab(bb,cb){y(bb,cb);if(cb.stop)z.stop=true;}
u.foreach(ab);if(z.stop)return;v.foreach(ab);},c.isTimeframeBound);return w;}
function l(t,u){var v=[];var w=new ZList(v);w.isTimeframeBound=true;c.foreach(function(y){var z=y[u];var ab=z.apply(y,t);v.push(ab);});return w;}
function m(){var t=[];c.foreach(function(v){t.push(v);});return t;}
function n(){var t=m();var u=[];for(var v=0;v<t.length;v++)u[v]=t[v].$;return u;}
function o(){return c;}
function p(t){ZSelect.foreach(a,t);}
function q(t){var u={stop:false}
t(a,u);}
function r(t){var u={stop:false};for(var v=0;v<a.length&&!u.stop;v++){  
var w=a[v];if(!(w instanceof ZTimeframe))w=Z(w);t(w,u);}}
function s(t){}}
Z.timeframeBoundFunctions={'tween':true,'wipe':true,'sleep':true,'timeframe':true};ZList.updatePrototype=function(){Z.foreach(Z.prototype,function(b,c){if(typeof b!=='function')return;ZList.addToPrototype(c,b);});};ZList.addToPrototype=function(a,b){ZList.prototype[a]=function(){var d=arguments;if(Z.timeframeBoundFunctions[a]){this.isTimeframeBound=true;}
if(this.isTimeframeBound){return this.execTimeframeFunc(d,e);}
this.foreach(function(f){b.apply(f,d);});return this;}}
ZList.updatePrototype();Z.prototype.selectAll=function(a){if(typeof a!=='string')throw new Error("Argument 'pattern' is not a string.");return new ZList({pattern:a,root:this});};Z.prototype.select=function(a){if(typeof a!=='string')throw new Error("Argument 'pattern' is not a string.");return ZSelect.select({pattern:a,root:this});};Z.prototype.check=function(a){if(typeof a!=='string')throw new Error("Argument 'pattern' is not a string.");return ZSelect.check(this,a);};Z.prototype.count=function(a){if(typeof a!=='string')throw new Error("Argument 'pattern' is not a string.");return ZSelect.count({pattern:a,root:this});};Z.prototype.union=function(a){return new ZList([this]).union(a);   };Z.prototype.execute=function(a){a(this);}
Z.prototype.toList=function(){return ZList([this]);}
Z.selectAll=function(a){if(typeof a=='string'&&a.charAt(0)!='~'){a='~'+a;}
return ZList(a);}
Z.select=function(a){return ZSelect.select(a);}
Z.check=function(a){return ZSelect.check(a);}
Z.count=function(a){return ZSelect.count(a);}
Z.here=function(){var a=Z.generateID();document.write('<span style="display:none" id="'+a+'"></span>');return Z(a);}
ZTemplate=function(a){this.id=a;this.elm=Z.$(a,true);this.elm.normalize();this.paths={};this.namePaths=[];this.forLabels=[];this.precompile();this.compile();}
ZTemplate.instances={};ZTemplate.get=function(a){var b=ZTemplate.instances[a];if(!b)return ZTemplate.instances[a]=new ZTemplate(a);return b;}
ZTemplate.fillVars=function(a,b){for(var c in b){a['_'+c].text(b[c]);}}
ZTemplate.prototype={_:1,_replaceNamesViaHtml:Z.isIE6()||Z.isIE7(),compile:function(){var a=this.paths;var b=this.namePaths;var c=this.forLabels;var d=function e(f,g){if(!f.getAttribute)return;var h;if(h=f.getAttribute('_id')){if(g)a[h]=g.toArray();Z(f).addClass(h);Z.removeZObjectFromElement(f);}
if(f.name&&g){b.push(g.toArray());}
if(f.htmlFor&&f.tagName==='LABEL'){c.push(g.toArray());}
for(var i=0;i<f.childNodes.length;i++){e(f.childNodes[i],new ZTemplate.Path(g,i));}}(this.elm,null);},precompile:function(){if(this.elm.getAttribute('z_use_shortcuts')=='false')return;this.elm.innerHTML=this._replaceVars(this._replaceVars(this.elm.innerHTML,'$','span'),'#','div');},_replaceVars:function(a,b,c){var d=new RegExp('\\'+b+'[\\w_]+\\'+ b);var e=0;while(e++<1000){var f=d.exec(a);if(!f)break;a=a.slice(0,f.index)+'<'+c+' _id="' +f[0].slice(1,f[0].length-1)+'"></'+c+'>'+a.slice(f.index+f[0].length);}
if(e>=1000)throw 'Overflow in template: too many variables.';return a;},apply:function(a,b){var c=this.elm.cloneNode(true);c.id=Z.ifnot(b,'');c.className=c.getAttribute('_class');var d=Z(c);d.template=this;if(this.elm.id)d.addClass(this.elm.id);d.elms={};var e=null;var f={};for(var g=0;g<this.namePaths.length;g++){if(!e)e=d.getTemplatePrefix();var h=this.namePaths[g];var i=this._walkPath(c,h,f);if(i.type=='radio'&&this._replaceNamesViaHtml){i=this._replaceName(i,e+i.name);this._walkPath(c,h,f,i);}
else i.name=e+i.name;}
for(var b in this.paths){var h=this.paths[b];var i=this._walkPath(c,h,f);d['_'+b]=Z(i);d['$'+b]=i;}
for(var g=0;g<this.forLabels.length;g++){var h=this.forLabels[g];var i=this._walkPath(c,h,f);var j=d['_'+i.htmlFor];if(!j)continue;if(!j.elm.id)j.elm.id=Z.generateID();i.htmlFor=j.elm.id;}
if(a)ZTemplate.fillVars(d,a);d.templateNamePrefix=e?e:'';return d;},_replaceName:function(a,b){var c='<input type="radio" name="'+b+'" />';var d=document.createElement('span');d.innerHTML=c;for(var e=0,f=d.childNodes;e<f.length;e++)if(f[e].nodeType==1)d=f[e];for(var e=0;e<a.attributes.length;e++){var g=a.attributes[e];if(!g.specified||g.name=='type'||g.name=='name'||g.name=='z')continue;d.setAttribute(g.name,g.value);if(g.name=='class')d.className=g.value;}
a.parentNode.insertBefore(d,a);a.parentNode.removeChild(a);return d;},_walkPath:function(a,b,c,d){var e=a;var f='';for(var g=0;g<b.length;g++){var h=b[g];f+=h+'_';var i=c[f];e=i?i:(c[f]=e.childNodes[h]);}
if(d)c[f]=d;return e;}}
ZTemplate.Path=function(a,b){this.parent=a;this.index=b;this.toArray=function(){var d=[];var e=this;while(e!=null){d.push(e.index);e=e.parent;}
return d.reverse();}}
ZTemplate.apply=function(a,b,c,d){var e=ZTemplate.get(a);if(!e)throw 'ZTemplate'+a+" doesn't exist.";var f=e.apply(d);f.data=c;if(b)Z.$(b).appendChild(f.elm);return f;}
ZTemplate.create=function(a,b,c){if(Z.$(b))return ZTemplate.get(b);var d=Z.create('div').addClass('z_hidden').html(a);d.elm.id=b||Z.generateID();Z(document.body).append(d,true);if(c)Z.addCss(c,true);Z.removeZObjectFromElement(d.elm);return ZTemplate.get(d.elm.id);}

