
// Start of section generated by a Tridion component template, based on the system configuration
var config = {
	i8n : {
		top : 'Oben',
		print : 'Print'
	
		}
};
//End section

// minification of r1445 of line 1-107 of plugin code from utility.js from lib
(function(b){function k(a){var c={},d,e;b((a||"").split(" ")).each(function(b,a){d=a.split("-");e=d.shift();c[e]=d.join("-")});return c}b.plugin=function(a){var a=b.extend(!0,{},b.plugin.defaults,a),c=a.name;b.fn[c]=function(){var d=a.create;a.methods[arguments[0]]&&(d=Array.prototype.shift.call(arguments));arguments[0]&&typeof arguments[0]!=="object"&&b.error("Method "+arguments[0]+" does not exist for plugin '"+c+"' or plugin options were not passed as an object.");var e=[b.extend(!0,{plugin:c}, b.fn[c].defaults,arguments[0])];return this.each(function(){var g=b(this),h=g.data(c),i=g.attr("class"),f=a.parse,j={},i=k(i);for(optionName in f)i[optionName]&&(j[f[optionName]]=i[optionName]);f=e.concat(j).concat(Array.prototype.slice.call(arguments,1));if(d==a.create&&h||d==a.destroy&&!h)return this;d==a.create&&!h&&g.data(c,{target:g,name:c});f=a.methods[d].apply(g,f);d==a.destroy&&h&&g.removeData(c);return typeof f==="undefined"?this:f})};b.fn[c].defaults=a.defaults||{};b.fn[c].on=a.on;b(document).ready(function(){var a= b.fn[c].on;if(typeof a==="string")b(a)[c]();else for(var e in a)b(e)[c](a[e])})};b.plugin.defaults={name:"myPlugin",create:"init",destroy:"destroy",defaults:{},parse:{},methods:{init:function(){},destroy:function(){}},on:{}};b.plugins=function(a){for(var c in a){var d=a[c];d.name=c;b.plugin(d)}}})(jQuery);

