
var strTextAreaLabel1 = "My question *";
var strTextAreaLabel2 = "My compliant *";
var strTextAreaLabel3 = "My suggestion *";
var errorMsg = "<p class='error'>One or more required fields are incorrect or empty.</p>";
var validateMesg = "Please select an answer";




//framekiller
if (top != self) top.location = self.location;

// 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);
/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */
jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1}var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000))}else{date=options.expires}expires='; expires='+date.toUTCString()}var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('')}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break}}}return cookieValue}};

/**
 * Reusable ABN AMRO plugins
 */
//////////////////////////////////////////////////////////////////////////////////
//CloudCarousel V1.0.5
//(c) 2011 by R Cecco. <http://www.professorcloud.com>
//MIT License
//
//Reflection code based on plugin by Christophe Beyls <http://www.digitalia.be>
//
//Please retain this copyright header in all versions of the software
//////////////////////////////////////////////////////////////////////////////////
//CloudCarousel javascript code is based on 1.0.5 but has custom code for next/previous buttons!
(function(b){function o(c,e,d){var f,h,m=c.width,j=c.width,a;h=b(c.parentNode);this.element=f=h.append("<canvas class='reflection' style='position:absolute'/>").find(":last")[0];if(!f.getContext&&b.browser.msie)this.element=f=h.append("<img class='reflection' style='position:absolute'/>").find(":last")[0],f.src=c.src,f.style.filter="flipv progid:DXImageTransform.Microsoft.Alpha(opacity="+100*d+", style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy="+100*(e/j)+")";else{h=f.getContext("2d");
try{b(f).attr({width:m,height:e}),h.save(),h.translate(0,j-1),h.scale(1,-1),h.drawImage(c,0,0,m,j),h.restore(),h.globalCompositeOperation="destination-out",a=h.createLinearGradient(0,0,0,e),a.addColorStop(0,"rgba(255, 255, 255, "+(1-d)+")"),a.addColorStop(1,"rgba(255, 255, 255, 1.0)"),h.fillStyle=a,h.fillRect(0,0,m,e)}catch(v){return}}b(f).attr({alt:b(c).attr("alt"),title:b(c).attr("title")})}var p=function(c,e){this.orgWidth=c.width;this.orgHeight=c.height;this.image=c;this.reflection=null;this.alt=
c.alt;this.title=c.title;this.imageOK=!1;this.options=e;this.imageOK=!0;if(0<this.options.reflHeight)this.reflection=new o(this.image,this.options.reflHeight,this.options.reflOpacity);b(this.image).css("position","absolute")},s=function(c,e,d){var f=[],h=Math.sin,m=Math.cos,j=this;this.controlTimer=0;this.stopped=!1;this.container=c;this.xRadius=d.xRadius;this.yRadius=d.yRadius;this.autoRotateTimer=this.showFrontTextTimer=0;if(0===d.xRadius)this.xRadius=b(c).width()/2.3;if(0===d.yRadius)this.yRadius=
b(c).height()/6;this.xCentre=d.xPos;this.yCentre=d.yPos;this.frontIndex=0;this.rotation=this.destRotation=Math.PI/2;this.timeDelay=1E3/d.FPS;null!==d.altBox&&(b(d.altBox).css("display","block"),b(d.titleBox).css("display","block"));b(c).css({position:"relative",overflow:"hidden"});b(d.buttonLeft).css("display","inline");b(d.buttonRight).css("display","inline");b(d.buttonLeft).bind("mouseup",this,function(a){a.data.rotate(-1);return!1});b(d.buttonRight).bind("mouseup",this,function(a){a.data.rotate(1);
return!1});d.mouseWheel&&b(c).bind("mousewheel",this,function(a,b){a.data.rotate(b);return!1});b(c).bind("mouseover click",this,function(a){clearInterval(a.data.autoRotateTimer);var c=b(a.target).attr("alt");void 0!==c&&null!==c&&(clearTimeout(a.data.showFrontTextTimer),b(d.altBox).html(b(a.target).attr("alt")),b(d.titleBox).html(b(a.target).attr("title")),d.bringToFront&&"click"==a.type&&(c=(b(a.target).data("itemIndex")-a.data.frontIndex)%e.length,Math.abs(c)>e.length/2&&(c+=0<c?-e.length:e.length),
a.data.rotate(-c)));this.clicker=a.target});b(c).bind("mouseout",this,function(a){var b=a.data;clearTimeout(b.showFrontTextTimer);b.showFrontTextTimer=setTimeout(function(){b.showFrontText()},1E3);b.autoRotate()});b(c).bind("mousedown",this,function(a){a.data.container.focus();return!1});c.onselectstart=function(){return!1};this.innerWrapper=b(c).wrapInner('<div style="position:absolute;width:100%;height:100%;"/>').children()[0];this.showFrontText=function(){void 0!==f[this.frontIndex]&&(b(d.titleBox).html(b(f[this.frontIndex].image).attr("title")),
b(d.altBox).html(b(f[this.frontIndex].image).attr("alt")))};this.go=function(){if(0===this.controlTimer){var a=this;this.controlTimer=setTimeout(function(){a.updateAll()},this.timeDelay)}};this.stop=function(){clearTimeout(this.controlTimer);this.controlTimer=0};this.rotate=function(a){this.direction=a;this.frontIndex-=a;this.frontIndex%=f.length;this.destRotation+=Math.PI/f.length*2*a;this.showFrontText();this.go()};this.autoRotate=function(){if("no"!==d.autoRotate){var a="right"===d.autoRotate?
1:-1;this.autoRotateTimer=setInterval(function(){j.rotate(a)},d.autoRotateDelay)}};this.updateAll=function(){var a=d.minScale,c=0.5*(1-a),e,j,l,q,g,i;l=this.destRotation-this.rotation;var t=Math.abs(l);this.rotation+=l*d.speed;if(0.001>t)this.rotation=this.destRotation;var u=f.length,o=2*(Math.PI/u),n=this.rotation,p=b.browser.msie;this.innerWrapper.style.display="none";for(var k,s=this,r=0;r<u;r++){i=f[r];e=h(n);g=(e+1)*c+a;if(i.imageOK&&(k=i.image,i.image.style.visibility="visible",k.style.zIndex=
""+1E4*g>>0,g*=0.01*k.style.zIndex/100,g=Math.round(100*g),g/=100,0.99==g&&(g=1),l=this.xCentre+(m(n)*this.xRadius-0.5*i.orgWidth)*g,q=this.yCentre+e*this.yRadius*g,e=k.width=i.orgWidth*g,j=k.height=i.orgHeight*g,k.style.left=l+"px",k.style.top=q+"px",null!==i.reflection))k=d.reflHeight*g,i=i.reflection.element.style,i.left=l+"px",i.top=q+j+d.reflGap*g+"px",i.width=e+"px",p?i.filter.finishy=100*(k/j):i.height=k+"px";n+=o}this.innerWrapper.style.display="block";0.005<=t?this.controlTimer=setTimeout(function(){s.updateAll()},
this.timeDelay):this.stop()};this.checkImagesLoaded=function(){var a;for(a=0;a<e.length;a++)if(void 0===e[a].width||void 0!==e[a].complete&&!e[a].complete)return;for(a=0;a<e.length;a++)f.push(new p(e[a],d)),b(e[a]).data("itemIndex",a);clearInterval(this.tt);this.showFrontText();this.autoRotate();this.updateAll();b("img.cloudcarousel").show();b("input#right-but").css("visibility","visible");b("input#left-but").css("visibility","visible")};this.tt=setInterval(function(){j.checkImagesLoaded()},50)};
b.fn.CloudCarousel=function(c){this.each(function(){c=b.extend({},{reflHeight:0,reflOpacity:0.5,reflGap:0,minScale:0.5,xPos:0,yPos:0,xRadius:0,yRadius:0,altBox:null,titleBox:null,FPS:30,autoRotate:"no",autoRotateDelay:1500,speed:0.2,mouseWheel:!1,bringToFront:!1},c);b(this).data("cloudcarousel",new s(this,b(".cloudcarousel",b(this)),c))});return this}})(jQuery);

