/*
 * jQuery UI 1.8.2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 */
(function(A){A.ui=A.ui||{};if(!A.ui.version){A.extend(A.ui,{version:"1.8.2",plugin:{add:function(C,B,E){C=A.ui[C].prototype;for(var D in E){C.plugins[D]=C.plugins[D]||[];C.plugins[D].push([B,E[D]])}},call:function(C,B,E){if((B=C.plugins[B])&&C.element[0].parentNode){for(var D=0;D<B.length;D++){C.options[B[D][0]]&&B[D][1].apply(C.element,E)}}}},contains:function(C,B){return document.compareDocumentPosition?C.compareDocumentPosition(B)&16:C!==B&&C.contains(B)},hasScroll:function(C,B){if(A(C).css("overflow")=="hidden"){return false}B=B&&B=="left"?"scrollLeft":"scrollTop";var D=false;if(C[B]>0){return true}C[B]=1;D=C[B]>0;C[B]=0;return D},isOverAxis:function(C,B,D){return C>B&&C<B+D},isOver:function(C,B,G,F,E,D){return A.ui.isOverAxis(C,G,E)&&A.ui.isOverAxis(B,F,D)},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});A.fn.extend({_focus:A.fn.focus,focus:function(C,B){return typeof C==="number"?this.each(function(){var D=this;setTimeout(function(){A(D).focus();B&&B.call(D)},C)}):this._focus.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none")},scrollParent:function(){var B;B=A.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(A.curCSS(this,"position",1))&&/(auto|scroll)/.test(A.curCSS(this,"overflow",1)+A.curCSS(this,"overflow-y",1)+A.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(A.curCSS(this,"overflow",1)+A.curCSS(this,"overflow-y",1)+A.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!B.length?A(document):B},zIndex:function(C){if(C!==undefined){return this.css("zIndex",C)}if(this.length){C=A(this[0]);for(var B;C.length&&C[0]!==document;){B=C.css("position");if(B=="absolute"||B=="relative"||B=="fixed"){B=parseInt(C.css("zIndex"));if(!isNaN(B)&&B!=0){return B}}C=C.parent()}}return 0}});A.extend(A.expr[":"],{data:function(C,B,D){return !!A.data(C,D[3])},focusable:function(C){var B=C.nodeName.toLowerCase(),D=A.attr(C,"tabindex");return(/input|select|textarea|button|object/.test(B)?!C.disabled:"a"==B||"area"==B?C.href||!isNaN(D):!isNaN(D))&&!A(C)["area"==B?"parents":"closest"](":hidden").length},tabbable:function(C){var B=A.attr(C,"tabindex");return(isNaN(B)||B>=0)&&A(C).is(":focusable")}})}})(jQuery);
/*
 * jQuery UI Widget 1.8.2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(A){var B=A.fn.remove;A.fn.remove=function(C,D){return this.each(function(){if(!D){if(!C||A.filter(C,[this]).length){A("*",this).add(this).each(function(){A(this).triggerHandler("remove")})}}return B.call(A(this),C,D)})};A.widget=function(C,G,F){var E=C.split(".")[0],D;C=C.split(".")[1];D=E+"-"+C;if(!F){F=G;G=A.Widget}A.expr[":"][D]=function(H){return !!A.data(H,C)};A[E]=A[E]||{};A[E][C]=function(H,I){arguments.length&&this._createWidget(H,I)};G=new G;G.options=A.extend({},G.options);A[E][C].prototype=A.extend(true,G,{namespace:E,widgetName:C,widgetEventPrefix:A[E][C].prototype.widgetEventPrefix||C,widgetBaseClass:D},F);A.widget.bridge(C,A[E][C])};A.widget.bridge=function(C,D){A.fn[C]=function(H){var G=typeof H==="string",F=Array.prototype.slice.call(arguments,1),E=this;H=!G&&F.length?A.extend.apply(null,[true,H].concat(F)):H;if(G&&H.substring(0,1)==="_"){return E}G?this.each(function(){var J=A.data(this,C),I=J&&A.isFunction(J[H])?J[H].apply(J,F):J;if(I!==J&&I!==undefined){E=I;return false}}):this.each(function(){var I=A.data(this,C);if(I){H&&I.option(H);I._init()}else{A.data(this,C,new D(H,this))}});return E}};A.Widget=function(C,D){arguments.length&&this._createWidget(C,D)};A.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(C,E){this.element=A(E).data(this.widgetName,this);this.options=A.extend(true,{},this.options,A.metadata&&A.metadata.get(E)[this.widgetName],C);var D=this;this.element.bind("remove."+this.widgetName,function(){D.destroy()});this._create();this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(C,F){var E=C,D=this;if(arguments.length===0){return A.extend({},D.options)}if(typeof C==="string"){if(F===undefined){return this.options[C]}E={};E[C]=F}A.each(E,function(H,G){D._setOption(H,G)});return D},_setOption:function(C,D){this.options[C]=D;if(C==="disabled"){this.widget()[D?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",D)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(C,G,F){var E=this.options[C];G=A.Event(G);G.type=(C===this.widgetEventPrefix?C:this.widgetEventPrefix+C).toLowerCase();F=F||{};if(G.originalEvent){C=A.event.props.length;for(var D;C;){D=A.event.props[--C];G[D]=G.originalEvent[D]}}this.element.trigger(G,F);return !(A.isFunction(E)&&E.call(this.element[0],G,F)===false||G.isDefaultPrevented())}}})(jQuery);(function(E){E.ui=E.ui||{};var A=/left|center|right/,D=/top|center|bottom/,C=E.fn.position,B=E.fn.offset;E.fn.position=function(G){if(!G||!G.of){return C.apply(this,arguments)}G=E.extend({},G);var F=E(G.of),L=(G.collision||"flip").split(" "),K=G.offset?G.offset.split(" "):[0,0],J,I,H;if(G.of.nodeType===9){J=F.width();I=F.height();H={top:0,left:0}}else{if(G.of.scrollTo&&G.of.document){J=F.width();I=F.height();H={top:F.scrollTop(),left:F.scrollLeft()}}else{if(G.of.preventDefault){G.at="left top";J=I=0;H={top:G.of.pageY,left:G.of.pageX}}else{J=F.outerWidth();I=F.outerHeight();H=F.offset()}}}E.each(["my","at"],function(){var M=(G[this]||"").split(" ");if(M.length===1){M=A.test(M[0])?M.concat(["center"]):D.test(M[0])?["center"].concat(M):["center","center"]}M[0]=A.test(M[0])?M[0]:"center";M[1]=D.test(M[1])?M[1]:"center";G[this]=M});if(L.length===1){L[1]=L[0]}K[0]=parseInt(K[0],10)||0;if(K.length===1){K[1]=K[0]}K[1]=parseInt(K[1],10)||0;if(G.at[0]==="right"){H.left+=J}else{if(G.at[0]==="center"){H.left+=J/2}}if(G.at[1]==="bottom"){H.top+=I}else{if(G.at[1]==="center"){H.top+=I/2}}H.left+=K[0];H.top+=K[1];return this.each(function(){var P=E(this),N=P.outerWidth(),M=P.outerHeight(),O=E.extend({},H);if(G.my[0]==="right"){O.left-=N}else{if(G.my[0]==="center"){O.left-=N/2}}if(G.my[1]==="bottom"){O.top-=M}else{if(G.my[1]==="center"){O.top-=M/2}}O.left=parseInt(O.left);O.top=parseInt(O.top);E.each(["left","top"],function(R,Q){E.ui.position[L[R]]&&E.ui.position[L[R]][Q](O,{targetWidth:J,targetHeight:I,elemWidth:N,elemHeight:M,offset:K,my:G.my,at:G.at})});E.fn.bgiframe&&P.bgiframe();P.offset(E.extend(O,{using:G.using}))})};E.ui.position={fit:{left:function(G,F){var H=E(window);F=G.left+F.elemWidth-H.width()-H.scrollLeft();G.left=F>0?G.left-F:Math.max(0,G.left)},top:function(G,F){var H=E(window);F=G.top+F.elemHeight-H.height()-H.scrollTop();G.top=F>0?G.top-F:Math.max(0,G.top)}},flip:{left:function(G,F){if(F.at[0]!=="center"){var J=E(window);J=G.left+F.elemWidth-J.width()-J.scrollLeft();var I=F.my[0]==="left"?-F.elemWidth:F.my[0]==="right"?F.elemWidth:0,H=-2*F.offset[0];G.left+=G.left<0?I+F.targetWidth+H:J>0?I-F.targetWidth+H:0}},top:function(G,F){if(F.at[1]!=="center"){var K=E(window);K=G.top+F.elemHeight-K.height()-K.scrollTop();var J=F.my[1]==="top"?-F.elemHeight:F.my[1]==="bottom"?F.elemHeight:0,I=F.at[1]==="top"?F.targetHeight:-F.targetHeight,H=-2*F.offset[1];G.top+=G.top<0?J+F.targetHeight+H:K>0?J+I+H:0}}}};if(!E.offset.setOffset){E.offset.setOffset=function(G,F){if(/static/.test(E.curCSS(G,"position"))){G.style.position="relative"}var K=E(G),J=K.offset(),I=parseInt(E.curCSS(G,"top",true),10)||0,H=parseInt(E.curCSS(G,"left",true),10)||0;J={top:F.top-J.top+I,left:F.left-J.left+H};"using" in F?F.using.call(G,J):K.css(J)};E.fn.offset=function(G){var F=this[0];if(!F||!F.ownerDocument){return null}if(G){return this.each(function(){E.offset.setOffset(this,G)})}return B.call(this)}}})(jQuery);(function(A){A.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},_create:function(){this.originalTitle=this.element.attr("title");var C=this,B=C.options,H=B.title||C.originalTitle||"&#160;",G=A.ui.dialog.getTitleId(C.element),E=(C.uiDialog=A("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+B.dialogClass).css({zIndex:B.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(I){if(B.closeOnEscape&&I.keyCode&&I.keyCode===A.ui.keyCode.ESCAPE){C.close(I);I.preventDefault()}}).attr({role:"dialog","aria-labelledby":G}).mousedown(function(I){C.moveToTop(false,I)});C.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(E);var F=(C.uiDialogTitlebar=A("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(E),D=A('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){D.addClass("ui-state-hover")},function(){D.removeClass("ui-state-hover")}).focus(function(){D.addClass("ui-state-focus")}).blur(function(){D.removeClass("ui-state-focus")}).click(function(I){C.close(I);return false}).appendTo(F);(C.uiDialogTitlebarCloseText=A("<span></span>")).addClass("ui-icon ui-icon-closethick").text(B.closeText).appendTo(D);A("<span></span>").addClass("ui-dialog-title").attr("id",G).html(H).prependTo(F);if(A.isFunction(B.beforeclose)&&!A.isFunction(B.beforeClose)){B.beforeClose=B.beforeclose}F.find("*").add(F).disableSelection();B.draggable&&A.fn.draggable&&C._makeDraggable();B.resizable&&A.fn.resizable&&C._makeResizable();C._createButtons(B.buttons);C._isOpen=false;A.fn.bgiframe&&E.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var B=this;B.overlay&&B.overlay.destroy();B.uiDialog.hide();B.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");B.uiDialog.remove();B.originalTitle&&B.element.attr("title",B.originalTitle);return B},widget:function(){return this.uiDialog},close:function(C){var B=this,D;if(false!==B._trigger("beforeClose",C)){B.overlay&&B.overlay.destroy();B.uiDialog.unbind("keypress.ui-dialog");B._isOpen=false;if(B.options.hide){B.uiDialog.hide(B.options.hide,function(){B._trigger("close",C)})}else{B.uiDialog.hide();B._trigger("close",C)}A.ui.dialog.overlay.resize();if(B.options.modal){D=0;A(".ui-dialog").each(function(){if(this!==B.uiDialog[0]){D=Math.max(D,A(this).css("z-index"))}});A.ui.dialog.maxZ=D}return B}},isOpen:function(){return this._isOpen},moveToTop:function(C,B){var E=this,D=E.options;if(D.modal&&!C||!D.stack&&!D.modal){return E._trigger("focus",B)}if(D.zIndex>A.ui.dialog.maxZ){A.ui.dialog.maxZ=D.zIndex}if(E.overlay){A.ui.dialog.maxZ+=1;E.overlay.$el.css("z-index",A.ui.dialog.overlay.maxZ=A.ui.dialog.maxZ)}C={scrollTop:E.element.attr("scrollTop"),scrollLeft:E.element.attr("scrollLeft")};A.ui.dialog.maxZ+=1;E.uiDialog.css("z-index",A.ui.dialog.maxZ);E.element.attr(C);E._trigger("focus",B);return E},open:function(){if(!this._isOpen){var C=this,B=C.options,D=C.uiDialog;C.overlay=B.modal?new A.ui.dialog.overlay(C):null;D.next().length&&D.appendTo("body");C._size();C._position(B.position);D.show(B.show);C.moveToTop(true);B.modal&&D.bind("keypress.ui-dialog",function(G){if(G.keyCode===A.ui.keyCode.TAB){var E=A(":tabbable",this),F=E.filter(":first");E=E.filter(":last");if(G.target===E[0]&&!G.shiftKey){F.focus(1);return false}else{if(G.target===F[0]&&G.shiftKey){E.focus(1);return false}}}});A([]).add(D.find(".ui-dialog-content :tabbable:first")).add(D.find(".ui-dialog-buttonpane :tabbable:first")).add(D).filter(":first").focus();C._trigger("open");C._isOpen=true;return C}},_createButtons:function(C){var B=this,E=false,D=A("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");B.uiDialog.find(".ui-dialog-buttonpane").remove();typeof C==="object"&&C!==null&&A.each(C,function(){return !(E=true)});if(E){A.each(C,function(F,G){F=A('<button type="button"></button>').text(F).click(function(){G.apply(B.element[0],arguments)}).appendTo(D);A.fn.button&&F.button()});D.appendTo(B.uiDialog)}},_makeDraggable:function(){function C(G){return{position:G.position,offset:G.offset}}var B=this,F=B.options,E=A(document),D;B.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(H,G){D=F.height==="auto"?"auto":A(this).height();A(this).height(A(this).height()).addClass("ui-dialog-dragging");B._trigger("dragStart",H,C(G))},drag:function(H,G){B._trigger("drag",H,C(G))},stop:function(H,G){F.position=[G.position.left-E.scrollLeft(),G.position.top-E.scrollTop()];A(this).removeClass("ui-dialog-dragging").height(D);B._trigger("dragStop",H,C(G));A.ui.dialog.overlay.resize()}})},_makeResizable:function(C){function B(G){return{originalPosition:G.originalPosition,originalSize:G.originalSize,position:G.position,size:G.size}}C=C===undefined?this.options.resizable:C;var F=this,E=F.options,D=F.uiDialog.css("position");C=typeof C==="string"?C:"n,e,s,w,se,sw,ne,nw";F.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:F.element,maxWidth:E.maxWidth,maxHeight:E.maxHeight,minWidth:E.minWidth,minHeight:F._minHeight(),handles:C,start:function(H,G){A(this).addClass("ui-dialog-resizing");F._trigger("resizeStart",H,B(G))},resize:function(H,G){F._trigger("resize",H,B(G))},stop:function(H,G){A(this).removeClass("ui-dialog-resizing");E.height=A(this).height();E.width=A(this).width();F._trigger("resizeStop",H,B(G));A.ui.dialog.overlay.resize()}}).css("position",D).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var B=this.options;return B.height==="auto"?B.minHeight:Math.min(B.minHeight,B.height)},_position:function(C){var B=[],D=[0,0];C=C||A.ui.dialog.prototype.options.position;if(typeof C==="string"||typeof C==="object"&&"0" in C){B=C.split?C.split(" "):[C[0],C[1]];if(B.length===1){B[1]=B[0]}A.each(["left","top"],function(F,E){if(+B[F]===B[F]){D[F]=B[F];B[F]=E}})}else{if(typeof C==="object"){if("left" in C){B[0]="left";D[0]=C.left}else{if("right" in C){B[0]="right";D[0]=-C.right}}if("top" in C){B[1]="top";D[1]=C.top}else{if("bottom" in C){B[1]="bottom";D[1]=-C.bottom}}}}(C=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position({my:B.join(" "),at:B.join(" "),offset:D.join(" "),of:window,collision:"fit",using:function(F){var E=A(this).css(F).offset().top;E<0&&A(this).css("top",F.top-E)}});C||this.uiDialog.hide()},_setOption:function(C,B){var G=this,F=G.uiDialog,D=F.is(":data(resizable)"),E=false;switch(C){case"beforeclose":C="beforeClose";break;case"buttons":G._createButtons(B);break;case"closeText":G.uiDialogTitlebarCloseText.text(""+B);break;case"dialogClass":F.removeClass(G.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+B);break;case"disabled":B?F.addClass("ui-dialog-disabled"):F.removeClass("ui-dialog-disabled");break;case"draggable":B?G._makeDraggable():F.draggable("destroy");break;case"height":E=true;break;case"maxHeight":D&&F.resizable("option","maxHeight",B);E=true;break;case"maxWidth":D&&F.resizable("option","maxWidth",B);E=true;break;case"minHeight":D&&F.resizable("option","minHeight",B);E=true;break;case"minWidth":D&&F.resizable("option","minWidth",B);E=true;break;case"position":G._position(B);break;case"resizable":D&&!B&&F.resizable("destroy");D&&typeof B==="string"&&F.resizable("option","handles",B);!D&&B!==false&&G._makeResizable(B);break;case"title":A(".ui-dialog-title",G.uiDialogTitlebar).html(""+(B||"&#160;"));break;case"width":E=true;break}A.Widget.prototype._setOption.apply(G,arguments);E&&G._size()},_size:function(){var C=this.options,B;this.element.css({width:"auto",minHeight:0,height:0});B=this.uiDialog.css({height:"auto",width:C.width}).height();this.element.css(C.height==="auto"?{minHeight:Math.max(C.minHeight-B,0),height:"auto"}:{minHeight:0,height:Math.max(C.height-B,0)}).show();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});A.extend(A.ui.dialog,{version:"1.8.2",uuid:0,maxZ:0,getTitleId:function(B){B=B.attr("id");if(!B){this.uuid+=1;B=this.uuid}return"ui-dialog-title-"+B},overlay:function(B){this.$el=A.ui.dialog.overlay.create(B)}});A.extend(A.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:A.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(B){return B+".dialog-overlay"}).join(" "),create:function(C){if(this.instances.length===0){setTimeout(function(){A.ui.dialog.overlay.instances.length&&A(document).bind(A.ui.dialog.overlay.events,function(D){return A(D.target).zIndex()>=A.ui.dialog.overlay.maxZ})},1);A(document).bind("keydown.dialog-overlay",function(D){if(C.options.closeOnEscape&&D.keyCode&&D.keyCode===A.ui.keyCode.ESCAPE){C.close(D);D.preventDefault()}});A(window).bind("resize.dialog-overlay",A.ui.dialog.overlay.resize)}var B=(this.oldInstances.pop()||A("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});A.fn.bgiframe&&B.bgiframe();this.instances.push(B);return B},destroy:function(C){this.oldInstances.push(this.instances.splice(A.inArray(C,this.instances),1)[0]);this.instances.length===0&&A([document,window]).unbind(".dialog-overlay");C.remove();var B=0;A.each(this.instances,function(){B=Math.max(B,this.css("z-index"))});this.maxZ=B},height:function(){var C,B;if(A.browser.msie&&A.browser.version<7){C=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);B=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return C<B?A(window).height()+"px":C+"px"}else{return A(document).height()+"px"}},width:function(){var C,B;if(A.browser.msie&&A.browser.version<7){C=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);B=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return C<B?A(window).width()+"px":C+"px"}else{return A(document).width()+"px"}},resize:function(){var B=A([]);A.each(A.ui.dialog.overlay.instances,function(){B=B.add(this)});B.css({width:0,height:0}).css({width:A.ui.dialog.overlay.width(),height:A.ui.dialog.overlay.height()})}});A.extend(A.ui.dialog.overlay.prototype,{destroy:function(){A.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);(function(E){function D(){return ++C}function B(){return ++A}var C=0,A=0;E.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>'},_create:function(){this._tabify(true)},_setOption:function(G,F){if(G=="selected"){this.options.collapsible&&F==this.options.selected||this.select(F)}else{this.options[G]=F;this._tabify()}},_tabId:function(F){return F.title&&F.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+D()},_sanitizeSelector:function(F){return F.replace(/:/g,"\\:")},_cookie:function(){var F=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+B());return E.cookie.apply(null,[F].concat(E.makeArray(arguments)))},_ui:function(G,F){return{tab:G,panel:F,index:this.anchors.index(G)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var F=E(this);F.html(F.data("label.tabs")).removeData("label.tabs")})},_tabify:function(O){function N(R,S){R.css({display:""});!E.support.opacity&&S.opacity&&R[0].style.removeAttribute("filter")}this.list=this.element.find("ol,ul").eq(0);this.lis=E("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return E("a",this)[0]});this.panels=E([]);var Q=this,P=this.options,M=/^#.+/;this.anchors.each(function(T,U){var S=E(U).attr("href"),R=S.split("#")[0],V;if(R&&(R===location.toString().split("#")[0]||(V=E("base")[0])&&R===V.href)){S=U.hash;U.href=S}if(M.test(S)){Q.panels=Q.panels.add(Q._sanitizeSelector(S))}else{if(S!="#"){E.data(U,"href.tabs",S);E.data(U,"load.tabs",S.replace(/#.*$/,""));S=Q._tabId(U);U.href="#"+S;U=E("#"+S);if(!U.length){U=E(P.panelTemplate).attr("id",S).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(Q.panels[T-1]||Q.list);U.data("destroy.tabs",true)}Q.panels=Q.panels.add(U)}else{P.disabled.push(T)}}});if(O){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(P.selected===undefined){location.hash&&this.anchors.each(function(R,S){if(S.hash==location.hash){P.selected=R;return false}});if(typeof P.selected!="number"&&P.cookie){P.selected=parseInt(Q._cookie(),10)}if(typeof P.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){P.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}P.selected=P.selected||(this.lis.length?0:-1)}else{if(P.selected===null){P.selected=-1}}P.selected=P.selected>=0&&this.anchors[P.selected]||P.selected<0?P.selected:0;P.disabled=E.unique(P.disabled.concat(E.map(this.lis.filter(".ui-state-disabled"),function(R){return Q.lis.index(R)}))).sort();E.inArray(P.selected,P.disabled)!=-1&&P.disabled.splice(E.inArray(P.selected,P.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(P.selected>=0&&this.anchors.length){this.panels.eq(P.selected).removeClass("ui-tabs-hide");this.lis.eq(P.selected).addClass("ui-tabs-selected ui-state-active");Q.element.queue("tabs",function(){Q._trigger("show",null,Q._ui(Q.anchors[P.selected],Q.panels[P.selected]))});this.load(P.selected)}E(window).bind("unload",function(){Q.lis.add(Q.anchors).unbind(".tabs");Q.lis=Q.anchors=Q.panels=null})}else{P.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[P.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");P.cookie&&this._cookie(P.selected,P.cookie);O=0;for(var L;L=this.lis[O];O++){E(L)[E.inArray(O,P.disabled)!=-1&&!E(L).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}P.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(P.event!="mouseover"){var K=function(R,S){S.is(":not(.ui-state-disabled)")&&S.addClass("ui-state-"+R)},I=function(R,S){S.removeClass("ui-state-"+R)};this.lis.bind("mouseover.tabs",function(){K("hover",E(this))});this.lis.bind("mouseout.tabs",function(){I("hover",E(this))});this.anchors.bind("focus.tabs",function(){K("focus",E(this).closest("li"))});this.anchors.bind("blur.tabs",function(){I("focus",E(this).closest("li"))})}var J,H;if(P.fx){if(E.isArray(P.fx)){J=P.fx[0];H=P.fx[1]}else{J=H=P.fx}}var G=H?function(R,S){E(R).closest("li").addClass("ui-tabs-selected ui-state-active");S.hide().removeClass("ui-tabs-hide").animate(H,H.duration||"normal",function(){N(S,H);Q._trigger("show",null,Q._ui(R,S[0]))})}:function(R,S){E(R).closest("li").addClass("ui-tabs-selected ui-state-active");S.removeClass("ui-tabs-hide");Q._trigger("show",null,Q._ui(R,S[0]))},F=J?function(R,S){S.animate(J,J.duration||"normal",function(){Q.lis.removeClass("ui-tabs-selected ui-state-active");S.addClass("ui-tabs-hide");N(S,J);Q.element.dequeue("tabs")})}:function(R,S){Q.lis.removeClass("ui-tabs-selected ui-state-active");S.addClass("ui-tabs-hide");Q.element.dequeue("tabs")};this.anchors.bind(P.event+".tabs",function(){var T=this,U=E(this).closest("li"),S=Q.panels.filter(":not(.ui-tabs-hide)"),R=E(Q._sanitizeSelector(this.hash));if(U.hasClass("ui-tabs-selected")&&!P.collapsible||U.hasClass("ui-state-disabled")||U.hasClass("ui-state-processing")||Q._trigger("select",null,Q._ui(this,R[0]))===false){this.blur();return false}P.selected=Q.anchors.index(this);Q.abort();if(P.collapsible){if(U.hasClass("ui-tabs-selected")){P.selected=-1;P.cookie&&Q._cookie(P.selected,P.cookie);Q.element.queue("tabs",function(){F(T,S)}).dequeue("tabs");this.blur();return false}else{if(!S.length){P.cookie&&Q._cookie(P.selected,P.cookie);Q.element.queue("tabs",function(){G(T,R)});Q.load(Q.anchors.index(this));this.blur();return false}}}P.cookie&&Q._cookie(P.selected,P.cookie);if(R.length){S.length&&Q.element.queue("tabs",function(){F(T,S)});Q.element.queue("tabs",function(){G(T,R)});Q.load(Q.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}E.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var F=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var H=E.data(this,"href.tabs");if(H){this.href=H}var G=E(this).unbind(".tabs");E.each(["href","load","cache"],function(I,J){G.removeData(J+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){E.data(this,"destroy.tabs")?E(this).remove():E(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});F.cookie&&this._cookie(null,F.cookie);return this},add:function(K,J,G){if(G===undefined){G=this.anchors.length}var F=this,I=this.options;J=E(I.tabTemplate.replace(/#\{href\}/g,K).replace(/#\{label\}/g,J));K=!K.indexOf("#")?K.replace("#",""):this._tabId(E("a",J)[0]);J.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var H=E("#"+K);H.length||(H=E(I.panelTemplate).attr("id",K).data("destroy.tabs",true));H.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(G>=this.lis.length){J.appendTo(this.list);H.appendTo(this.list[0].parentNode)}else{J.insertBefore(this.lis[G]);H.insertBefore(this.panels[G])}I.disabled=E.map(I.disabled,function(L){return L>=G?++L:L});this._tabify();if(this.anchors.length==1){I.selected=0;J.addClass("ui-tabs-selected ui-state-active");H.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){F._trigger("show",null,F._ui(F.anchors[0],F.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[G],this.panels[G]));return this},remove:function(I){var H=this.options,G=this.lis.eq(I).remove(),F=this.panels.eq(I).remove();if(G.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(I+(I+1<this.anchors.length?1:-1))}H.disabled=E.map(E.grep(H.disabled,function(J){return J!=I}),function(J){return J>=I?--J:J});this._tabify();this._trigger("remove",null,this._ui(G.find("a")[0],F[0]));return this},enable:function(G){var F=this.options;if(E.inArray(G,F.disabled)!=-1){this.lis.eq(G).removeClass("ui-state-disabled");F.disabled=E.grep(F.disabled,function(H){return H!=G});this._trigger("enable",null,this._ui(this.anchors[G],this.panels[G]));return this}},disable:function(G){var F=this.options;if(G!=F.selected){this.lis.eq(G).addClass("ui-state-disabled");F.disabled.push(G);F.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[G],this.panels[G]))}return this},select:function(F){if(typeof F=="string"){F=this.anchors.index(this.anchors.filter("[href$="+F+"]"))}else{if(F===null){F=-1}}if(F==-1&&this.options.collapsible){F=this.options.selected}this.anchors.eq(F).trigger(this.options.event+".tabs");return this},load:function(K){var J=this,G=this.options,F=this.anchors.eq(K)[0],I=E.data(F,"load.tabs");this.abort();if(!I||this.element.queue("tabs").length!==0&&E.data(F,"cache.tabs")){this.element.dequeue("tabs")}else{this.lis.eq(K).addClass("ui-state-processing");if(G.spinner){var H=E("span",F);H.data("label.tabs",H.html()).html(G.spinner)}this.xhr=E.ajax(E.extend({},G.ajaxOptions,{url:I,success:function(M,N){E(J._sanitizeSelector(F.hash)).html(M);J._cleanup();G.cache&&E.data(F,"cache.tabs",true);J._trigger("load",null,J._ui(J.anchors[K],J.panels[K]));try{G.ajaxOptions.success(M,N)}catch(L){}},error:function(M,N){J._cleanup();J._trigger("load",null,J._ui(J.anchors[K],J.panels[K]));try{G.ajaxOptions.error(M,N,K,F)}catch(L){}}}));J.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},url:function(G,F){this.anchors.eq(G).removeData("cache.tabs").data("load.tabs",F);return this},length:function(){return this.anchors.length}});E.extend(E.ui.tabs,{version:"1.8.2"});E.extend(E.ui.tabs.prototype,{rotation:null,rotate:function(J,I){var G=this,F=this.options,H=G._rotate||(G._rotate=function(K){clearTimeout(G.rotation);G.rotation=setTimeout(function(){var L=F.selected;G.select(++L<G.anchors.length?L:0)},J);K&&K.stopPropagation()});I=G._unrotate||(G._unrotate=!I?function(K){K.clientX&&G.rotate(null)}:function(){t=F.selected;H()});if(J){this.element.bind("tabsshow",H);this.anchors.bind(F.event+".tabs",I);H()}else{clearTimeout(G.rotation);this.element.unbind("tabsshow",H);this.anchors.unbind(F.event+".tabs",I);delete this._rotate;delete this._unrotate}return this}})})(jQuery);window.log=function(){log.history=log.history||[];log.history.push(arguments);if(this.console){console.log(Array.prototype.slice.call(arguments))}};var loader_img='<img src="/static/agdpresentation/images/loader.gif" alt="" class="loader" />';(function(C){var A=C.scrollTo=function(F,E,D){C(window).scrollTo(F,E,D)};A.defaults={axis:"xy",duration:parseFloat(C.fn.jquery)>=1.3?0:1};A.window=function(D){return C(window)._scrollable()};C.fn._scrollable=function(){return this.map(function(){var E=this,D=!E.nodeName||C.inArray(E.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!D){return E}var F=(E.contentWindow||E).document||E.ownerDocument||E;return C.browser.safari||F.compatMode=="BackCompat"?F.body:F.documentElement})};C.fn.scrollTo=function(F,E,D){if(typeof E=="object"){D=E;E=0}if(typeof D=="function"){D={onAfter:D}}if(F=="max"){F=9000000000}D=C.extend({},A.defaults,D);E=E||D.speed||D.duration;D.queue=D.queue&&D.axis.length>1;if(D.queue){E/=2}D.offset=B(D.offset);D.over=B(D.over);return this._scrollable().each(function(){var L=this,J=C(L),K=F,I,G={},M=J.is("html,body");switch(typeof K){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(K)){K=B(K);break}K=C(K,this);case"object":if(K.is||K.style){I=(K=C(K)).offset()}}C.each(D.axis.split(""),function(Q,R){var S=R=="x"?"Left":"Top",U=S.toLowerCase(),P="scroll"+S,O=L[P],N=A.max(L,R);if(I){G[P]=I[U]+(M?0:O-J.offset()[U]);if(D.margin){G[P]-=parseInt(K.css("margin"+S))||0;G[P]-=parseInt(K.css("border"+S+"Width"))||0}G[P]+=D.offset[U]||0;if(D.over[U]){G[P]+=K[R=="x"?"width":"height"]()*D.over[U]}}else{var T=K[U];G[P]=T.slice&&T.slice(-1)=="%"?parseFloat(T)/100*N:T}if(/^\d+$/.test(G[P])){G[P]=G[P]<=0?0:Math.min(G[P],N)}if(!Q&&D.queue){if(O!=G[P]){H(D.onAfterFirst)}delete G[P]}});H(D.onAfter);function H(N){J.animate(G,E,D.easing,N&&function(){N.call(this,F,D)})}}).end()};A.max=function(J,I){var H=I=="x"?"Width":"Height",E="scroll"+H;if(!C(J).is("html,body")){return J[E]-C(J)[H.toLowerCase()]()}var G="client"+H,F=J.ownerDocument.documentElement,D=J.ownerDocument.body;return Math.max(F[E],D[E])-Math.min(F[G],D[G])};function B(D){return typeof D=="object"?D:{top:D,left:D}}})(jQuery);function prettyDate(E){var C=new Date((E||"").replace(/-/g,"/").replace(/[TZ]/g," ")),D=(((new Date()).getTime()-C.getTime())/1000),A=Math.floor(D/86400);var B=new Array("januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december");if(isNaN(A)||A<0||A>=3){curr_min=C.getMinutes()+"";if(curr_min.length==1){curr_min="0"+curr_min}return C.getDate()+" "+B[C.getMonth()]+" "+C.getFullYear()+", "+C.getHours()+":"+curr_min}return A==0&&(D<120&&"1 minuut geleden"||D<3600&&Math.floor(D/60)+" minuten geleden"||D<7200&&"1 uur geleden"||D<86400&&Math.floor(D/3600)+" uur geleden")||A==1&&"Gisteren"||A<3&&A+" dagen geleden"}function fixRoundedCorners(){var A='<span class="tl"></span>';var B='<span class="tr"></span>';$(".roundedTop").each(function(){if($(this).hasClass("roundedTop")){if($(this).html()!==""){$(this).append(B+A)}}})}if(typeof jQuery!="undefined"){jQuery.fn.prettyDate=function(){return this.each(function(){var B;var A=prettyDate(this.title);if(A.search("NaN")>=0){B=jQuery(this).children("p").text();var A=prettyDate(B)}else{B=this.title;if(A){jQuery(this).attr("title",A)}}jQuery(this).empty();jQuery(this).append(A+'<p style="display:none">'+B+"</p>")})};jQuery.fn.clearDefault=function(){return this.each(function(){var A=$(this).val();$(this).focus(function(){if($(this).val()==A){$(this).val("")}});$(this).blur(function(){if($(this).val()==""){$(this).val(A)}})})};jQuery.fn.extend({dgStyle:function(){$.each($(this),function(){var A=$(this).children().get(0);elmType=$(A).attr("type");$(this).data("type",elmType);$(this).data("checked",$(A).attr("checked"));$(this).dgClear()});$(this).mousedown(function(){$(this).dgClear()});$(this).mouseup(function(){$(this).dgHandle()});$(this).hover(function(){$(this).dgHover()},function(){$(this).dgClear()});$(this).each(function(){var B=$(this);var C=B.find("input").get(0).id;var A=$("label[for="+C+"]");A.mousedown(function(){B.dgClear()});A.mouseup(function(){B.dgHandle()});A.hover(function(){B.dgHover()},function(){B.dgClear()})})},dgClear:function(){if($(this).data("checked")){$(this).css("backgroundPosition","-34px -24px")}else{$(this).css("backgroundPosition","0 -24px")}},dgHover:function(){if(!$(this).data("checked")){$(this).css("backgroundPosition","-17px -24px")}},dgHandle:function(){var A=$(this).children().get(0);if($(this).data("checked")==true){$(A).dgUncheck(this)}else{$(A).dgCheck(this)}if($(this).data("type")=="radio"){$.each($("input[name='"+$(A).attr("name")+"']"),function(){if(A!=this){$(this).dgUncheck(-1)}})}},dgCheck:function(A){$(this).attr("checked",true);$(A).data("checked",true).css({backgroundPosition:"-34px -24px"});$(A).trigger("radio:check")},dgUncheck:function(A){$(this).attr("checked",false);if(A!=-1){$(A).data("checked",false).css({backgroundPosition:"0 -24px"})}else{$(this).parent().data("checked",false).css({backgroundPosition:"0 -24px"})}$(A).trigger("radio:uncheck")}});$.fn.photoplayer=function(B){var A={autoplay:false,index:0,delay:3000,isModal:false,slides:".slides",nextBtn:"span.next",prevBtn:"span.prev",playBtn:"span.toggle",fsBtn:"span.fullscreen",infoLabel:".player-info",titleLabel:".player-tools .title",currentLabel:".player-tools .slide-number .current",totalLabel:".player-tools .slide-number .total"};if(B){$.extend(A,B)}this.each(function(){var R=$(this),Q=R.find(A.slides).children(),T=R.find(A.nextBtn),H=R.find(A.prevBtn),M=R.find(A.playBtn),S=R.find(A.fsBtn),D=R.find(A.infoLabel),I=R.find(A.titleLabel),E=R.find(A.currentLabel),X=R.find(A.totalLabel),P=A.index,L=A.autoplay;Q.find("a").click(function(){return false});Q.css({height:A.isModal?537:313+"px",overflow:"hidden"});Q.hide();T.click(O);H.click(N);S.click(C);M.click(function(){L?F():V()});if(L){V()}if(A.isModal){S.hide()}U(A.index);function U(a){P=a;var Z=$(Q[a]);Q.hide();Z.fadeIn();I.text(Z.find("h4").text());D.text(Z.find("p").text());X.text(Q.length);E.text(a+1);R.data("current",P)}function O(){(P<Q.length-1)?U(P+1):U(0)}function N(){(P>0)?U(P-1):U(Q.length-1)}function V(){L=true;R.data("autoplay",L);M.removeClass("play");M.addClass("pause");setTimeout(W,A.delay)}function F(){L=false;R.data("autoplay",L);M.removeClass("pause");M.addClass("play")}function W(){if(L){O();setTimeout(W,A.delay)}}function C(){AGD.modal.show();var a=AGD.modal.get();var b=R.clone();b.find("a img").each(function(){$(this).attr("src",$(this).parent().attr("href"))});a.find(".jqmContent").html(b);var Z=a.find(".player");Z.photoplayer({isModal:true,index:P,autoplay:L});if(!A.isModal){AGD.modal.get().bind("modal:close",G)}F()}function G(a){a.stopPropagation();var Z=AGD.modal.get().find(".player");U(Z.data("current"));if(Z.data("autoplay")){V()}else{F()}AGD.modal.remove();AGD.modal.get().unbind("modal:close",G)}R.find(A.slides).hover(K,Y);function K(){$(document).bind("keydown",J)}function Y(){$(document).unbind("keydown",J)}function J(Z){if(Z.keyCode==37){N();return false}else{if(Z.keyCode==39){O();return false}}}});return this};$.fn.paginate=function(B){var A={loader:loader_img};if(B){$.extend(A,B)}this.each(function(){var E=$(this),C=E.find(".pagination");C.find("li a").click(D);function D(F){C.append(A.loader);F.preventDefault();$.get($(this).attr("href"),function(G){E.html(G).fadeIn("fast");C=E.find(".pagination");C.find("li a").click(D)})}});return this};$.fn.toggleRadio=function(){this.each(function(){var C=$(this),B=C.attr("rel"),D=C.attr("name");A();if($("#"+B).size()!=0){$("input:radio[name="+D+"]").bind($.browser.msie?"click":"change",A)}function A(F){var E=$("#"+B).parent();if(C.attr("checked")){if(E.hasClass("hidden")){E.removeClass("hidden")}}else{if(!E.hasClass("hidden")){E.addClass("hidden")}}}});return this};$.fn.toggleForm=function(){this.each(function(){var C=$(this),A=C.find(".disabled"),I=C.next(".submit").find('input[type="button"]').toggle(F,E),H=C.next(".submit").find('input[type="submit"]'),B={change:I.val(),cancel:"< annuleren"},D=C.find(".profile-picture"),G=C.find(".input_password_hidden");E(true);function F(J){if(J){J.target.blur()}I.val(B.cancel);H.removeClass("hidden");if(D.size()!==0){$(".profile-picture").removeClass("disabled")}if(G.size()!==0){G.hide();G.siblings("input").removeClass("hidden");G.parent().next().removeClass("hidden")}A.each(function(){if(!$(this).hasClass("noneditable")){$(this).attr("disabled","");$(this).removeClass("disabled")}});return false}function E(J){keepErrorFragments=false;if(J&&J==true){keepErrorFragments=true}if(!keepErrorFragments){$(".error.wmfragment",C).remove()}$(".initial-prefilling",C).each(function(){var K=$(this).attr("value");if($(this).prev().attr("type")=="checkbox"||$(this).prev().attr("type")=="radio"){if(K=="true"){$(this).prev().attr("checked","checked")}}else{$(this).prev().attr("value",K)}});I.val(B.change);H.addClass("hidden");if(D.size()!==0){$(".profile-picture").addClass("disabled")}if(G.size()!==0){G.show();G.siblings("input").addClass("hidden");G.parent().next().addClass("hidden")}A.each(function(){$(this).attr("disabled","disabled");$(this).addClass("disabled")});return false}});return this}}var AGD={numNotifications:0,init:function(){$(".block-tabs").each(function(){var K=$(this).tabs()});AGD.prettyDate();var D=new Date(),B=D.getDate(),G=D.getDay(),C=D.getMonth(),E=D.getFullYear(),I=["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag"],A=["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],J=I[G]+" <strong>"+B+" "+A[C]+" "+E+"</strong>";$("#widget-date").html(J);var H=$("#userPanel").find(".login");function F(K){if(K.keyCode){if(K.keyCode===27){$(document).unbind("keydown",F);H.removeClass("open")}else{return }}if($(K.target).parents().index($("#header .login"))===-1){$(document).unbind("click",F);H.removeClass("open")}}$("#userPanel").find(".login-button").click(function(K){K.stopPropagation();K.preventDefault();H.toggleClass("open");$(this).blur();$(document).bind("click",F);$(document).bind("keydown",F)});AGD.polls.init();$(".player").photoplayer();AGD.notifications.init();$(".paginated").paginate();if($.browser.msie){$("#nav").find("li").each(function(){$(this).hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")})});if(parseInt(jQuery.browser.version)<7){$('#form-search input[type="submit"]').hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")});$("#userPanel li").hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")})}if(parseInt(jQuery.browser.version)<8){$("#left-column .block-post:first-child").addClass("first")}$("form").prepend('<input type="submit" class="hidden"  />');$("input:checkbox").click(function(){this.blur();this.focus()})}if($.browser.msie){fixRoundedCorners()}$('#form-search input[type="text"]').clearDefault();$(".check-all").change(function(){$(this).parents("ul").children().find("input[type=checkbox]").attr("checked",$(this).attr("checked"))});$(".actions .delete").click(function(K){K.preventDefault();AGD.message($(this).attr("title")+' <a href="#'+$(this).parents("form").attr("id")+'" title="" class="confirm">Ja ik weet het zeker</a>')});$(".notification a.confirm").live("click",function(K){K.preventDefault();$("#"+$(this).attr("href").split("#")[1]).submit()});$(".change-profile-pic").click(function(K){K.preventDefault();$(this).hide();$(this).prev().hide();$(this).parent().append('<div><input type="file" /> <a href="#" title="" class="cancel-upload">annuleren</a></div>')});$(".cancel-upload").live("click",function(K){K.preventDefault();$(this).parent().siblings().show();$(this).parent().remove()});$(".toggle-form").toggleForm();$("input[type=radio].toggle").toggleRadio();AGD.closedMessage()},closedMessage:function(){if($(".link-trigger")||$(".link-trigger-lightbox")){$(".closed-message-big").hide()}function A(C){var E=false;var D=[".closed-message",".closed-message-big","#header-holder","#logo","#footer-area",".allow-clicks"];var B=(C.is("a")||C.parents("a").length>0);if(B){E=(C.is(D.join(","))||C.parents(D.join(",")).length===0)}return E}$(".link-trigger").click(function(C){var B=$(C.target);if(A(B)){C.preventDefault();C.stopImmediatePropagation();$(".closed-message-big").show();$("body").addClass("closed");$.scrollTo("#content",500)}});$(".link-trigger-lightbox").click(function(E){var B=$(E.target);if(A(B)){E.preventDefault();E.stopImmediatePropagation();AGD.modal.show();var C=AGD.modal.get();var D=$("#lightbox-closed");$(".closed-message-big").show();$("#modal").addClass("closedMessageModal");C.find(".jqmContent").html(D)}})},prettyDate:function(){$("span.date").prettyDate();setTimeout(AGD.prettyDate,5000)},modal:{create:function(){if(!$("#modal").get(0)){$("body").prepend('<div class="modal-wrapper"><div class="jqmWindow" id="modal"><span class="icon close">Sluiten</span><div class="jqmContent"></div></div>')}$("#modal").jqm({overlay:80,onHide:AGD.modal.onClose});$("#modal").jqmAddClose($("#modal").find(".close"))},show:function(){if(!$("#modal").get(0)){AGD.modal.create()}$("#modal").css({top:$(document).scrollTop()+60+"px"});$("#modal").jqmShow()},remove:function(){$("#modal").jqmHide();if($("#modal-wrapper").get(0)){$("#modal-wrapper").remove()}},get:function(){return $("#modal")},onClose:function(A){$("#modal").trigger("modal:close");A.w.fadeOut("fast",function(){A.o.remove()})}},polls:{init:function(){$("span.radio").dgStyle();$("div.poll.block").each(function(){var A=$(this).find("form");var B={url:A.attr("action"),pollContainer:A.parent(".poll"),value:""};A.find("span.radio").bind("radio:check",function(){B.value=$(this).find("input").val();AGD.polls.send(B)});$(this).find(".showResults").click(function(C){AGD.polls.get(B);C.preventDefault()})})},send:function(A){AGD.polls.get(A)},get:function(A){$.get(A.url,A.value,function(B){$(A.pollContainer).fadeOut(function(){$(this).html(B)}).fadeIn("slow")})}},notifications:{init:function(){$(".notification").live("click",function(){$(this).fadeOut("fast",function(){$(this).remove();--AGD.numNotifications})});$(".inappropriate").live("click",function(A){AGD.notifications.get({url:$(this).attr("href")});A.preventDefault()})},get:function(A){$.getJSON(A.url,function(B){AGD.notifications.show(B.message)})},show:function(B){if(AGD.notifications.isUnique(B)){var A=(AGD.numNotifications>0)?"<em>("+AGD.numNotifications+")</em>":"";$("body").append('<div class="notification"><p>'+A+' <span class="msg">'+B+'</span>.<span class="icon close"></span></p></div>');$(".notification").fadeIn("fast");++AGD.numNotifications}},isUnique:function(C){var A=true;var B=document.createElement("div");B.innerHTML=C;$(".notification .msg").each(function(){if($(this).text()===$(B).text()){A=false}});document.removeE;return A}},message:function(A){AGD.notifications.show(A)}};$(document).ready(AGD.init);var WebmanagerFormStateRegistry={};var GX_AGD={trim_beforepatrn:/^\s\s/,trim_afterpatrn:/\s\s*$/,contextPath:"",init:function(){GX_AGD.form.init();GX_AGD.loginForm.init();GX_AGD.profile.init();GX_AGD.favourites.init();GX_AGD.inappropriate.init();GX_AGD.startpage.init();GX_AGD.limitMaxlength($("textarea[maxlength]"));GX_AGD.checkCookiesEnabled()},closeMessage:function(){if($(".notification:last").length>0){$(".notification:last").remove()}},form:{submitting:false,errortabs:new Array(),init:function(){$(".wmpform").each(function(){var htmlFormId=$(this).attr("id");var submitting=false;var formId=htmlFormId.split("_")[1];if(typeof WebmanagerFormStateRegistry[htmlFormId]=="undefined"||!WebmanagerFormStateRegistry[htmlFormId]){try{WebmanagerFormStateRegistry[htmlFormId]=eval("new FormState_"+formId+"()")}catch(e){}}$(this).submit(function(event){if(!GX_AGD.form.submitting){GX_AGD.form.submitting=true;if(event.target.className==""){event.preventDefault()}if(GX_AGD.favourites.submitting){event.preventDefault();return }result=GX_AGD.form.validateForm(htmlFormId);if(!result){event.preventDefault();GX_AGD.form.submitting=false}}else{event.preventDefault()}});$(":input",$(this)).each(function(){if($(this).attr("type")=="submit"){$(this).bind("focus",function(event){$(this).parents(".wmpform").submit()})}else{if(($(this).attr("type")!="hidden")&&($(this).attr("type")!="button")&&(!$(this).hasClass("non-wmpform"))&&(!$(this).hasClass("noneditable"))){$(this).bind("blur",function(event){var formState=WebmanagerFormStateRegistry[$(this).parents("form").attr("id")];GX_AGD.form.validateInput(formState,$(this))})}}})});if($(".form-message",".wmpform").length>0){AGD.message($(".form-message",".wmpform").html())}},validateForm:function(F){var E=$("#go_back");if(typeof E!=undefined&&E.val()=="true"){return true}var B=F;hasError=false;if(B!="undefined"&&B!=""){var D=WebmanagerFormStateRegistry[B];if(typeof D!="undefined"&&D!=""){var C=new Array();GX_AGD.form.errortabs=new Array();var A=$("#"+F);$(":input",A).each(function(){var G=$(this).attr("name");if(($(this).attr("type")!="hidden")&&($(this).attr("type")!="submit")&&($(this).attr("type")!="button")&&(!$(this).hasClass("non-wmpform"))&&(!$(this).hasClass("disabled"))&&!C.contains(G)&&G!=""){C.push(G);if(!GX_AGD.form.validateInput(D,$(this))){hasError=true}}})}}return !hasError},validateInput:function(E,B){var C=B.attr("name");var G=GX_AGD.form.getValue(B);$("#error_"+C.replace(".","_")).remove();if(C=="wachtwoord"){$("#error_bevestig_wachtwoord".replace(".","_")).remove()}var A=E.validateAndReturnMessage(C,G);var F="";for(var D in A){if(D!=undefined&&D!=""&&D!="undefined"){F+=A[D]+"<br/>"}}if(F!=undefined&&F!=""&&F!="undefined<br/>"){B.parent().append('<span id="error_'+C.replace(".","_")+'" class="error wmfragment">'+F+"</span>");return false}return true},getValue:function(C){var B=C.val();if(C.attr("type")=="radio"){B=$("input[name="+C.attr("name")+"]:checked").val()}else{if(C.attr("type")=="checkbox"){var A=$("input:checkbox[name="+C.attr("name")+"]:checked");B=new Array();A.each(function(){B.push($(this).val())})}else{if($(C).attr("title")!=""&&B==$(C).attr("title")){B=""}}}return B}},loginForm:{init:function(){jDestObj=$("#userPanel").find("p.submit.clearfix");jSrcObj=$("#userPanel").find(".remember");if(jDestObj.length>0&&jSrcObj.length>0){var B=document.createElement("SPAN"),A=jQuery(B);B.className="remember";A.html(jSrcObj.html());jSrcObj.remove();jDestObj.append(A)}if(($.browser.msie)&&(parseInt(jQuery.browser.version)<8)){$("#userPanel").hover(function(){$("#logout").addClass("hidden")},function(){$("#logout").removeClass("hidden")})}if($(".form-message-error","#userPanel").length>0||$("span.error","#userPanel").length>0){var E=$(".login","#userPanel").toggleClass("open")}if($(".link-trigger-lightbox")||$(".link-trigger")){$(".closed-message-big").hide();if(E==undefined&&$(".form-message-error",".inline-login-form").length>0){if($("#lightbox-closed").length>0){AGD.modal.show();var C=AGD.modal.get();var D=$("#lightbox-closed");$(".closed-message-big").show();$("#modal").addClass("closedMessageModal");C.find(".jqmContent").html(D)}$(".closed-message").show()}}}},profile:{init:function(){$(".change-profile-pic").unbind("click");$(".change-profile-pic").click(function(A){A.preventDefault();$(this).parent().hide();$(".new-profile-picture").show()});$("input[id='wmformfragment_username']").focus(function(A){$("p#form_error_USERNAME_EXISTS").remove();$(".form-message-error:empty").hide()});$(".cancel-new-profile-pic").click(function(A){A.preventDefault();$(this).parent().hide();$(".profile-picture").show()});$(".jqPlacenexttoprevious").each(function(){$(this).removeClass("jqPlacenexttoprevious");jqParent=$(this).parent();jqLastInput=$("input:last",jqParent.prev());$(this).insertAfter(jqLastInput);jqErrorMsg=$("span.error",jqParent);if(jqErrorMsg.length){jqErrorMsg.insertAfter($(this))}jqParent.remove()});$(":input",$(".toggle-form")).each(function(){if($(this).next().length==0||!$(this).next().hasClass("initial-prefilling")){var A=$(this).attr("type");if((A!="hidden")&&(A!="submit")&&(A!="button")&&(!$(this).hasClass("non-wmpform"))){if(A=="checkbox"||A=="radio"){$(this).after('<input type="hidden" class="initial-prefilling" value="'+$(this).attr("checked")+'" />')}else{inputvalue=$(this).attr("value");$(this).after('<input type="hidden" class="initial-prefilling" value="'+inputvalue+'" />');inputvalue=$(this).next().attr("value").replace("&apos;","'");while(inputvalue.indexOf("&apos;")>=0){inputvalue=inputvalue.replace("&apos;","'")}inputvalue=inputvalue.replace("&#10;"," ");$(this).attr("value",inputvalue);$(this).next().attr("value",inputvalue)}}}})}},favourites:{submitting:false,count:0,MSG_OK:"Het artikel is toegevoegd aan uw knipsels. Ga naar uw profiel pagina om uw knipsels te raadplegen.",MSG_FOUND:"Het artikel is al toegevoegd als knipsel. Ga naar uw profiel pagina om uw knipsels te raadplegen.",MSG_ERROR:"Er is een fout opgetreden, het knipsel is niet toegevoegd",init:function(){$.ajax({type:"GET",url:GX_AGD.contextPath+"/wcbservlet/com.gxwebmanager.solutions.favouritemediaitems.servlet",dataType:"json",cache:false,success:function(C){var B=new String(C).replace(GX_AGD.trim_beforepatrn,"").replace(GX_AGD.trim_afterpatrn,"");GX_AGD.favourites.count=B;GX_AGD.favourites.updatecount()}});GX_AGD.favourites.MSG_OK=$(".favourites-msg-ok").html();GX_AGD.favourites.MSG_FOUND=$(".favourites-msg-found").html();$(".gx_addfavourite").click(function(C){C.preventDefault();var B=$(this).next();if(B.length>0&&B.get(0).nodeName=="FORM"){doAjaxSubmit(B,GX_AGD.favourites.callbackfunction);$(this).remove()}});var A=$("#placeholder_mijn_knipsels").parents(".tab-content");A.html("");$("#favouritesForm").appendTo(A);$(".check-all").live("click",function(){$(this).parents("ul").children().find("input[type=checkbox]").attr("checked",$(this).attr("checked"))});$(".actions .favs_delete").live("click",function(B){B.preventDefault();AGD.message($(this).attr("title")+' <a href="#'+$(this).parents("form").attr("id")+'" title="" class="favs_confirm">Ja ik weet het zeker</a>')});$(".notification a.favs_confirm").live("click",function(B){B.preventDefault();GX_AGD.closeMessage();GX_AGD.favourites.submitting=true;$("#"+$(this).attr("href").split("#")[1]).trigger("submit")});$("#favouritesForm").submit(function(B){B.preventDefault();doAjaxSubmit($(this),GX_AGD.favourites.callbackfunction)})},updatecount:function(){$(".favourites-count").each(function(){var A=GX_AGD.favourites.count.replace(GX_AGD.trim_beforepatrn,"").replace(GX_AGD.trim_afterpatrn,"");if(A!=""){$(this).html("("+A+")")}else{$(this).html("")}})},callbackfunction:function(A){if(A==null){AGD.message(GX_AGD.favourites.MSG_ERROR)}else{if(A.result!=undefined){if(A.result=="OK"){AGD.message(GX_AGD.favourites.MSG_OK)}else{if(A.result=="FOUND"){AGD.message(GX_AGD.favourites.MSG_FOUND)}}}else{if(A.favourites!=undefined){if(A.favourites=="OK"){$.get(queryFavouritesLink,function(B){$("#favouritesForm").html(B)})}}else{AGD.message(MSG_ERROR)}}}if(A!=null&&A.count!=undefined){GX_AGD.favourites.count=A.count.replace(GX_AGD.trim_beforepatrn,"").replace(GX_AGD.trim_afterpatrn,"");GX_AGD.favourites.updatecount()}GX_AGD.favourites.submitting=false}},inappropriate:{init:function(){$(".inappropriate").live("click",function(B){messageid=$(this).attr("messageid");var A=$("input[name='wmstepid'][value='notappropriate']").parent();$(A).children("input[name='clientsideRouting']:first").val("true");var C=$(A).attr("id");$("#wmtext_inappropriate_artikel").val($("#reaction_messages_article").text());$("#wmtext_inappropriate_name").val($("#reaction_messages_name").text());$("#wmtext_inappropriate_reactionauthor").val($("#message"+messageid+"_author").text());$("#wmtext_inappropriate_reaction").val($("#message"+messageid+"_message").text());$(A).ajaxSubmit({dataType:"json",error:function(){AGD.notifications.show($("#reaction_messages_inappropriate_error").text())},success:function(D){if(D.routingResult.hasErrors=="true"){AGD.notifications.show($("#reaction_messages_inappropriate_error").text())}else{AGD.notifications.show($("#reaction_messages_inappropriate_succes").text())}}});B.preventDefault()})}},startpage:{init:function(){$(".setstartpage_confirm").live("click",function(B){var A=$("input[name='wmstepid'][value='setstartpage']").parent();$(A).children("input[name='clientsideRouting']:first").val("true");url=$(this).attr("href");if(url==""){url=self.location.pathname;if(url.indexOf("/web")==0&&url.indexOf(".htm")>=0){url=url.subString(4)}}$("#wmtext_homepage").val(url);GX_AGD.closeMessage();$(A).ajaxSubmit({dataType:"json",error:function(){AGD.notifications.show($("#setstartpage_messages_error").text())},success:function(C){if(C.routingResult.hasErrors=="true"){AGD.notifications.show($("#setstartpage_messages_error").text())}else{AGD.notifications.show($("#setstartpage_messages_succes").text())}}});B.preventDefault()})},setCurrent:function(){AGD.message('Wilt u de huidige sectorpagina instellen als uw standaard homepage? <a href="" title="" class="setstartpage_confirm"> Ja, dat wil ik</a>')}},limitMaxlength:function(A,B){var D=jQuery.extend({attribute:"maxlength",onLimit:function(){},onEdit:function(){}},B);var C=function(){var E=jQuery(this);var F=parseInt(E.attr(D.attribute));if(E.val().length>F){E.val(E.val().substr(0,F))}};A.each(C);return A.keyup(C).keydown(C).focus(C).live("input paste",C)},no_cookies_message:"Uw browser is momenteel ingesteld op het blokkeren van cookies. U kunt pas inloggen op agd.nl wanneer het gebruik van cookies in uw browser is toegestaan. Meer informatie over het toestaan van cookies vindt u in de online Help van uw browser",checkCookiesEnabled:function(){document.cookie="__verify=1";var A=document.cookie.length>1&&document.cookie.indexOf("__verify=1")>-1;var B=new Date(1976,8,16);document.cookie="__verify=1;expires="+B.toUTCString();if(!A){AGD.message(GX_AGD.no_cookies_message)}}};$(document).ready(GX_AGD.init);function doAjaxSubmit(A,B){$(A).ajaxSubmit({dataType:"json",beforeSubmit:function(E,D,C){var F=jQuery.param(E);return true},timeout:1000*60,error:function(F,E,C,D){B(null)},success:function(C){B(C)}})}function getCookie(B){var C=B+"=";var E="";var D,A;if(document.cookie.length>0){D=document.cookie.indexOf(C);if(D!=-1){D+=C.length;A=document.cookie.indexOf(";",D);if(A==-1){A=document.cookie.length}E=unescape(document.cookie.substring(D,A))}}return E}if($("#eightmediaframe")){var em_iframelink=$("#eightmediaframe").attr("src");$("#eightmediaframe").bind("show",function(){$("#eightmediaframe").attr("src",em_iframelink)})};