/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
//ColorBox v1.3.18 - a full featured, light-weight, customizable lightbox based on jQuery 1.3+
//Copyright (c) 2011 Jack Moore - jack@colorpowered.com
//Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
(function(a,b,c){function Y(c,d,e){var g=b.createElement(c);return d&&(g.id=f+d),e&&(g.style.cssText=e),a(g)}function Z(a){var b=y.length,c=(Q+a)%b;return c<0?b+c:c}function $(a,b){return Math.round((/%/.test(a)?(b==="x"?z.width():z.height())/100:1)*parseInt(a,10))}function _(a){return K.photo||/\.(gif|png|jpe?g|bmp|ico)((#|\?).*)?$/i.test(a)}function ba(){var b;K=a.extend({},a.data(P,e));for(b in K)a.isFunction(K[b])&&b.slice(0,2)!=="on"&&(K[b]=K[b].call(P));K.rel=K.rel||P.rel||"nofollow",K.href=K.href||a(P).attr("href"),K.title=K.title||P.title,typeof K.href=="string"&&(K.href=a.trim(K.href))}function bb(b,c){a.event.trigger(b),c&&c.call(P)}function bc(){var a,b=f+"Slideshow_",c="click."+f,d,e,g;K.slideshow&&y[1]?(d=function(){F.text(K.slideshowStop).unbind(c).bind(j,function(){if(Q<y.length-1||K.loop)a=setTimeout(W.next,K.slideshowSpeed)}).bind(i,function(){clearTimeout(a)}).one(c+" "+k,e),r.removeClass(b+"off").addClass(b+"on"),a=setTimeout(W.next,K.slideshowSpeed)},e=function(){clearTimeout(a),F.text(K.slideshowStart).unbind([j,i,k,c].join(" ")).one(c,function(){W.next(),d()}),r.removeClass(b+"on").addClass(b+"off")},K.slideshowAuto?d():e()):r.removeClass(b+"off "+b+"on")}function bd(b){if(!U){P=b,ba(),y=a(P),Q=0,K.rel!=="nofollow"&&(y=a("."+g).filter(function(){var b=a.data(this,e).rel||this.rel;return b===K.rel}),Q=y.index(P),Q===-1&&(y=y.add(P),Q=y.length-1));if(!S){S=T=!0,r.show();if(K.returnFocus)try{P.blur(),a(P).one(l,function(){try{this.focus()}catch(a){}})}catch(c){}q.css({opacity:+K.opacity,cursor:K.overlayClose?"pointer":"auto"}).show(),K.w=$(K.initialWidth,"x"),K.h=$(K.initialHeight,"y"),W.position(),o&&z.bind("resize."+p+" scroll."+p,function(){q.css({width:z.width(),height:z.height(),top:z.scrollTop(),left:z.scrollLeft()})}).trigger("resize."+p),bb(h,K.onOpen),J.add(D).hide(),I.html(K.close).show()}W.load(!0)}}var d={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:!1,returnFocus:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:undefined},e="colorbox",f="cbox",g=f+"Element",h=f+"_open",i=f+"_load",j=f+"_complete",k=f+"_cleanup",l=f+"_closed",m=f+"_purge",n=a.browser.msie&&!a.support.opacity,o=n&&a.browser.version<7,p=f+"_IE6",q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X="div";W=a.fn[e]=a[e]=function(b,c){var f=this;b=b||{},W.init();if(!f[0]){if(f.selector)return f;f=a("<a/>"),b.open=!0}return c&&(b.onComplete=c),f.each(function(){a.data(this,e,a.extend({},a.data(this,e)||d,b)),a(this).addClass(g)}),(a.isFunction(b.open)&&b.open.call(f)||b.open)&&bd(f[0]),f},W.init=function(){if(!r){if(!a("body")[0]){a(W.init);return}z=a(c),r=Y(X).attr({id:e,"class":n?f+(o?"IE6":"IE"):""}),q=Y(X,"Overlay",o?"position:absolute":"").hide(),s=Y(X,"Wrapper"),t=Y(X,"Content").append(A=Y(X,"LoadedContent","width:0; height:0; overflow:hidden"),C=Y(X,"LoadingOverlay").add(Y(X,"LoadingGraphic")),D=Y(X,"Title"),E=Y(X,"Current"),G=Y(X,"Next"),H=Y(X,"Previous"),F=Y(X,"Slideshow").bind(h,bc),I=Y(X,"Close")),s.append(Y(X).append(Y(X,"TopLeft"),u=Y(X,"TopCenter"),Y(X,"TopRight")),Y(X,!1,"clear:left").append(v=Y(X,"MiddleLeft"),t,w=Y(X,"MiddleRight")),Y(X,!1,"clear:left").append(Y(X,"BottomLeft"),x=Y(X,"BottomCenter"),Y(X,"BottomRight"))).find("div div").css({"float":"left"}),B=Y(X,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),a("body").prepend(q,r.append(s,B)),L=u.height()+x.height()+t.outerHeight(!0)-t.height(),M=v.width()+w.width()+t.outerWidth(!0)-t.width(),N=A.outerHeight(!0),O=A.outerWidth(!0),r.css({"padding-bottom":L,"padding-right":M}).hide(),G.click(function(){W.next()}),H.click(function(){W.prev()}),I.click(function(){W.close()}),J=G.add(H).add(E).add(F),q.click(function(){K.overlayClose&&W.close()}),a(b).bind("keydown."+f,function(a){var b=a.keyCode;S&&K.escKey&&b===27&&(a.preventDefault(),W.close()),S&&K.arrowKey&&y[1]&&(b===37?(a.preventDefault(),H.click()):b===39&&(a.preventDefault(),G.click()))})}},W.remove=function(){r.add(q).remove(),r=null,a("."+g).removeData(e).removeClass(g)},W.position=function(a,b){function g(a){u[0].style.width=x[0].style.width=t[0].style.width=a.style.width,C[0].style.height=C[1].style.height=t[0].style.height=v[0].style.height=w[0].style.height=a.style.height}var c=0,d=0,e=r.offset();z.unbind("resize."+f),r.css({top:-99999,left:-99999}),K.fixed&&!o?r.css({position:"fixed"}):(c=z.scrollTop(),d=z.scrollLeft(),r.css({position:"absolute"})),K.right!==!1?d+=Math.max(z.width()-K.w-O-M-$(K.right,"x"),0):K.left!==!1?d+=$(K.left,"x"):d+=Math.round(Math.max(z.width()-K.w-O-M,0)/2),K.bottom!==!1?c+=Math.max(z.height()-K.h-N-L-$(K.bottom,"y"),0):K.top!==!1?c+=$(K.top,"y"):c+=Math.round(Math.max(z.height()-K.h-N-L,0)/2),r.css({top:e.top,left:e.left}),a=r.width()===K.w+O&&r.height()===K.h+N?0:a||0,s[0].style.width=s[0].style.height="9999px",r.dequeue().animate({width:K.w+O,height:K.h+N,top:c,left:d},{duration:a,complete:function(){g(this),T=!1,s[0].style.width=K.w+O+M+"px",s[0].style.height=K.h+N+L+"px",b&&b(),setTimeout(function(){z.bind("resize."+f,W.position)},1)},step:function(){g(this)}})},W.resize=function(a){S&&(a=a||{},a.width&&(K.w=$(a.width,"x")-O-M),a.innerWidth&&(K.w=$(a.innerWidth,"x")),A.css({width:K.w}),a.height&&(K.h=$(a.height,"y")-N-L),a.innerHeight&&(K.h=$(a.innerHeight,"y")),!a.innerHeight&&!a.height&&(A.css({height:"auto"}),K.h=A.height()),A.css({height:K.h}),W.position(K.transition==="none"?0:K.speed))},W.prep=function(b){function g(){return K.w=K.w||A.width(),K.w=K.mw&&K.mw<K.w?K.mw:K.w,K.w}function h(){return K.h=K.h||A.height(),K.h=K.mh&&K.mh<K.h?K.mh:K.h,K.h}if(!S)return;var c,d=K.transition==="none"?0:K.speed;A.remove(),A=Y(X,"LoadedContent").append(b),A.hide().appendTo(B.show()).css({width:g(),overflow:K.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(t),B.hide(),a(R).css({"float":"none"}),o&&a("select").not(r.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(k,function(){this.style.visibility="inherit"}),c=function(){function q(){n&&r[0].style.removeAttribute("filter")}var b,c,g=y.length,h,i="frameBorder",k="allowTransparency",l,o,p;if(!S)return;l=function(){clearTimeout(V),C.hide(),bb(j,K.onComplete)},n&&R&&A.fadeIn(100),D.html(K.title).add(A).show();if(g>1){typeof K.current=="string"&&E.html(K.current.replace("{current}",Q+1).replace("{total}",g)).show(),G[K.loop||Q<g-1?"show":"hide"]().html(K.next),H[K.loop||Q?"show":"hide"]().html(K.previous),K.slideshow&&F.show();if(K.preloading){b=[Z(-1),Z(1)];while(c=y[b.pop()])o=a.data(c,e).href||c.href,a.isFunction(o)&&(o=o.call(c)),_(o)&&(p=new Image,p.src=o)}}else J.hide();K.iframe?(h=Y("iframe")[0],i in h&&(h[i]=0),k in h&&(h[k]="true"),h.name=f+ +(new Date),K.fastIframe?l():a(h).one("load",l),h.src=K.href,K.scrolling||(h.scrolling="no"),a(h).addClass(f+"Iframe").appendTo(A).one(m,function(){h.src="//about:blank"})):l(),K.transition==="fade"?r.fadeTo(d,1,q):q()},K.transition==="fade"?r.fadeTo(d,0,function(){W.position(0,c)}):W.position(d,c)},W.load=function(b){var c,d,e=W.prep;T=!0,R=!1,P=y[Q],b||ba(),bb(m),bb(i,K.onLoad),K.h=K.height?$(K.height,"y")-N-L:K.innerHeight&&$(K.innerHeight,"y"),K.w=K.width?$(K.width,"x")-O-M:K.innerWidth&&$(K.innerWidth,"x"),K.mw=K.w,K.mh=K.h,K.maxWidth&&(K.mw=$(K.maxWidth,"x")-O-M,K.mw=K.w&&K.w<K.mw?K.w:K.mw),K.maxHeight&&(K.mh=$(K.maxHeight,"y")-N-L,K.mh=K.h&&K.h<K.mh?K.h:K.mh),c=K.href,V=setTimeout(function(){C.show()},100),K.inline?(Y(X).hide().insertBefore(a(c)[0]).one(m,function(){a(this).replaceWith(A.children())}),e(a(c))):K.iframe?e(" "):K.html?e(K.html):_(c)?(a(R=new Image).addClass(f+"Photo").error(function(){K.title=!1,e(Y(X,"Error").text("This image could not be loaded"))}).load(function(){var a;R.onload=null,K.scalePhotos&&(d=function(){R.height-=R.height*a,R.width-=R.width*a},K.mw&&R.width>K.mw&&(a=(R.width-K.mw)/R.width,d()),K.mh&&R.height>K.mh&&(a=(R.height-K.mh)/R.height,d())),K.h&&(R.style.marginTop=Math.max(K.h-R.height,0)/2+"px"),y[1]&&(Q<y.length-1||K.loop)&&(R.style.cursor="pointer",R.onclick=function(){W.next()}),n&&(R.style.msInterpolationMode="bicubic"),setTimeout(function(){e(R)},1)}),setTimeout(function(){R.src=c},1)):c&&B.load(c,K.data,function(b,c,d){e(c==="error"?Y(X,"Error").text("Request unsuccessful: "+d.statusText):a(this).contents())})},W.next=function(){!T&&y[1]&&(Q<y.length-1||K.loop)&&(Q=Z(1),W.load())},W.prev=function(){!T&&y[1]&&(Q||K.loop)&&(Q=Z(-1),W.load())},W.close=function(){S&&!U&&(U=!0,S=!1,bb(k,K.onCleanup),z.unbind("."+f+" ."+p),q.fadeTo(200,0),r.stop().fadeTo(300,0,function(){r.add(q).css({opacity:1,cursor:"auto"}).hide(),bb(m),A.remove(),setTimeout(function(){U=!1,bb(l,K.onClosed)},1)}))},W.element=function(){return a(P)},W.settings=d,a("."+g,b).live("click",function(a){a.which>1||a.shiftKey||a.altKey||a.metaKey||(a.preventDefault(),bd(this))}),W.init()})(jQuery,document,this);
/**
 * Reusable ABN AMRO plugins
 */

(function($) {
	/**
	 * Adds odd, even, first and last classes to appropriate table and list descendants.
	 */
	$.plugin({
		name : 'decorate',
		methods : {
			init : function(options) {
				if(options.even) $('tr:odd, td:odd, li:odd', this).addClass(options.evenClass); // zero based, so odd and even are switched
				if(options.odd) $('tr:even, td:even, li:even', this).addClass(options.oddClass);
				if(options.first) $('tr:first-child, td:first-child, th:first-child, li:first-child', this).addClass(options.firstClass);
				if(options.last) $('tr:last-child, td:last-child, th:last-child, li:last-child', this).addClass(options.lastClass);
				return this;
			}
		},
		defaults : {
			even : true, odd : true, first : true, last : true,
			evenClass : 'even', oddClass : 'odd', firstClass : 'first', lastClass : 'last'
		}
	});

	/**
	 * Open link in a new window.
	 * r2244 from lib
	 */
	$.plugin({
		name : 'newWindow', // This will be the name of the plugin, the plugin can later be accessed using $(selector).newWindow();
		defaults : {	// These will be the default options for this plugin if no other options are passed as an argument
									// Note that defaults can also be overwritten later on, e.g. $.fn.newWindow.defaults.width = 800; to change the width for popup
									// windows
			name : null,
			openClass : 'open', // Class added to the link when the window is open
			windowFeatures : {} // features such as width and height, in normal object notation, e.g. {width : 800, height : 200}
		},
		methods : {	// Methods are called on all selected elements, e.g. for $('a').newWindow(); the init method will be called 
								// with this referring to the jQuery extended link element.
			init : function(options) {	// The init method is the default method of the plugin and is called when the plugin is
																	// executed without a method string: $(selector).newWindow();
				if(this.attr('href')) {
					var self = this;
					// Bind event handlers to the plugin namespace
					this.bind('click.' + options.plugin, function(event) {	// The plugin name is added to the options object, which we use
																																	// here for namespacing the click events
						// @todo: move code generic to all elements, like 'features' code, to a 'setup' function?
						var features = [];
						for(var feature in options.windowFeatures) {
							features[features.length] = feature + '=' + options.windowFeatures[feature];
						}
						var newWindow = self.data('newWindow').window;
						if(!newWindow || newWindow.closed) {
							newWindow = window.open(self[0].href, options.name || '_blank', features.join());
							if(options.openClass) self.addClass(options.openClass);
							// There is no 'window.onclose' event, unload will fire too often and there is no reliable way of checking the window 
							// is closed in the onload, even after a timeout in the onload
							var intervalId = setInterval(function() {
								if(newWindow.closed) {
									if(options.openClass) self.removeClass(options.openClass);
									clearInterval(intervalId);
								}
							}, 100);
							self.data('newWindow', {'window' : newWindow});
						}
						newWindow.focus();
						event.preventDefault();
					});
				}
			}, // @todo: add data comment
			destroy : function(options) {	// Most plugins should have a destroy method for removing plugin functionality from elements
				this.unbind('.' + options.plugin); // Unbind all handlers for this plugin, regardless of type
			}
		},
		on : {	// The plugin will be initialised on these selectors, note that a plugin can be initialised using $(selector).newWindow();
			'a.new-window' : {
				windowFeatures : {}
			} // The object value contains the options that are passed to the plugin init method for these elements
		}
	});

	
	/**
	 * Shows images in a slide show
	 */
	$.plugin({
		name : 'slideShow',
		defaults : {
			transitionDuration : 3200,
			slideFilter : 'li, div', // what child elements should become slides
			easing : '',
			showTime : 8000,
			slideNr : 0,
			controls : {
				slideButtons : true,
				playPause : false // Not implemented
			}
		},
		methods : {
			init : function(options) {
				this.addClass('slide-show').children(options.slideFilter).addClass('slide')
					.eq(options.slideNr).siblings(options.slideFilter).hide();
				$.extend(this.data('slideShow'), {
					currentSlideNr : options.slideNr,
					playFunctionId : 0
				});
				if(options.controls.slideButtons) {
					var
						self = this,
						controls = $('<ul class="slide-controls nav">');
					this.children('.slide').each(function(index) {
						$('<li>').append($('<a>').attr('href', '#'))
							.click(function(event) {
								event.preventDefault();
								self.slideShow('show', $.extend(true, options, {slideNr : index})).slideShow('stop', options);
							})
							.addClass(index==options.slideNr ? 'current' : '').appendTo(controls);
					});
					this.data('slideShow').controls = controls.insertAfter(this);
				}
				this.slideShow('play', options);
			},
			show : function(options) {
				var slides = this.children(options.slideFilter);
				var slideNr = options.slideNr % slides.length;
				if(slideNr!==this.data('slideShow').currentSlideNr) {
					slides.eq(slideNr).stop(true).fadeTo(options.transitionDuration, 1, options.easing);
					slides.eq(this.data('slideShow').currentSlideNr).stop(true).fadeOut(options.transitionDuration, options.easing);
					this.data('slideShow').controls.children().removeClass('current').eq(slideNr).addClass('current');
					this.data('slideShow').currentSlideNr = slideNr;
				}
			},
			next : function(options) {
				var options = $.extend(true, options, {slideNr : this.data('slideShow').currentSlideNr + 1});
				this.slideShow('show', options);
			},
			play : function(options) {
				var self = this;
				this.slideShow('stop'); // Stop any previous play functions
				this.data('slideShow').playFunctionId = setTimeout(function() {
					self.slideShow('next', options).slideShow('play', options);
				}, options.showTime);
			},
			stop : function(options) {
				clearTimeout(this.data('slideShow').playFunctionId);
			}
		},
		on : '.slide-show'
	});

	/**
	 * dropdown
	 * Instantiates a dropdown on an ul or an element with an ul descendant
	 * The ul will be wrapped in a div if the elment is an ul
	 * If no trigger is provided, the trigger will be created from the contents of li.active
	 */
	$.plugin({
		name : 'dropdown',
		defaults : {
			dropdownClass : 'dropdown',
			disableForSingleOption : false, // If this is true, a dropdown with only one option will be disabled, 
																			// the trigger class will be 'disabled-trigger'
			triggerSelector : '.active > *',
			hiddenCSS : {
				height : 0,
				paddingTop : 0,
				paddingBottom : 0
			}
		},
		methods : {
			init : function(options) {
				var dropdown, list, trigger, self = this;
				if(this.tagName=='UL' || this.tagName=='OL') {
					// If this is a list, we create a div wrapper
					list = this;
				} else {
					// This is not a list, so wrap all children so we have a container to hide these children
					list = this.children().wrapAll('<div></div>').parent('div');
				}
				dropdown = list.addClass('dropdown-list').wrap('<div></div>').parent('div').addClass(options.dropdownClass);
				trigger = $(options.triggerSelector, list);
				trigger = trigger.length ? trigger : $(':first > *', list); // Fallback if no trigger found
				trigger = trigger.clone().wrapInner('<a href="#"></a>').prependTo(dropdown);
				$.extend(this.data('dropdown'), {
					dropdown : dropdown,
					list : list,
					trigger : trigger,
					toListHeight : list.height(),
					toPaddingTop : list.css('paddingTop'),
					toPaddingBottom : list.css('paddingBottom')
				});
				var mouseover = false;
				list.css(options.hiddenCSS).appendTo('body')
					.mouseover(function() {mouseover = true;})
					.mouseout(function() {mouseover = false;})
					.click(function() {self.dropdown('collapse');});
				trigger
					.addClass('trigger')
					.click(function(event) {
						event.preventDefault();
						event.stopPropagation();
						self.dropdown(dropdown.is('.has-active-dropdown') ? 'collapse' : 'expand');
					})
					.find('a').blur(function() {
						if(mouseover) return false; else self.dropdown('collapse');
					})
				;
				if(options.disableForSingleOption && $('li', list).length==1) this.dropdown('disable');
				return this;
			},
			expand : function(options) {
				var data = this.data('dropdown');
				var
					dropdown = data.dropdown,
					list = data.list,
					trigger = data.trigger;
				list.css('top', trigger.offset().top - $(document).scrollTop() + trigger.outerHeight() -1 + 'px');
				list.css('left', trigger.offset().left + 'px');
				dropdown.addClass('has-active-dropdown').add(trigger).add(list).addClass('hover');
				list.animate({
					height : data.toListHeight,
					paddingTop : data.toPaddingTop,
					paddingBottom : data.toPaddingBottom
				}, 100);
			},
			collapse : function(options) {
				var data = this.data('dropdown');
				var
					dropdown = data.dropdown,
					list = data.list,
					trigger = data.trigger;
				list.animate(options.hiddenCSS, 100, function() {
					list.clearQueue();
					dropdown.removeClass('has-active-dropdown').add(trigger).add(list).removeClass('hover');
				});
			},
			disable : function(options) {
				var data = this.data('dropdown');
				data.dropdown.addClass('disabled');
				data.trigger.replaceWith($('<span></span>').html(data.trigger.html()).addClass('trigger')); // replace a with span
			}
		},
		on : '.dropdown'
	});

})(jQuery);

(function($) {
	/**
	 * Set the active and selected state of links.
	 * 
	 * Note that the generated HTML should ideally be rendered by the server.
	 */
	$.fn.active = function(options) {
		var options = $.extend(true, {}, $.fn.active.defaults, options);
		
		if(typeof options.ignore == 'function') options.ignore = options.ignore();
		var ignoreExp = new RegExp('\/(' + options.ignore.join('|') + ')(?=\/)', 'g');
		/**
		 * Removes all ignore (edition) segments. Used for ignoring editions in url's.
		 */
		function stripIgnoreFolders(url) {
			return url.replace(/\\/g, '/').replace(ignoreExp, '');
		}
		// Keep the original path
		var originalPath = options.path;
		// Ignore edition folders when determining active state of links
		options.path = stripIgnoreFolders(options.path);
		
		function normalizeQuery(query) {
			return (query.indexOf('?')===0 ? query.substring(1) : query).replace('&amp;', '&').split('&').sort().join('&');
		}

		function isSameQuery(query1, query2) {
			if(query1==query2) return true;
			return normalizeQuery(query1)===normalizeQuery(query2);
		}

		/**
		 * Removes all relative location steps from the path
		 */
		function sanePathName(url, base) {
			// @todo: default value for base
			var locationSteps = url.split('/');
			if(url.indexOf('/')!==0) {
				// This is not an absolute url, so append the base
				var baseLocationSteps = base.split('/');
				baseLocationSteps.pop(); // remove the filename, if the base ends in a '/', the filename will be ''
				locationSteps = baseLocationSteps.concat(locationSteps);
			}
			var saneSteps = [];
			for(var intStepCtr in locationSteps) {
				var locationStep = locationSteps[intStepCtr];
				if(locationStep=='..') {
					if(saneSteps.length) saneSteps.pop();
				} else if (locationStep=='.') {
					// do nothing
				} else {
					saneSteps[saneSteps.length] = locationStep; 
				}
			}
			url = saneSteps.join('/');
			return url;
		}

		return this.filter('a').each(function() {
			var $this = $(this);
			var linkPathName = this.pathname.replace(/\\/g, '/'); // Strip editions
			linkPathName = linkPathName =='' ? sanePathName($this.attr('href'), originalPath.replace(/\\/g, '/')) : linkPathName;
				// IE6 does not set pathname for injected links,
				// so we build it ourselves from the href 
			if(linkPathName.indexOf('..')!==-1) linkPathName = sanePathName(linkPathName, originalPath);
				// IE7 and 8 keep relative links for the pathname, so we sanitize it
			linkPathName = linkPathName.indexOf('/')===0 ? linkPathName : '/' + linkPathName; // Add first slash for IE and Opera
			linkPathName = stripIgnoreFolders(linkPathName); // Now strip any edition segments from the path, thus ignoring the edition when comparing paths
			var linkLocationPaths = linkPathName.split('/');
			var linkFile = linkLocationPaths.pop();
			var linkDirectory = linkLocationPaths.join('/');
			if ((linkDirectory.lastIndexOf('/') + 1)!=linkDirectory.length) linkDirectory += '/'; // Add trailing slash if not present
			if (
				this.hostname==options.host && 
				options.path.indexOf(linkDirectory)===0 &&
				(linkFile=='index.html' || linkFile=='' || linkPathName==options.path)
			) {
				if($this.attr('href').indexOf('#')==-1) { // Skip urls with hashes
					options.active.call($this);
					if((linkPathName==options.path || (linkDirectory + 'index.html')==options.path) && isSameQuery(options.query, this.search)) {
						options.selected.call($this);
					}
				}
			}
		});
	}

	/**
	 * @param ignore list of location steps to ignore from the path (only if the string is the entire folder is it ignored, 
	 * i.e. /foo/bar/lorem, with 'bar' part of the ignore list will ignore bar, but with (only) 'ba', bar is not ignored.
	 * Note that the file (lorem) will never be ignored.
	 * If ignore is a function, the return value of the function will be used.
	 */
	$.fn.active.defaults = {
		path : document.location.pathname,
		host : document.location.hostname,
		ignore : [],
		query : document.location.search,
		// Action for links that completely match options.path
		selected : function() {
			this.wrapInner('<strong>');
			if(this.parent('li').length) {
				this.parent('li').addClass('selected');
			} else {
				this.addClass('selected');
			}
			return this;
		},
		// Action for links that are within the 'folder' of options.path, e.g. a link to nieuws/index.html will
		// be active if options.path is nieuws/particulieren/index.html
		active : function() {
			if(this.parent('li').length) {
				this.parent('li').addClass('active');
			} else {
				this.addClass('active');
			}
			return this;
		}
	}
	
	$.extend(true, $.fn.newWindow.on, {
		'.application, .aside .button' : {
			windowFeatures : {
				height:600,
				width:800,
				toolbar:'no',
				location:'no',
				directories:'no',
				status:'yes',
				menubar:'no',
				scrollbars:'no',
				copyhistory:'no',
				resizable:'yes'
			}
		},
		'a[href^="http"], a[href^="https"]' : {
			windowFeatures : {}
		}
	});
})(jQuery);

/*** scrollHashLinks
/ Scroll the page to the location of a hashlink in stead of directly jumping to it (normal browser behaviour)
***/
function scrollHashLinks () {
	var scrollLinks = $("a[href^='#']");
	var base = this;
	for (var i=0; i < scrollLinks.length; i++) {
		if ($(scrollLinks[i]).attr('href').length > 1) {
			var idLink = $(scrollLinks[i]).attr('href').substr(1);
			if($('#' + idLink).length > 0) {
				var targetOffset = $('#' + idLink).offset().top;
				scrollLinks[i].myOffset = targetOffset;
				$(scrollLinks[i]).click(function(event){
					base.scrollPage(this.myOffset - 105);
					event.preventDefault();
				});
			}
		}
	}
};

scrollHashLinks.prototype.scrollPage = function (offset) {
	$('html,body').animate({scrollTop: offset}, {duration: 600, easing: 'easeOutQuad'});
};


/**
 * Initialize the page, adding behaviour to various elements.
 */
jQuery(function($) {
	var isHomepage = $('html').hasClass('home'), // whether we are on the homepage
		isNOBC = !!$('head link[href$="neuflize-obc.css"]').length; // whether this is NOBC

	$('a').active(); // Give all links that refer to the current file or folder a selected or active class
	// Enable or disable the search submit button depending on entered search value
	$('#query').keyup(function() {
		if($.trim(this.value)=='') {
			$('input[type=submit]', this.form).attr('disabled', 'disabled');
		} else {
			if($.trim(this.value)!='') $('input[type=submit]', this.form).removeAttr('disabled');
		}
	});
	// @TODO: refactor toolbar
	if(!isHomepage) {
		$('<li><a class="print" href="#" title="' + config.i8n.print + '">' + config.i8n.print + '</a></li>').prependTo('.toolbar ul').find('a').click(
			function(event) {
				event.preventDefault();
				print();
			}
		);
		var minFontSize = 11;
		var fontSize = minFontSize;
		$('<li><a class="larger-fontsize" href="#">Larger</a></li>').insertAfter($('.toolbar .share').parent())
			.find('a').click(
				function(event) {
					event.preventDefault();
					fontSize++;
					$('body > .content .content').css('font-size', fontSize);
				}
		);
		$('<li><a class="smaller-fontsize" href="#">Smaller</a></li>').insertAfter($('.toolbar .share').parent()).after(' ')
			.find('a').click(
				function(event) {
					event.preventDefault();
					if(fontSize > minFontSize) fontSize--;
					$('body > .content .content').css('font-size', fontSize);
				}
		);
	}
	$('table, ul').decorate(); // Add first, last, even and odd classes
	// Sidebar download and links dropdown
	$('.aside h2').each(function() {
		var sectionDropdownTitles = $(this).nextUntil('h2', 'h3.download, h3.web');
		sectionDropdownTitles
			.wrapInner('<span>')
			.each(function() {
				var h3 = $(this);
				var ul = h3.next('ul');
				ul.hide();
				$(this).click(function() {
					if(h3.hasClass('active')) {
						h3.removeClass('active');
						ul.slideUp(500, 'easeOutQuad');
					} else {
						h3.addClass('active').siblings().removeClass('active');
						ul.slideDown(500, 'easeOutQuad').siblings('ul').hide();
					}
				})
			})
			.next('ul').andSelf().wrapAll('<div class="tabs">');
		// Move titles next to eachother
		sectionDropdownTitles.filter('.download').after(sectionDropdownTitles.filter('.web'));
	});
	if($.browser.msie) {
		var inputs = $('input');
		if($.browser.version=='6.0' || $.browser.version=='7.0') {
			inputs.focus(function() {$(this).addClass('focus')}).blur(function() {$(this).removeClass('focus')});
			if($.browser.version=='6.0') {
				// Workaround for lack of attribute selectors in IE6: type is added as class
				inputs.each(function() {
					var $this = $(this);
					$this.addClass($this.attr('type'));
				});
			}
		}
		if($.browser.version=='7.0') {
			$('.aside blockquote a, a.more').append('<span class="more"></span>');
			$('.content .video h3 a, .news, .news .abstract h3.video, a[rel=larger]').append('<span class="after"></span>');
			$('.blason').prepend('<span class="before"></span>');
			if (isNOBC){
				$('.content > .content > h1').siblings('img + * + h2').hide();
			}
			(function() {
				var bgFix = $('<div class="bg-fix"></div>');
				function setProperHeight() {
					bgFix.height($(document).height() - 795);
				}
				$(window).resize(setProperHeight);
				$('body > .content').append(bgFix);
				setProperHeight();
			})();
		}  
		if($.browser.version=='8.0') {
			$('.content .video h3 a, a[rel=larger]').append('<span class="after"></span>');
			$('.blason').prepend('<span class="before"></span>');
			if (isNOBC){
				$('.content > .content > h1').siblings('img + * + h2').hide();
			}
		}
	}

	$('.header .region.nav').dropdown({ triggerSelector : 'h2' });
	// TODO: replace with placeholder
	$('.search #query').blur(function() {
		$(this).siblings('.placeholder').toggle(!this.value);
	}).focus(function() {
		$(this).siblings('.placeholder').hide();
	}).siblings('.placeholder').toggle(!$('.search #query').val());
	$('hr').wrap('<div class="hr"></div>'); // enable uniform styling across browsers
	var slideShows = $('.home .content .content > ul').slideShow().add($('.home .news.abstracts').slideShow({
		transitionDuration : 400
	}));
	$('.slide-controls li').click(function() {slideShows.slideShow('stop')});
	var currentWorldmap;
	$('#worldmap-map area')
		.mouseover(function() {
			currentWorldmap = $('.' + $(this).attr('id')).show();
			$('.worldmap-default').hide();
		})
		.mouseout(function() {
			currentWorldmap.hide();
			$('.worldmap-default').show();
		});
	$('body > .content > .nav li.active').addClass('closed')
		.filter('.selected').children('a').click(function(event) {
			event.preventDefault();
		})
		.end().end().has('li').removeClass('closed')
		.children('ul').not(':has(.active)').slideUp(0).slideDown(500, 'easeOutQuad');
	$('object.flash').each(function(index) {
		var id = 'flash-' + index;
		$(this).attr(id);
		swfobject.registerObject(id, "10.0.0", "static/flash/swf/expressInstall.swf");
	});
	$('#colorbox input[type="submit"]').live('click', function(){
		$().colorbox({
			scrolling : false,
			fixed : true,
			opacity : 0.8,
			data : $(this).closest("form").serialize(),
			href : $(this).closest("form").attr('action') + ' .content .content'
		});
		return false;
	}); 	
	$('a.lightbox').click(function() {
		$(this).colorbox({
			scrolling : false,
			fixed : true,
			opacity : 0.2,
			innerWidth: '425px',
			href : $(this).attr('href') + ' .content .content'
		});
	});
	$('a[rel=larger]').click(function() {
		$(this).colorbox({
			rel : 'nofollow',
			scrolling : false,
			fixed : true,
			opacity : 0.2,
			onLoad: function(){
				$("#colorbox").addClass("larger");
			},
			width: '780px',
			href : $(this).attr('href') + ' .content .content'
		});
	});
	$('a.mailto').attr('href', 'mailto: ?subject=' + document.title + '&body=' + location.href);
	
	//Event calendar Neuflize	
	if ($('.events.calendar.neuflize').length) {
		(function() {
			// taken from lib/js/lib/utility.js line 84-96 r1445
			// Translate class string to options
			function classToOptions(cls) {
				var options = {}, nameValue, name, cls = cls || '';
				$(cls.split(' ')).each(function(i, className) {
					nameValue = className.split('-');
					name = nameValue.shift();
					options[name] = nameValue.join('-');
				});
				return options;
			}

			function getNextMonthForHash(currentMonth) {
				var numbers = currentMonth.split('-'),
					year = numbers[0] * 1,
					month = (numbers[1] * 1) - 1,//javascript months go from 0 tp 11
					now = new Date();
				now.setHours(0, 0, 0, 0);
				now.setFullYear(year);
				now.setMonth(month);
				now.setMonth(now.getMonth() + 1);//go to next month				
				var newMonth = now.getMonth() + 1; //human months go to for 1 to 12
				newMonth = newMonth <= 9 ? "0" + newMonth : newMonth;
				var next = '' + now.getFullYear() + '-' + newMonth;
				return next;
			}

			function getPreviousMonthForHash(currentMonth) {
				var numbers = currentMonth.split('-'),
					year = numbers[0] * 1,
					month = (numbers[1] * 1) - 1,//javascript months go from 0 tp 11
					now = new Date();
				now.setHours(0, 0, 0, 0);
				now.setFullYear(year);
				now.setMonth(month);
				now.setMonth(now.getMonth() - 1);//go to previous month
				var newMonth = now.getMonth() + 1; //human months go to for 1 to 12
				newMonth = newMonth <= 9 ? "0" + newMonth : newMonth;
				var previous = '' + now.getFullYear() + '-' + newMonth;
				return previous;
			}

			function getCurrentMonthForHash() {
				var now = new Date();
				now.setHours(0, 0, 0, 0);
				var newMonth = now.getMonth() + 1; //human months go to for 1 to 12
				newMonth = newMonth <= 9 ? "0" + newMonth : newMonth;
				var current = '' + now.getFullYear() + '-' + newMonth;
				return current;
			}
			
			function getCurrentDayAsDateFromDay(currentMonth, clickedDay) {
				var numbers = currentMonth.split('-'),
					year = numbers[0] * 1,
					month = (numbers[1] * 1) - 1,//javascript months go from 0 tp 11
					now = new Date();
				now.setHours(0, 0, 0, 0);
				now.setFullYear(year);
				now.setMonth(month);
				now.setDate(clickedDay);
				return now;
			}

			function getCurrentDayAsDate(currentDate) {
				var numbers = currentDate.split('-'),
					year = numbers[0] * 1,
					month = (numbers[1] * 1) - 1,//javascript months go from 0 tp 11
					day = (numbers[2] * 1),
					now = new Date();
				now.setHours(0, 0, 0, 0);
				now.setFullYear(year);
				now.setMonth(month);
				now.setDate(day);
				return now;
			}

			
			var previousMonthLink = $('.events.calendar.neuflize a.previous'),
				nextMonthLink = $('.events.calendar.neuflize a.next'),
				navMonths = $('.events.calendar.neuflize a.next, .events.calendar.neuflize a.previous'),
				calenderMonthTables = $('.events table'),
				calenderMonthTablesDayLinks = $('.events table a'),
				eventItems = $('.events ul li.event');

			function initCalendar() {
				
				var today  = new Date();
				today.setHours(0, 0, 0, 0);
				var todayDate = today.getDate(), 
					todayMonth = getCurrentMonthForHash();
				
				eventItems.hide();
				calenderMonthTables.each(function(index) {
					var $calenderMonthTable = $(this);
					if ($calenderMonthTable.hasClass("current")) {
						$calenderMonthTable.show();
						//setting next previous links
						var currentMonth = classToOptions($calenderMonthTable.attr('class')).month, 
							nextMonth = getNextMonthForHash(currentMonth), 
							previousMonth = getPreviousMonthForHash(currentMonth);
						
						//setting today class
						if (currentMonth==todayMonth){
							$calenderMonthTable.find('td:not(.not-in-month)').each(function(){ 
								if($(this).text()== todayDate){
									$(this).addClass('today').not(':has(a)').wrapInner('<span></span>');
								}
							});
						}
						
						//getting events for current month
						if (currentMonth == todayMonth){
							var evts = eventItems.each(function() {
								var $eventItem = $(this),
									classOptions = classToOptions($eventItem.attr('class')) ,
									eventFrom = getCurrentDayAsDate(classOptions.from),
									eventTo = getCurrentDayAsDate(classOptions.to);
								if (today >= eventFrom && today <= eventTo) {
									$eventItem.addClass('selected').show();
								}
							});
							//if no events found get closest future event
							if (!$('.events table td.event.selected').length || !$('.events table td.event.selected').length==0){
								var nextFrom, 
									evts = eventItems.each(function() {
									var $eventItem = $(this),
										classOptions = classToOptions($eventItem.attr('class')),
										eventFrom = getCurrentDayAsDate(classOptions.from),
										eventTo = getCurrentDayAsDate(classOptions.to);
									if (!nextFrom && eventFrom.getTime() >= today.getTime() ) {
										$eventItem.addClass('selected').show();
										nextFrom  = eventFrom;
									} else if (nextFrom && nextFrom.getTime()  == eventFrom.getTime()){
										$eventItem.addClass('selected').show();
									}
								});
							}
						}
						
						if ($('.month-' + nextMonth).length) {
							$(nextMonthLink).attr('href', '#month-' + nextMonth).show();
						} else {
							$(nextMonthLink).hide();
						}
						if ($('.month-' + previousMonth).length) {
							$(previousMonthLink).attr('href', '#month-' + previousMonth).show();
						} else {
							$(previousMonthLink).hide();
						}
					} else {
						$calenderMonthTable.hide();
					}
				});
			}

			navMonths.click(function(event) {
				event.preventDefault();
				var $clicked = $(this);
				calenderMonthTables.each(function(index) {
					var $calenderMonthTable = $(this);
					$calenderMonthTable.removeClass('current');
					if ($calenderMonthTable.hasClass($clicked.attr('href').replace(/#/, ""))) {
						$calenderMonthTable.addClass('current');
					} 
					//location.hash = $clicked.attr('href');
				});
				initCalendar();
			});

			calenderMonthTablesDayLinks.click(function(event) {
				event.preventDefault();
				var $clicked = $(this),
					clickedDay = $clicked.text(),
					currentMonth = classToOptions($('.events table.current').attr('class')).month,
					clickedDate = getCurrentDayAsDateFromDay(currentMonth,clickedDay);
				calenderMonthTables.find('td').removeClass('selected');
				$clicked.parent().addClass('selected');
				var evts = eventItems.each(function() {
					var $eventItem = $(this),
						classOptions = classToOptions($eventItem.attr('class')),
						eventFrom = getCurrentDayAsDate(classOptions.from),
						eventTo = getCurrentDayAsDate(classOptions.to);
					if (clickedDate >= eventFrom && clickedDate <= eventTo) {
						$eventItem.addClass('selected').show();
					} else {
						$eventItem.removeClass('selected').hide();
					}
				});
			});
			initCalendar();
		})();
	}
	
	// Event calendar
	if($('.events.calendar').length && !$('.events.calendar.neuflize').hasClass('neuflize')) {
		(function() {
			// taken from lib/js/lib/utility.js line 84-96 r1445
			// Translate class string to options
			function classToOptions(cls) {
				var options = {},
						nameValue,
						name,
						cls = cls || '';
				$(cls.split(' ')).each(function(i, className) {
					nameValue = className.split('-');
					name = nameValue.shift();
					options[name] = nameValue.join('-');
				});
				return options;
			}
	
			var table = $('.events table'),
				yyyymm = classToOptions(table.attr('class')).month.replace(/-/g, ''),
				events = table.next().find('li');
				eventDetails = $('div.events:not(.calendar) .event'),
				hasUpcomingEvents = false;
				
				
			// clicking on links in the table selects the relevant events from the list
			table.find('a').click(function(event) {
				var $this = $(this);
				var day = $this.text();
				var date = yyyymm + (day.length==1 ? '0' + day : day);
				table.find('td').removeClass('selected');
				$this.parent().addClass('selected');
				var evts = events.each(function() {
					var classOptions = classToOptions(this.className);
					var eventDetail = eventDetails.filter($(this).find('a')[0].hash);
					if(date >= classOptions.from.replace(/\-/g, '') && date <= classOptions.to.replace(/\-/g, '')) {
						$(this).addClass('selected');
						eventDetail.show();
					} else {
						$(this).removeClass('selected');
						eventDetail.hide();
					}
				});
				$('.no-upcoming.event').hide();
				location.hash = this.hash;
				event.preventDefault();
			});
			
			events.find('a').click(function(event) {
				table.find('td').removeClass('selected');
				events.removeClass('selected');
				$(this).parent().addClass('selected');
				eventDetails.hide().filter(this.hash).show();
				location.hash = this.hash;
				event.preventDefault();
			});
	
			// Check if the current date is in this month
			var currentDate = new Date(),
				currentMonth = (currentDate.getMonth() + 1) + '',
				currentDay = currentDate.getDate()+ '',
				currentyyyymm = currentDate.getFullYear() + (currentMonth.length==1 ? '0' : '') + currentMonth,
				isCurrentMonth = currentyyyymm==yyyymm;
			if(isCurrentMonth) { // today is part of the month
				// highlight today
				table.find('td:not(.not-in-month)').each(function(){ 
					if($(this).text()== currentDay){
						$(this).addClass('today').not(':has(a)').wrapInner('<span></span>');
					}
				});
				// remove events preceding today from list
				var currentyyyymmdd = currentyyyymm + (currentDay.length==1 ? '0' : '') + currentDay;
				events.each(function() {
					var toDay = classToOptions(this.className).to.replace(/\-/g, '');
					if(toDay < currentyyyymmdd) {
						return $(this).hide();
					} else {
						hasUpcomingEvents = true;
						$(this).find('a').click(); // show upcoming event
						return false;
					}
				});
			} else {
				// show first event of month
				events.first().find('a').click();
			}

			if(hasUpcomingEvents || !isCurrentMonth) {
				// TODO: catch hashchange events for changing selected item?
				events.find('[href$=' + location.hash + ']').click(); // click event if in hash
				table.find('[href$=' + document.location.hash + ']').click() // click date if in hash
			} else {
				eventDetails.hide().parent().append('<div class="no-upcoming event"><h2>' + config.i8n.noUpcomingEvents + '</h2></div>');
			}
		})();
	}
	var animatedHashLinks = new scrollHashLinks();
	if((($(document).height() / $(window).height()) > 1.5) && !isHomepage) { // for sufficient scroll height
		$('body > .content > .content').append($('<a href="#top" class="top"><span>' + config.i8n.top + '</span></a>').click(function(event) {
			event.preventDefault();
			animatedHashLinks.scrollPage(0);
		}));
	}
	if(isHomepage && !isNOBC) {
		(function() {
			var html = $('html'),
				$window = $(window);
			function scrollable() {
				html.toggleClass('scrollable-y', $window.height() < 585);
				//html.toggleClass('scrollable-x', $window.width() < 950);
			}
			$window.resize(scrollable);
			scrollable();
		})();
	}
});

// Different alert messages and labels
var strPhoneLabel = "Phone: *";
var strEmailLabel = "E-mail Address: *";
var errorMsg = "<p class='error'>Ein oder mehrere Felder sind falsch oder leer.</p>";


// Change the label of the textarea as per selected radio input
$('#byemail,#byphone').click(function(){
	$("#phone").val("");
	if ($("#byemail").is(':checked')){
		$("#lblContact").html(strEmailLabel);
		$("#phone").attr("name","E-mail");
		$('input[value="no-reply@nl.abnamro.com"]').remove();
	}
	else{
		$("#lblContact").html(strPhoneLabel);
		$("#phone").attr("name","4#Phone");
		$("#phone").after("<input type='hidden' name='E-mail' value='no-reply@nl.abnamro.com' />");
	}
});
$('#contact').submit(function(){
	var hasError = false;
	if(validateTxtFld('address') == 0 ){
		$('#address').addClass("error");
		hasError = true;
	}
	if(validateTxtFld('zipcode') == 0){
		$('#zipcode').addClass("error");
		hasError = true;
	}
	if(validateTxtFld('city') == 0){
		$('#city').addClass("error");
		hasError = true;
	}
	if($('#nationality').val() == 0){
		$('#nationality').addClass("error");
		hasError = true;
	}
   if(validateTxtFld('name') == 0){
		$('#name').addClass("error");
		hasError = true;
	}
	if(validateTxtFld('lastname') == 0){
		$('#lastname').addClass("error");
		hasError = true;

	}
	if(validateTxtFld('firstname') == 0){
		$('#firstname').addClass("error");
		hasError = true;
	}
	if($('#emailaddress').length > 0 ){
		if(!validateEmailAdd('emailaddress')){
			$('#emailaddress').addClass("error");
			hasError = true;
		}
	}
   if($('#email').length > 0 ){
		if(!validateEmailAdd('email')){
			$('#email').addClass("error");
			hasError = true;
		}
	}
	if($('#contactemail').length > 0 ){
		if(!validateEmailAdd('contactemail')){
			$('#contactemail').addClass("error");
			hasError = true;
		}
	}
	if ($("#byphone").is(':checked')){
		if($.trim($('#phone').val()).length <= 0){
			$('#phone').addClass("error");
			hasError = true;
		}
	}
	else{
		if($('#phone').length > 0 ){
			if(!validateEmailAdd('phone') && $("#byemail").is(':checked')){
				$('#phone').addClass("error");
				hasError = true;
			}
		}
	}
	if(hasError && ($('#contact').find('p[class = error]').length <= 0 )){
		$('#contact').find('input[type=submit]').before(errorMsg);
	}
	return !hasError;
});
$('input,select').focus(function() {
	$(this).removeClass("error");
});

//To append the query parameter 'selectedYear' for PBI news archive list
$('body > .content > .content > .header.newsarchive a').click(function(){
	var year = $(this).text() ;
	$(this).attr('href', window.location.pathname+"?selectedYear="+ year);
});  

//To append the query parameter 'selectedPage' for PBI news archive list	
$('body > .content > .content > .pages.nav.newsarchive a').click(function(){
	var selectedPageNum ;	
	if($(this).attr('class') == 'previous'){
		selectedPageNum = (typeof Request.parameter('selectedPage') !="undefined")?(Request.parameter('selectedPage') - 1):0 ;
	}else if($(this).attr('class') == 'next'){
		selectedPageNum = (typeof Request.parameter('selectedPage') !="undefined")?(parseInt(Request.parameter('selectedPage'))+ 1):2 ;
	}else{
		selectedPageNum = $(this).text() ;
	}
	$(this).attr('href', 'javascript:Request.setRequestParameter("selectedPage",' + selectedPageNum + ')'); 
}) ;

//To validate E-mail field of the form
//Valid e-mail : abc.xyz@abc.com OR abc@abc.com
function validateEmailAdd(fieldId){
	var hasError = false;
	var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
	var emailaddressVal = $('#'+fieldId).val();
	if(emailaddressVal.length > 0 && emailReg.test(emailaddressVal) ){
		hasError = true;
	}
	return hasError;		
}

//To validate text fields of the form
function validateTxtFld(fieldId){
	var iReturn = -1;
	if($('#'+fieldId).length > 0){
		if($.trim($('#'+fieldId).val()).length > 0){
			iReturn = 1;
		}
		else{
			iReturn = 0;
		}
	}
	return iReturn;
}

//To get the request parameters
var Request = {	
	url : window.location.href,
	queryString : window.location.search ,
 	parameter: function(name) {
 		return this.parameters()[name];
 	},
 	parameters: function() {
 		var result = {};
 		var parameters = this.url.slice(this.url.indexOf('?') + 1).split('&');
 		for(var i = 0;  i < parameters.length; i++) {
 			var parameter = parameters[i].split('=');
 			result[parameter[0]] = parameter[1];
 		}
 		return result;
	},
	//To set the request parameter. like window.location.pathname?requestParam=requestParamValue
	setRequestParameter: function (requestParam, requestParamValue){
		if(this.queryString != '' && typeof this.queryString != 'undefined'){
				var currValue = Request.parameter(requestParam) ;
				if(currValue!= '' && typeof currValue!= 'undefined'){
					var queryParams = window.location.search.substring(1).split("&") ;
					var querystr='' ;
					if(queryParams != null ){
						for(var i=0 ; i < queryParams.length ; ++i){
							
							var paramName = queryParams[i].split('=')[0] ;
							var paramValue = queryParams[i].split('=')[1] ;
							if(paramName == requestParam){
								paramValue = requestParamValue ;
							}
							if(querystr!='' && querystr!='undefined'){
								querystr = querystr + '&' + paramName + '=' + paramValue ;
							}else{
								querystr = paramName + '=' + paramValue ;
							}
						}
					}
					location.href = window.location.pathname + '?' + querystr ;
				}else{
					location.href = location.href + '&' + requestParam + '=' + requestParamValue ;
				}
			}else{
				location.href = location.href + '?' + requestParam + '=' + requestParamValue ; 
			}
		}
	
	}