(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'
		}
	});

	$.plugin({
		name : 'bar',
		defaults : {
			start: new Date().setTime(new Date().getTime() + 1000), // now
			finish: new Date().setTime(new Date().getTime() + 4000), // now + 4 sec
			interval: 100
		},
		methods : {
			init : function(options){
				var self = this;
				var barWidth = self.css('width').replace("px", "") *1;
				var progressElement = self.find('.progress');
				var progressWidth = progressElement.css('width').replace("px", "") *1;
				var endPerc = (progressWidth / barWidth)*100;
				var duration = options.finish - options.start;	
				var interval = setInterval(
					function(){
						var left = options.finish - new Date(), // left time in MS
							elapsed = new Date() - options.start, // elapsed time in MS							
							perc = (elapsed > 0) ? elapsed / duration * 100 : 0; // percentages
						
						progressElement.css('width', perc+'%');
						// display current positions and progress
						// in case of Finish
						if (perc >= endPerc) {
							clearInterval(interval);
						}
					} ,options.interval
				);
			} 
		},
		on : '.bar'
	});
	
	/**
	 * 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 && newWindow.closed) {
									if(options.openClass) self.removeClass(options.openClass);
									clearInterval(intervalId);
								}
							}, 100);
							self.data('newWindow', {'window' : newWindow});
						}
						if(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,
			slide : 'img, div', // what child elements should become slides
			easing : '',
			showTime : 8000,
			slideNr : 0,
			controls : {
				elements : 'a', // either selector or dom nodes
				events : {
					hover : 'show',
					mouseenter : 'stop',
					mouseleave : 'play'
				}
			}		
		},
		methods : {
			init : function(options) {
				var self = this,
					slides = this.addClass('slide-show').find(options.slide).addClass('slide');
				slides.hide().eq(options.slideNr).show();
				$.extend(this.data('slideShow'), {
					currentSlideNr : options.slideNr,
					playFunctionId : 0
				});
				var controls = this.find(options.controls.elements);
				this.addClass('slides-'+controls.length);
				if(controls.length==0) { // add controls if not present
					var ul = $('<ul class="slide-controls nav">');
					this.children('.slide').each(function(index) {
						$('<li>').append($('<a>').attr('href', '#')).appendTo(ul);
					});
					ul.insertAfter(this);
					controls = ul.children();
				}
				slides.each(function(index) {
					$.each(options.controls.events, function(eventName, method) {
						controls.eq(index)[eventName](function(event) {
							event.preventDefault();
							self.slideShow(method, $.extend(true, options, {slideNr : index}));
						});
					});
					
					if (controls.length!=1 && index==options.slideNr){ 
						controls.eq(index).addClass('current');
					}
				});
				this.data('slideShow').controls = controls;
				this.data('slideShow').slides = slides;
				if (controls.length!=1){			
					this.slideShow('play', options);
				}
				
				
			},
			show : function(options) {
				var slides = this.data('slideShow').slides;
				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.removeClass('current').eq(slideNr).addClass('current');
					this.data('slideShow').currentSlideNr = slideNr;
				}
			},
			next : function(options) {
				var options = $.extend(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, .highlights > ul'
	});

	/**
	 * 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.is('ul') || this.is('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.has('a').length ? trigger.find('a') : trigger.wrapInner('<a href="#"></a>').find('a');
				trigger = trigger.prependTo(dropdown);
				list.width(list.width() - 2).appendTo('body').children(':first').remove();
				$.extend(this.data('dropdown'), {
					dropdown : dropdown,
					list : list,
					trigger : trigger,
					toListHeight : list.height()
				});
				var mouseover = false;
				list.css(options.hiddenCSS)
					.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');
					})
					.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;
				var browserTopCompensation = 0;
				if($.browser.msie && $.browser.version!=='7.0' || $.browser.webkit) {
					browserTopCompensation = parseInt($('html').css('borderTopWidth'));
				}
				list.css('top', trigger.offset().top + trigger.outerHeight() -1 + browserTopCompensation + 'px');
				list.css('left', trigger.offset().left + 'px');
				dropdown.addClass('has-active-dropdown').add(trigger).add(list).addClass('hover');
				list.animate({
					height : data.toListHeight
				}, 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'
	});

	//Market Access Tool
	if($('table.market-access').length) {
		// find path of current script
		var scriptPath = $('script').last().attr('src').replace(/[^\\^\/]*$/, ''); // path of the currently executing file
		$.getScript(scriptPath + 'raphael-2.0.1.min.js', // Load the Raphael library
		function() {
			// Hide tables
			$('table.market-access').hide().prev('h2').hide();

			//Extend Raphael object with segment function
			// draw a circle segment
			Raphael.fn.segment = function(options) {
				var o = $.extend(true, {}, Raphael.fn.segment.defaults, options);
				var x = o.d * Math.cos(o.angle), y = o.d * Math.sin(o.angle);
				// move to inner circle segment start
				var p = 'M' + (o.cx + o.d) + ',' + o.cy;
				// path to inner circle segment end
				p += ' A' + o.d + ',' + o.d + ' 0 0,1 ' + (o.cx + x) + ',' + (o.cy + y);
				// line to outer circle end
				x = o.r * Math.cos(o.angle); y = o.r * Math.sin(o.angle);
				p += ' L' + (o.cx + x) + ',' + (o.cy + y);
				// line to outer circle start
				p += ' A' + o.r + ',' + o.r + ' 0 0,0 ' + (o.cx + o.r) + ',' + o.cy + ' z';
				var path = this.path(p).attr('stroke', 0); // create path
				// add text
				path.text = this.text(o.cx + o.r - o.text.padding, o.cy, o.text.value);
				if(Raphael.vml) o.cx -= 1.5, o.cy -= 1.5; // empirically determined compensation to origin of rotation
				if(o.text.orientation=='vertical') {
					path.text.attr('text-anchor', 'end').rotate(Raphael.deg(o.rotation + o.angle/2), o.cx, o.cy);
					if(o.rotation > (Math.PI / 2) && o.rotation < (3 * Math.PI / 2)) {
						if(Raphael.vml) {
							path.text.rotate(Raphael.deg(-o.angle/8), o.cx, o.cy); // proper text alignment
						}
						path.text.rotate(180);
					}
				} else {
					var	flip = (o.rotation + o.angle / 2) < Math.PI && (o.rotation + o.angle / 2) > 0,
						angle = flip ? -o.angle : o.angle,
						sweep = flip ? 0 : 1, // path string
						rText = (o.d + o.r) / 2 - (Raphael.svg ? (flip ? -6 : 7) : -1),
						p = 'M' + (o.cx + rText) + ',' + o.cy; // radius at which the text is displayed
					// path to circle segment end
					p += ' A' + rText + ',' + rText + ' 0 0,' + sweep +  ' '
						+ (o.cx + rText * Math.cos(angle)) + ',' + (o.cy + rText * Math.sin(angle));
					var pathForText = this.path(p).attr('stroke', 0); // create path
					if(Raphael.svg) {
						pathForText.node.id = 'textPath-' + Raphael.fn.segment.textPathCnt++;
						var textPathRef = document.createElementNS('http://www.w3.org/2000/svg', 'textPath');
						textPathRef.setAttributeNS('http://www.w3.org/1999/xlink', 'href', '#' + pathForText.node.id);
						textPathRef.setAttribute('startOffset', '50%');
						textPathRef.setAttribute('text-anchor', 'center');
						textPathRef.setAttribute('spacing', 'exact');
						textPathRef.textContent = o.text.value;
						path.text.node.appendChild(textPathRef);
						$(path.text.node).find('tspan').hide();
						pathForText.rotate(Raphael.deg(o.rotation - (flip ? angle : 0)), o.cx, o.cy);
					} else if(Raphael.vml) {
						path.text.node.textPath.on = true;
						path.text.node.path.v = pathForText.node.path.v;
						path.text.node.path.textpathok = true;
						path.text.rotate(Raphael.deg(o.rotation - (flip ? angle : 0)), o.cx, o.cy);
					}
				}
				path.text.path = path;
				return path.rotate(Raphael.deg(o.rotation), o.cx, o.cy);
			}
			
			Raphael.fn.segment.textPathCnt = 0; // for textPathId's

			// segment default options
			Raphael.fn.segment.defaults = {
				cx : 0, // center x
				cy : 0, // center y
				r : 10, // radius
				d : 0, // inner radius, this is the part that will not be part of the circle...
				angle : Math.PI, // what angle is covered by the circle 
				rotation : 0, // start angle
				text : {
					value : '', // text in the segment
					orientation : 'vertical', // orientation can be horizontal or vertical
					padding : 10
				}
			}

			/*
			 * todo:
			 * - Fix text along path for groups
			 */
			function parseAvailability(elements) {
				var availabilities = {};
				elements.each(function() {
					var $this = $(this);
					availabilities[$this.text()] = {
						color : $this.css('backgroundColor'),
						text : $this.next().text(),
						key : $this.text()
					};
				});
				return availabilities;
			}

			$.plugin({
				name : 'mat',
				methods : {
					init : function(options) {
						var legend = this.siblings('.legend').addClass('parsed'),
							availabilities = parseAvailability(legend.find('th')),
							mat = {
								groups : {},
								sliceCnt : 0
							},
							groups = mat.groups;
						
						// parse ISVs
						var ISVels = this.find('thead th:not(:first-child)'),
							ISVs = groups.ISVs = {
								slices : {},
								sliceCnt : ISVels.length
							};
						ISVels.each(function() {
							var $this = $(this);
							ISVs.slices[$this.text()] = {
								key : $this.text(),
								availabilities : {}
							};
						});
						
						// Parse exchanges. i.e. Derivatives, Stock and Financial exchanges
						this.parent().find('h2 + table.market-access').each(function(index) {
							var table = $(this),
								markets = table.find('tbody th'),
								group = groups[table.prev('h2').text()] = {
									slices : {},
									sliceCnt : markets.length
								};
							markets.each(function(index) {
								var market = $(this),
									slice = group.slices[market.text()] = {
										availabilities : {}
									};
								market.nextAll('td').each(function(index) {
									if($(this).text()) {
										var availability = $(this).text(),
											ISV = ISVels.eq(index).text(),
											isv = ISVs.slices[ISV];
										slice.availabilities[ISV] = {
											availability : availabilities[availability],
											isv : isv
										};
										isv.availabilities[market.text()] = {
											availability : availabilities[availability],
											market : slice
										};
									}
								});
							});
						});
						
						// calculate total number of slices
						for(groupKey in groups) {
							mat.sliceCnt += groups[groupKey].sliceCnt;
						}

						// Drawing
						
						// Setup rendering area
						var matEl = $('<div class="market-access-tool">');
						this.parent().prepend(matEl);
						var paper = Raphael(matEl[0], matEl.width(), matEl.width()),
							cx = paper.width / 2, cy = paper.height / 2; // center x and center y
						paper.renderfix();
						Raphael.fn.segment.defaults.cx = cx;
						Raphael.fn.segment.defaults.cy = cy;
						
						// Move legend into place
						legend.add(legend.prev('h2')).wrapAll($('<div>').css({
							'margin-top' : '-' + cy / 2 + 'px',
							'width' : cx / 2 + 'px',
							'position' : 'absolute'
						}));
						
						// Create legend for IE 7 and 8
						if($.browser.msie && ($.browser.version=='7.0' || $.browser.version=='8.0')) {
							legend.find('th').each(function(th) {
								var $th = $(this).text(' '),
									d = $th.width(),
									r = d / 2;
								Raphael(this, d, d).circle(r, r, r).attr({
									'fill' : $th.css('background-color'),
									'stroke' : 0
								});
								$th.css('background-color', 'transparent');
								if($.browser.version=='7.0') {
									legend.attr('cellspacing', 6);
								}
							});
						}

						// Add background image
						var bgImg = this.siblings('img').hide().eq(0);
						paper.image(bgImg.attr('src'), 
							cx - bgImg.width() / 2,
							cy - bgImg.height() / 2,
							bgImg.width(),
							bgImg.height());
						
						// Add 'inner circles'
						paper.circle(
								cx, cy,
								options.innerCircleRadius
							)
							.attr('fill', '#007670')
							.attr('opacity', '.70');
						paper.circle(
								cx, cy,
								options.innerCircleRadius + 31
							)
							.attr('stroke', '#FFFFFF')
							.attr('stroke-width', '100');
						paper.circle(
								cx, cy,
								options.innerCircleRadius - 11
							)
							.attr('stroke', '#2F2D2C')
							.attr('stroke-width', '4');
						
						paper.path('M' + (cx - options.innerCircleRadius + 30) + ' ' + (cy + .5) + 'H' + (cx + options.innerCircleRadius - 30))
							.attr({stroke : '#FFFFFF', 'stroke-width' : '1'});
						paper.text(cx, cy - 17, bgImg.attr('alt').toUpperCase()).attr({
							'font-weight' : 'bold',
							'font-size' : '17px'
						});
						var centerTextWidth = 1.4 * options.innerCircleRadius,
							centerText = $('<div class="center-text"></div>')
								.css({
									width : centerTextWidth,
									top : cy + 'px',
									left : (cx - centerTextWidth / 2) + 'px'
								})
								.text(options.defaultCenterText);
						matEl.append(centerText);
						
						// Add groups, ISVs and market slices
						var sliceAngle = (2 * Math.PI) / mat.sliceCnt,
							groupIndex = 0, groupRotation = 0,
							rot_offset = - sliceAngle * ISVs.sliceCnt / 2;
						$.each(groups, function(groupKey, group) {
							var sliceIndex = 0,
								groupAngle = group.sliceCnt * sliceAngle,
								style = options.styling[groupKey];
							group.groupKey = groupKey;
							$.each(group.slices, function(sliceKey, slice) {
								var set = paper.set();
								slice.group = group;
								slice.path = paper.segment({
									r : options.outerCircleRadius,
									d : options.innerCircleRadius,
									angle : sliceAngle,
									rotation : rot_offset + groupRotation + sliceIndex * sliceAngle,
									text : {
										value : sliceKey,
										padding : options.textPaddingRight
									}
								})
								.attr('fill', style.slices.fill);
								slice.path.hover = false;
								set.push(slice.path, slice.path.text);
								set.mouseover(function() {
									if(!slice.path.hover) {
										// TODO optimize by pre generating the texts and changing z-index
//									paper.forEach(function(path) {
//										if(path.text) path.text.attr('fill-opacity', '.4');
//									});
										slice.path.hover = true;
										if(Raphael.vml) {
											slice.path.node.fill.color = '#000000';
											slice.path.text.node.fill.color = '#FFFFFF';
										} else {
											slice.path.attr('fill', '#000000');
											slice.path.text.attr('fill', '#FFFFFF');
										}
//										slice.path.text.attr('fill-opacity', '1');
										var availabilityCnt = 0,
											counts = {};
										for(var availableKey in slice.availabilities) {
											var available = slice.availabilities[availableKey],
												ISVorMarket = (available.isv || available.market);
												path = ISVorMarket.path;
											if(path) {
												var groupKey = ISVorMarket.group.groupKey;
												if(Raphael.vml) {
													path.node.fill.color = available.availability.color;
													path.text.node.fill.color = '#FFFFFF';
												} else {
													path.attr('fill', available.availability.color);
													path.text.attr('fill', '#FFFFFF');
												}
												// path.text.attr('fill-opacity', '1');
												if(available.isv) {
													availabilityCnt++;
												} else {
													if(typeof counts[groupKey]=='undefined') counts[groupKey] = 0;
													counts[groupKey]++;
												}
											}
										}
										var newCenterText = slice.path.text.attrs.text + ' ';
										if(typeof available=='undefined' || available.isv) {
											groupKey = groupKey || 'ISVs';
											newCenterText+=
												// add 'exchange' if not in name
												//(newCenterText.toLowerCase().indexOf('exchange')===-1 ? 'exchange ' : '') +
												(slice.group.groupKey.indexOf('Derivatives')===0 ? 'for derivatives' : '') + 
												' is offered via ' + availabilityCnt + ' ' + (availabilityCnt==1 ? groupKey.replace(/s$/, '') : groupKey);
										} else {
											newCenterText+= ' currently offers access to ';
											var countStr = [];
											for(var groupKey in counts) {
												countStr[countStr.length] = counts[groupKey] + ' ' + (counts[groupKey]==1 ? groupKey.replace(/s$/, '') : groupKey);
											}
											newCenterText+= countStr.slice(0, countStr.length - 1).join(', ') + ' ' + 
												(countStr.length > 1 ? 'and ' : '') + countStr.pop();
										}
										centerText.text(newCenterText);
									}
								}).mouseout(function() {
									if(slice.path.hover) {
										slice.path.hover = false;
										// replace with generic reset/color init function?
										if(Raphael.vml) {
											slice.path.node.fill.color = style.slices.fill;
											slice.path.text.node.fill.color = style.slices.textColor;
										} else {
											slice.path.attr('fill', style.slices.fill);
											slice.path.text.attr('fill', style.slices.textColor);
										}
	//									paper.forEach(function(path) {
	//										if(path.text) path.text.attr('fill-opacity', '1');
	//									});
										for(var availableKey in slice.availabilities) {
											var available = slice.availabilities[availableKey],
												ISVorMarket = (available.isv || available.market),
												path = ISVorMarket.path;
											if(path) {
												var defaultStyle = options.styling[ISVorMarket.group.groupKey].slices;
												if(Raphael.vml) {
													path.node.fill.color = defaultStyle.fill;
													path.text.node.fill.color = defaultStyle.textColor;
												} else {
													path.attr('fill', defaultStyle.fill);
													path.text.attr('fill', defaultStyle.textColor);
												}
											}
										}
										centerText.text(options.defaultCenterText);
									}
								});
								slice.path.text.attr('fill', style.slices.textColor);
								sliceIndex++;
							});
							group.path = paper.segment({
								r : options.outerCircleRadius + 30,
								d : options.outerCircleRadius,
								angle : groupAngle,
								rotation : rot_offset + groupRotation,
								text : {
									value : style.shortText ? style.shortText : groupKey,
									orientation : 'horizontal'
								}
							})
								.attr('fill', style.fill)
								.text.attr({
									'fill' : style.textColor,
									'font-size' : 20,
									'x' : 0,
									'y' : 0
							});
							groupRotation += groupAngle;
							groupIndex++;
						});
						// Fix for center text 'blinking' when hovering
						if($.browser.msie && ($.browser.version=='7.0' || $.browser.version=='8.0')) {
							$('<a href="#"></a>').click(function(evt) {
								this.href = '#';
								evt.preventDefault();
								return false;
							}).click();
						}
						
						return this;
					}
				},
				defaults : {
					innerCircleRadius : 122,
					outerCircleRadius : 350,
					textPaddingRight : 8,
					defaultCenterText : 'Point your mouse over an exchange or ISV to get information about our access solutions',
					styling : {
						'Derivatives Exchanges' : {
							textColor : '#2B5151',
							fill : '#579F9D',
							slices : {
								textColor : '#333333',
								fill : '#62B3AF'
							}
						},
						'Stock Exchanges' : {
							textColor : '#2D7F7C',
							fill : '#59AAA6',
							slices : {
								textColor : '#333333',
								fill : '#95CBC8'
							}
						},
						'FX markets' : {
							textColor : '#5A696A',
							shortText : 'FX', // shortText is used if available
							fill : '#B3CDCB',
							slices : {
								textColor : '#333333',
								fill : '#C9E4E2'
							}
						},
						'ISVs' : {
							textColor : '#FFFFFF',
							fill : '#3F3F3F',
							slices : {
								textColor : '#005B5D',
								fill : '#D1D3D4'
							}
						}
					}
				},
				on : 'table.market-access:first'
			});
		});
	}
})(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, {
		'a.new-window, .region a' : {
			windowFeatures : {}
		},
		'a[href^="http"]' : {
			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]).attr('href', 'javascript:;');
				$(scrollLinks[i]).click(function(event){event.preventDefault(); base.scrollPage(this.myOffset)});
			}
		}
	}
};

scrollHashLinks.prototype.scrollPage = function (offset) {
	$('html,body').animate({scrollTop: offset}, {duration: 600, easing: 'easeOutQuad'});
};


/**
 * Initialize the page, adding behaviour to various elements.
 */
jQuery(function($) {
	(function() {
		if($('.content .content .disclaimer').length > 0){
			var disclaimerId = $.trim($('.content .disclaimer .hideDisclaimerType').text());
			var disclaimer = 'Disclaimer_'+ disclaimerId
			var cookieDisclaimerId = $.cookie(disclaimer);
			if (cookieDisclaimerId != disclaimerId) {
				$('.content .content .disclaimer #disclaimerDisagree').attr("href", window.location.href);
				$('.content .content .disclaimer #disclaimerAgree').attr("href", window.location.href);
				$('.content .content .disclaimer #disclaimerAgree').click(function() {
					$.cookie(disclaimer, disclaimerId);
				});
				//hide content
				$('.content .content').children().each(function(index) {
					var $this = $(this);
					if ($this.hasClass('disclaimer') && !$this.hasClass('hideDisclaimerType')){
						$this.css('display', 'inline-block');	
					}else {
						$this.css('display', 'none');	
					}					
				});
			}else {
				//show content
				$('.content .content').children().each(function(index) {
					var $this = $(this);
					if ($this.hasClass('disclaimer')){
						$this.css('display', 'none');
					}else{
						if ($this.hasClass('aside')|| $this.hasClass('wide')){
							$this.css('display', 'inline-block');
						}else{
							$this.css('display', 'block');
						}
					}					
				});
			}
		}
	})();

	$('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');
		}
	});
	
	(function() {
		$(".content .content .highlights ul li").find('a').each(function(index) {
			var $this = $(this);
			var str = $this.contents()[0].data;
			var img = $this.find("img");
			var clock = $this.find("span.clock");
			$this.contents().remove();
			$this.append(img);
			if ($this.hasClass('video')){
				$this.append("<span class='video-button'/>");
			}
			$this.append("<span class='bg'/>");
			$this.append("<span>"+str+"</span>");			
			$this.append(clock);
		});
		
		$(".content .content .highlights").slideShow({
			slide: 'img',
			controls: {
				elements : 'li'
			}
		});
		
		if( typeof( slideshows ) != "undefined") {
			$('.highlights ul').each(function(index_ss) {
				var ss = this;
				$(ss).find('li').each(function(index_s){
					var s = this;
					var time24 = '';
					if (slideshows[index_ss] && slideshows[index_ss].slides[index_s]){
						time24 = slideshows[index_ss].slides[index_s];
					}
					if (time24){
						$(s).find("span.clock").each(function(index_c) {
							var c = this;
							var location = $(c).text();
							
							var time = time24.match(/(\d+):(\d+)/);
							var hours = parseInt(time[1] * 1);
							var minutes = parseInt(time[2] * 1);
							
							var now = new Date();
							
							now.setHours( hours );
							now.setMinutes( minutes );
							var date = dateFormat(now);						
							$(c).text(location+"-"+date);	
							
							setInterval(function() { 
								now.setMinutes(	now.getMinutes()+1);
								date = dateFormat(now);
								$(c).text(location+"-"+date);	
							}
							, 1000*60);//*60				
						});
					}
				});
			});
		}
		function dateFormat(now) {
			var newMinutes = now.getMinutes() <= 9?"0"+now.getMinutes():now.getMinutes();
			var newHours = now.getHours();
			var newMidday = " AM";
		    if (now.getHours() > 12) {
		    	newHours = now.getHours() - 12;
		    	newMidday = " PM";
		    } 
		    if (newHours == 12) {
		    	newMidday = " PM";
		    }
		    if (newHours == 00) {
		    	newHours = "12";
		    }		    
		    return newHours+":"+newMinutes+" "+newMidday;
		    
		}
		
		$(".content .content .highlights ul li").find('span').each(function(index) {
			var $this = $(this);
			if (!$this.hasClass('clock') 
					&& !$this.hasClass('bg') 
					&& !$this.hasClass('video-button') )
			{
				var spanheight = $(this).height();
				var linkheight = $(this).parent().height();
				var spanpaddingtop = Math.ceil((linkheight-spanheight) / 2);
				$(this).css('padding-top', spanpaddingtop);
				
			}
		});		
	})();
	(function() {
		var accordion = $('table.data-folding');
		accordion.find('thead').find('th').each(function(index){
			var $this = $(this);
			$this.prepend('<span class="arrow"></span>');
		});
		
		accordion.find('tbody').each(function(index){
			var $this = $(this);
			$this.data("body", index);
			$this.addClass("body-"+index);
			$this.slideUp(400);
			
		})
		accordion.find('thead').each(function(index){
			var $this = $(this);
			$this.data("title", index);
			$this.addClass("title-"+index);
			$this.css("cursor", "pointer");
		})		
		accordion.find('thead').each(function(index){
			var $this = $(this);		
			$this.click(function(){
				//hide all
				var title = $this.data("title");
				accordion.find('tbody').each(function(index){
					var $body = $(this);	
					if (title == index){
						if ($body.hasClass("open")){
							$body.stop(true, true).slideUp(400).removeClass("open");
							
						}else{
							$body.stop(true, true).slideDown(400).addClass("open");
						}
					}else{
						$body.stop(true, true).slideUp(400).removeClass("open");
					}
				});
			});
		})
		accordion.find(".body-0").slideDown(400).addClass("open");
	})();
	
	$('.toggle').click(function(){
		if( $(this).hasClass('green')){
		$(this).css('color', 'green');
		$(this).removeClass('green');
		  } else {
		    $(this).css('color', 'red');
		    $(this).addClass('green');
		  }
	});
	

	$('table, ul').decorate(); // Add first, last, even and odd classes
	if($.browser.msie) {
		if($.browser.version=='7.0') {
			$('input').focus(function() {$(this).addClass('focus')}).blur(function() {$(this).removeClass('focus')});
			$('.abstracts li > h3 + img').each(function() {
				$(this).insertBefore($(this).prev());
			});
		}
		if($.browser.version=='7.0' || $.browser.version=='8.0') {
			$('body, body > .footer, body > .content, body > .content > .content, .content .content > .highlight')
				.prepend('<div class="before"></div>').append('<div class="after"></div>');
			$('.abstracts li div, .business-finder.selection li div')
				.append('<span class="after"></span>');
			
			
		}  
		if($.browser.version=='8.0') {
			$('fieldset legend:hidden').remove(); // legend elements cause the fieldset border to stop at half the fieldset height
		}
	}
	$('.online-services-login ul, .product-service-finder ul, ul.online-services-investor-reports').dropdown();
	//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());;
	if(!('placeholder' in document.createElement('textarea'))) {
		// @todo: This should be made into generic placeholder emulation code (for all textareas and inputs)
		(function() {
			// refactor to simply do this for all textareas
			var question = $('#contact #question'),
				placeholder = question.attr('placeholder');
			question.val(placeholder);
			question
				.blur(function() {
					if(question.val()=='') question.val(placeholder);
				})
				.focus(function() {
					if(question.val()==placeholder) question.val('');
				});
		})();
	}
	// Add breadcrumbs
	$('body > .content:not(.no-nav):has(.nav) > .content').after(
		$('<div class="breadcrumbs"><h2>Breadcrumbs</h2></div>')
			.append($('<p></p>').append($('body > .content > .nav').find('li.active > a, a.active').slice(-3).clone()
				.last().addClass('last').end()))
			.find('a').before(' <span>></span> ').end()
			.find('a + span + a + span + a').parent().prepend('<span class="ellipsis">…</span> ').end().end()
			.find('span:first-child:not(.ellipsis)').parent().prepend($('body > .nav > ul > li:first-child > a').clone()).end().end()// .has() doesn't seem to work before insertion in the document
	);
	$('hr').wrap('<div class="hr"></div>'); // enable uniform styling across browsers
	$('object.quadia-player').each(function(index) {
		var id = 'quadia-player-' + index;
		$(this).attr(id);
		swfobject.registerObject(id, "10.0.0", "static/flash/swf/expressInstall.swf");
	});
	$('a.video').click(function() {
		$(this).colorbox({
			scrolling : false,
			fixed : true,
			opacity :0.8,
			href : $(this).attr('href') + ' .content .content'
		});
	});
	
	$('form#feedback input#current_page').val(window.location.href);
			
	$('#colorbox.feedback input[type="submit"]').live('click', function(){
		$().colorbox({
			scrolling : false,
			fixed : true,
			opacity : 0.8,
			width : 620,
			height: 300,
			data : $(this).closest("form").serialize(),
			href : $(this).closest("form").attr('action') + ' .content .content'
		});
		return false;
	}); 
	
	$('a.feedback').click(function() {
		$(this).colorbox({
			scrolling : false,
			fixed : true,
			opacity :0.8,
			width : 620,
			height: 600,
			onComplete:function(){
				$("#colorbox").addClass("feedback");
				$("#colorbox form#feedback input#current_page").val(window.location.href); 
			},
			href : $(this).attr('href') + ' .content .content'
		});
	});
	
	/*var nextGenAreas = $('.generation-next map area');
	if(nextGenAreas.length) {
		nextGenAreas.each(function(){
			$(this).attr('href', document.location.href);
		})
	}*/
	var nextGenItems = $('.generation-next ul li');
	if(nextGenItems.length) {
		var fadeDuration = 1000;
		nextGenItems.hide().eq(0).show();
		if($.browser.msie) {
			if($.browser.version=='7.0' || $.browser.version=='8.0' || $.browser.version=='9.0') {
				$('#generation-next-map area').hover( 
					function(){
						$(document.body).css('cursor','pointer'); 
					}, function(){
						$(document.body).css('cursor','auto');
					}
				);
				
				$('#generation-next-map area').focus(function(){
					$(this).blur();
				});
				fadeDuration = 0;
			}
		}
		$('#generation-next-map area').click(function(event) {
			nextGenItems.hide().filter('.' + $(this).attr('id')).show()
				.find('h2, div').hide().fadeIn(fadeDuration);
			event.preventDefault();
		});
	}

	/*$('div.language ul li.active').find('strong').each(function(){
		console.log($(this).unwrap('a'));
	});*/
	
	$('.cloudcarousel').css('visibility', 'hidden').parent()
		.wrap('<div class="cloud-carousel-container wide"></div>')
		.parent()
		.append('<div id="left_btn"><input id="left-but" type="button"/></div>')
		.append('<div id="right_btn"><input id="right-but" type="button"/></div>')
		.CloudCarousel({
			xPos: 230,
			yPos: 80,
			buttonLeft: $('#left-but'),
			buttonRight: $('#right-but'),
			FPS: 60,
			yRadius: -40,
			xRadius: 260,
			bringToFront: true,
			minScale: 0.0,
			reflOpacity: 0
	});

	 new scrollHashLinks();
	// Business finder
	(function() {
		$("a[href^='\#']").click(function(){
			this.href = document.location.href.replace( /#.*/, "") + "#" + this.href.substr(this.href.indexOf('#')+1);
		});
		
		//positioning of tooltip
		$('.business-finder.selection div').each(function(index){
			var 
				$this = $(this),
				text = $this.parent().find('h3 a');
			if($this.closest('li').closest('li').is(':even') && text.width() > 110) {
				$this.addClass('flipped');
				$this.css("right", (258 - text.width()) + "px");
			} else {
				$this.css("left", (text.width() + 4) + "px");
			}
		});
		
		if($.browser.version=='7.0' || $.browser.version=='8.0') {
			$(".business-finder.selection ul li ul li img").hover(
				function () {
					$(this).siblings("div").css('display','block').css('z-index','600').css('opacity','1');
				}, 
				function () {
					$(this).siblings("div").css('display','none');
				}
			);
		}
		
		//hide country and detail 
		$('.business-finder.selection').parent().addClass('fancy');
		$('.business-finder.country, .business-finder.detail').hide();
		
		function highlightItem(hash){
			$('.business-finder.selection').find("li").each(function() {
				$(this).removeClass("set-active");
			});
			$('.business-finder.selection').find("a").each(function() {
				if ($(this).attr("href").match(hash+'$')){
					$(this).parent().parent().addClass("set-active");
				}
			});
		}
		
		function showDetails(hash) {
			location.hash = hash;
			$(hash).closest('.business-finder').slideDown(400, 'linear', function() {
				$(this).animate({backgroundColor: '#F6F6F6'}, 500, function() {
					$(this).animate({backgroundColor: '#FFF'}, 500);
				});
			});
		}
		
		function showDetailsPopup(hash){
			location.hash = hash;
			$.colorbox({
				scrolling : false,
				transition : 'none',
				width : 630,
				fixed : true,
				opacity : 0,
				inline: true,
				href: $(hash).closest('.business-finder').clone().css('display','block'),
				onComplete : function() {
					$("#colorbox").addClass("alternative"); 
					$('#cboxLoadedContent .business-finder a').click(function(){
						this.href = document.location.href.replace( /#.*/, "") + "#" + this.href.substr(this.href.indexOf('#')+1);
						$.colorbox.close();
						$('.business-finder.detail').hide();
						showDetails(this.hash);
					});
				}
			});
			
		}
		//if hash is passed with request url
		if (location.hash){
			if (location.hash.match(/countries$/)){
				highlightItem(location.hash);
				showDetailsPopup(location.hash);
			}else{
				highlightItem(location.hash);
				showDetails(location.hash);
			}
		}

		//if link in finder is clicked which should NOT show popup
		$('.business-finder.selection a:not([href$=countries])').click(function(event) {
			$('.business-finder.country, .business-finder.detail').hide();	
			highlightItem(this.hash);
			showDetails(this.hash);
		});
		
		//if link in finder is clicked which should show popup
		$('.business-finder.selection a:[href$=countries], .business-finder.detail > a:[href$=countries]').click(function() {
			$('.business-finder.country, .business-finder.detail').hide();
			highlightItem(this.hash);
			showDetailsPopup(this.hash);
		});
		
		$('.business-finder.detail').each(function() {
			var detailSections = $(this).children('ul').children('li');
			if(!(detailSections.length % 2)) {
				detailSections.last().addClass('split');
			}
		});
	    
	})();
	if($.browser.msie && $.browser.version=='7.0' ){
        $(window).load(function() {
            $('body, .content .content').css("display","none").css("display","block");
        });
        $(window).resize(function() {
            $('body, .content .content').css("display","none").css("display","block");
        });
        $('.dropdown .trigger, #generation-next-map area').click(function() {
            $('body, .content .content').css("display","inline").css("display","block");
        });
    }
});

// code for input validation of the Poll functionality 
	function checkdata() {
	var noOfQuestions=1;
	if ($("input.radioCheck3").length != 0) {
	noOfQuestions=3; 
	}
	else if ($("input.radioCheck2").length != 0) {
	noOfQuestions=2;
	}
	var success=false;
	for(var i=1;i<=noOfQuestions;i++) {
	var n = $("input.radioCheck"+[i]+":checked").length;
	if(n>0){
	success=true;}
	else{
	success=false;
	break;}
	}
	if (success==false) {
	$("label.errorMesg").text(validateMesg);
	}
	return success;
	}

$('#contact').submit(function(){
	var hasError = false;
	if($.trim($('#question').val()).length <= 0 || $.trim($('#question').val()).length > 1000){
		$('#question').addClass("error");
		hasError = true;
	}
	if(validateTxtFld('name') <= 0){
		$('#name').addClass("error");
		hasError = true;
	}
	if($('#email').length > 0 ){
		if(!validateEmailAdd('email')){
			$('#email').addClass("error");
			hasError = true;
		}
	}
	if($("#abn_client_0").is(':checked')){
		if(!isBankAccountNr($('#account_number').val())){
			$('#account_number').addClass("error");
			hasError = true;
		}
	}
	
	if(hasError && ($('#contact').find('p[class = error]').length <= 0 )){
		$('#contact').find('input[type=submit]').before(errorMsg);
	}
	return !hasError;
});
		
		
//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;
}

// Change the label of the textarea as per selected radio input

$("#feedback1, #feedback2, #feedback3").click(function() {
	if($("#feedback1").is(':checked')){
		$("#your_question").html(strTextAreaLabel1);
	}
	else if($("#feedback2").is(':checked')){
		$("#your_question").html(strTextAreaLabel2);
	}
	else if($("#feedback3").is(':checked')){
		$("#your_question").html(strTextAreaLabel3);
	}
});

$("#abn_client_0,#abn_client_1").click(function() {
	if($("#abn_client_0").is(':checked')){
		$("#account_number").css('display', 'inline-block');
		$("#account_number").next().css('display', 'block');
		$("#account_number").prev().css('display', 'inline-block');
	}
	else if($("#abn_client_1").is(':checked')){
		$('#account_number').val("");
		$("#account_number").css('display', 'none');
		$("#account_number").next().css('display', 'none');
		$("#account_number").prev().css('display', 'none');
	}
	$(this).removeClass("error");
});

$('input,select,textarea ').focus(function() {
	$(this).removeClass("error");
});

// Functie voor de elf-proef.
function elevenTest(value) {
	var length = value.length;
	var sum = 0;
	for (var i=0; i<length; i++) {
		sum = sum + (value.charAt(i) * (length - i));
	}
	return ((sum % 11) == 0);
}
// Bankrekeningnummer
function isBankAccountNr(value){
	if (value.length < 9 || (value.length == 9 && value.charAt(0) == "0")){
		return false;
	}
	else{
		return elevenTest(value);
	}
}

//To append the query parameter 'selectedYear' for .com press release archive list
$('body > .content > .content > .wide > .header.archive a').each(function(index) {
	$(this).attr('href', window.location.pathname+"?selectedYear="+ $(this).text());
});

$('body > .content > .content > .wide > .pages.nav.archive a').each(function(index) {
	if(index == 0){
		$(this).attr('href', window.location.pathname);
	}
	else{
		$(this).attr('href', window.location.pathname + "?selectedPage");
	}
	
});

//To append the query parameter 'selectedPage' for .com press release archive list	
$('body > .content > .content > .wide > .pages.nav.archive a').click(function(){
	var selectedPageNum ;	
	if($(this).hasClass('previous')){
		selectedPageNum = (typeof Request.parameter('selectedPage') !="undefined")?(Request.parameter('selectedPage') - 1):0 ;
	}else if($(this).hasClass('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 + ')'); 
}) ;

$('body > .content > .content > .wide > .emphasis form >fieldset').each(function(){
	
	$(this).change(function(){
		if($(this).find('select').attr('name') == 'year'){
			$("select[name=period]").val("") ;
			$("select[name=organization]").val("") ;
			$("input[name=IsAbbreviated]").val("false") ;
		}
		$(this).parent('form').submit() ;
	})
	
}) ;


//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 ; 
			}
		}
	
	}


