try{if(document.all){document.execCommand("BackgroundImageCache",false,true)}}catch(e){}$.extend({WAIT_DELAY:350,addRequestHeaders:function(A){A.setRequestHeader("Wicket-Ajax","true")},setAjaxOptions:function(B,A){if(A){A=A.toLowerCase();switch(A){case"get":B.type="GET";B.beforeSend=null;break;case"post":B.type="POST";B.beforeSend=null;break;case"wicket/post":B.type="POST";B.beforeSend=function(C){$.addRequestHeaders(C)};break}}},ITEM_SLOT_WAIT_DELAY:175,FLYER_WIDTH_OFFSET:18,MIN_FLYER_WIDTH:400,MAX_FLYER_WIDTH:600,MIN_FLYER_HEIGHT:400,MIN_TAG_FONT_SIZE:9,MAX_TAG_FONT_SIZE:32,KEEP_ALIVE_DELAY:(5000*60),DIALOG_SEND_DELAY:500,DIALOG_CLOSE_DELAY:1000,USER_FOLDOUT_DELAY:300});$(function(){var B=$("body").attr("xhrurl");if(B!==undefined){var A=setInterval(function(){$.ajax({url:B,cache:false,type:"GET"})},$.KEEP_ALIVE_DELAY)}});$(function(){$("#calendar-container").datePicker();$("#tab-container ul.tab-set").tabs();$("#paging").centerFloat();$("#tip-details .truncate").truncate();$("textarea").maxLength()});$(function(){$("#text").each(function(){$("#col-left",this).append($("#main-content #portlets-container",this).remove());var A=$("#main-content #sub-nav-title",this)[0];if(A){$($("#sub-nav li.selected span",this)[0]).text($(A).text())}})});function showFoldout(){$($(this).parents(".foldout").get(0)).toggleClass("open");$("body").focus();return false}function hideFoldout(A){if($(A.target).parents(".foldout").get(0)!=$(A.data.target).parents(".foldout").get(0)){$(document).unbind("mouseup",hideFoldout);$($(A.data.target).parents(".foldout").get(0)).removeClass("open")}}$(function(){$("#dashboard-sub-nav-container .foldout").each(function(){$("img.toggle",this).hover(function(){$(this).addClass("hover");$(this).bind("click",showFoldout);if($($(this).parents(".foldout").get(0)).hasClass("open")){$(document).unbind("mouseup",hideFoldout)}},function(){$(this).removeClass("hover");if($($(this).parents(".foldout").get(0)).hasClass("open")){$(document).bind("mouseup",{target:$(this)},hideFoldout)}})});$("#region-filter a.select").add($("#period-filter a.select")).add($("#sort a.select")).add($("#search-type-select a.select")).hover(function(){$(this).bind("click",showFoldout);if($($(this).parents(".foldout").get(0)).hasClass("open")){$(document).unbind("mouseup",hideFoldout)}},function(){if($($(this).parents(".foldout").get(0)).hasClass("open")){$(document).bind("mouseup",{target:$(this)},hideFoldout)}})});$(function(){$("#user").each(function(){$(this).hover(function(){$(this).delayed(function(){$(this).addClass("hover")},$.USER_FOLDOUT_DELAY)},function(){$(this).stop(true).removeClass("hover")})})});$(function(){$("#searchbox").add($("#sign-up-form")).add($("#form-add-tag")).add($("#form-invite-friend")).add($("#lost-password-form")).each(function(){$("input.text",this).innerLabel()})});$(function(){$("#searchbox").each(function(){var A=$("#search-type-select",this);var B=$("a.select",A);var C=$("ul li a",A);var E=$("#search-keyword",this);var D=$("#search-type",this);C.click(function(){$("ul li",A).removeClass("selected");E.trigger("label",[$(this).attr("title")]);D.val($(this).attr("rel"));$(this).parent().addClass("selected");B.html($(this).html()).trigger("click");return false});$("ul li a[rel='"+D.val()+"']",A).trigger("click")})});$(function(){$("#tags-portlet a.show").click(function(){if($("#tags-portlet ul.wait").length===0){var A={url:$(this).attr("xhrurl"),cache:false,type:"POST",beforeSend:function(B){$.addRequestHeaders(B)},success:function(C,E){var D=$("<div />").html($("component#tagList",C).text());var B=$("<div />").html($("component#allTags",C).text());$("#taglist-target ul").remove();$("#taglist-target").prepend($("ul",D));$("#taglist-target .footer").empty().append($("a",B).openInDialog());$("#tags-portlet").delayed(function(){$("ul.wait",this).remove();$(this).addClass("open")},$.WAIT_DELAY)}};$.setAjaxOptions(A,$(this).attr("xhrmethod"));$.ajax(A);$("#tags-portlet").append('<ul class="wait"><li><div><span><img src="/static/img/transparent.gif" alt="" />Please wait...</span></div></li></ul>')}return false});$("#tags-portlet a.hide").click(function(){var A={url:$(this).attr("xhrurl"),cache:false,type:"POST",beforeSend:function(B){$.addRequestHeaders(B)}};$.setAjaxOptions(A,$(this).attr("xhrmethod"));$.ajax(A);$("#tags-portlet").removeClass("open");$("#tags-portlet ul.wait").remove();return false})});$(function(){$("#stream #profile .add-network").add("#dashboard #featured-list .add-network").add("#streams #item-list .add-network").add("#stream #tab-content-network #network-list .add-network").add("#tips #list-header .add-favorites").add("#tips #active-tag .add-favorites").each(function(){if($(this).hasClass("disabled")||$(this).hasClass("anonymous")){return }$("a",this).click(function(){var A=$(this).parent();if(!$(A).hasClass("wait")){$(A).addClass("wait");var B={url:$(this).attr("xhrurl"),cache:false,type:"POST",beforeSend:function(C){$.addRequestHeaders(C)},success:function(){if($("ul#network-list").hasClass("owner")){var C=$(A).parents("li").get(0);$(C).fadeOut(500,function(){$(C).remove()})}else{$(A).delayed(function(){if($(this).parents("#network-list").length){$($(this).removeClass("wait").parents("li").get(0)).toggleClass("added")}else{$(this).toggleClass("added").removeClass("wait")}},$.WAIT_DELAY)}}};$.setAjaxOptions(B,$(this).attr("xhrmethod"));$.ajax(B)}return false})});$("#stream #tab-content-network #network-list li").hover(function(){$(".add-network",this).fadeIn(200)},function(){$(".add-network",this).fadeOut(100)})});$(function(){$("#friends-streams-list").add("#tag-list").each(function(){if($("li",this).length===0){if($(this).is("ul")){$(this).parent().addClass("empty")}else{$(this).addClass("empty")}}else{var A=$(this).attr("id")=="friends-streams-list"?"stream-count":"tag-count";$("a.remove",this).click(function(){if(!$(this).hasClass("wait")){$(this).addClass("wait");var C=$($(this).parents("li").get(0));$ul=C.parent();var B={url:$(this).attr("xhrurl"),cache:false,type:"POST",beforeSend:function(D){$.addRequestHeaders(D)},success:function(){C.delayed(function(){$(this).fadeOut(500,function(){var D=Number($("li",$ul).length);if(D===1){$($ul.parent()).addClass("empty")}$(this).remove();$("#"+A).text(D-1).fadeTo(200,0.25).fadeTo(200,1)})},$.WAIT_DELAY)}};$.setAjaxOptions(B,$(this).attr("xhrmethod"));$.ajax(B)}return false})}});$("#category-list").each(function(){var A=$(this);var B="category-count";$("a",A).click(function(){if(!$(this).hasClass("wait")){var E=$(this);$(this).addClass("wait");var D=[];D.push({name:"subscribed",value:Number(!$(this).hasClass("checked"))});var C={url:$(this).attr("xhrurl"),cache:false,type:"POST",data:D,beforeSend:function(F){$.addRequestHeaders(F)},success:function(){E.delayed(function(){$(this).toggleClass("checked").toggleClass("changed").removeClass("wait");var F=Number($("a[@class*=checked]",A).length);$("#"+B).text(F).fadeTo(200,0.25).fadeTo(200,1)},$.WAIT_DELAY)}};$.setAjaxOptions(C,$(this).attr("xhrmethod"));$.ajax(C)}return false})})});$(function(){$("#item-list, #tab-content-container .item-list").each(function(){$("ul.components",this).each(function(){$(this).openToggle()})});$("#sortbar #show a.tippers").click(function(){if(!$(this).hasClass("wait")){var B=$(this);var A={url:$(this).attr("xhrurl"),cache:false,beforeSend:function(C){$.addRequestHeaders(C)},success:function(C,D){B.delayed(function(){$(this).removeClass("wait").toggleClass("checked").showHideAllTippersToggle()},$.WAIT_DELAY)}};$.setAjaxOptions(A,$(this).attr("xhrmethod"));$.ajax(A);$(this).addClass("wait")}return false}).showHideAllTippersToggle()});$.fn.extend({openToggle:function(){return this.each(function(){$("a.show, a.hide",this).click(function(){var B=$(this);var C="tippers";var A=$(this).parents(".item-slot").get(0);var D=$(".foldout ."+C,A).get(0);if($($(A).toggleClass(C+"-open")).hasClass(C+"-open")){$($(D).parent()).scrollIntoViewport()}return false})})},showHideAllTippersToggle:function(A){return this.each(function(){if($(this).hasClass("checked")){$("#item-list .item-slot").removeClass("tippers-open").addClass("tippers-show").checkNoTippers()}else{$("#item-list .item-slot").removeClass("tippers-show")}})},checkNoTippers:function(){return $(this).each(function(){if($("ul.tipper-list li",this).length===0){$("div.tippers-container div.tippers",this).empty().append($("<div />").addClass("no-tippers").text(properties.eventSlot.noTippers))}})}});$(function(){$("#content span.inline-help").addInlineHelp()});$(function(){$("#body a[@rel*=dialog]").openInDialog()});$(function(){$("#ongoing a.checkbox").click(function(){if(!$(this).hasClass("wait")){$(this).addClass("wait")}else{return false}})});$(function(){$("#tab-content-next7days .item-group").each(function(){var A=$("div.show-all",this);A.css({visibility:"visible",opacity:0});$(this).hover(function(){A.css({visibility:"visible"});A.animate({opacity:1},200)},function(){A.animate({opacity:0},200)})})});$(function(){$("#content-container .message-container").addMessageClose()});$.fn.extend({addMessageClose:function(){return this.each(function(){var A=this;$("a.close",A).click(function(){var B={url:$(this).attr("xhrurl"),cache:false,type:"GET",success:function(C,D){$(A).animate({marginTop:"hide",marginBottom:"hide",height:"hide"},{duration:500})}};$.setAjaxOptions(B,$(this).attr("xhrmethod"));$.ajax(B);return false})})}});$(function(){$("#tip-details .more-info").each(function(){$(this).click(function(){var A=$(this).attr("href");$(A).add($(this)).toggleClass("show");return false})});$("#item #show a").click(function(){if($(this).toggleClass("checked").hasClass("checked")){$("#tab-content-tipped-by").addClass("show-attending").checkAttending()}else{$("#tab-content-tipped-by").removeClass("show-attending").checkAttending()}return false})});$.fn.extend({checkAttending:function(){return this.each(function(){if($(this).hasClass("show-attending")){$(".tippers-group",this).each(function(){if($("li.attending",this).length===0){$(this).addClass("no-attending")}else{$(this).removeClass("no-attending")}})}else{$(".tippers-group",this).removeClass("no-attending")}})}});$.fn.extend({addInlineHelp:function(){var B=false;var A=function(){if(!B){var C=$('<div id="jQ_tS-inlineHelp" />').append($('<div class="container" />').append('<div class="top"><div></div></div>').append('<div class="body"><div class="content"></div></div>').append('<div class="bottom"><div></div></div>')).css({left:-1000,top:0,visibility:"hidden",opacity:0});if($.browser.msie){C.addClass("isIE")}$("body").append(C);B=true}};return this.each(function(){var C;this.inlineHelpTitle=$(this).attr("title");$(this).removeAttr("title");$(this).mouseover(function(D,F){$target=$(this);var E=$(this).offset();A();if(this.inlineHelpTitle){$("#jQ_tS-inlineHelp .content").empty().text(this.inlineHelpTitle)}else{$("#jQ_tS-inlineHelp .content").empty().html($("span",this).html())}$("#jQ_tS-inlineHelp").css({top:E.top,left:E.left+$(this).width(),visibility:"visible"}).stop().unbind("mouseover").unbind("mouseout").animate({opacity:1},500,function(){if(!F){$(this).bind("mouseover",function(){$(this).stop().css({opacity:1}).bind("mouseout",function(){$(this).stop().animate({opacity:0},300,function(){$(this).css({left:-1000,top:0,visibility:"hidden"})})})})}});C=setInterval(function(){var G=$target.offset();$("#jQ_tS-inlineHelp").css({top:G.top,left:G.left+$target.width()})},100);$(this).mouseout(function(){clearInterval(C);$("#jQ_tS-inlineHelp").stop().animate({opacity:0},300,function(){$(this).css({left:-1000,top:0,visibility:"hidden"})})})})})}});$.fn.extend({openInDialog:function(){var E=(typeof $("<div />").css("maxHeight")=="string"||$.browser.safari);var A=false;var I=function(){$("body").append($('<div id="jQ_tS-dialog-overlay" />')).append($('<div id="jQ_tS-dialog-wait" />')).append($('<div id="jQ_tS-dialog" />').append($('<div class="jQ_container" />').append('<div class="jQ_top"><div><h1>title</h1></div></div>').append('<div class="jQ_body"><div class="jQ_content" /></div>').append('<div class="jQ_bottom"><div /></div>')));$('<a class="close" href="#">'+properties.dialog.close+"</a>").click(H).prependTo("#jQ_tS-dialog .jQ_top div");if($.browser.msie){$("body").append($('<iframe id="jQ_tS-dialog-iframe" />'))}if(!E){$("html").css({overflow:"hidden"});$("#jQ_tS-dialog-overlay, #jQ_tS-dialog-iframe").css({position:"absolute",height:$(window).height()+$(window).scrollTop(),width:$(window).width()});$("#jQ_tS-dialog-wait").css({position:"absolute",top:($(window).height()/2)+$(window).scrollTop()});$("#jQ_tS-dialog").css({position:"absolute"})}};var C=function(K,J){H();I();if(!E){$(window).bind("resize",function(){$("#jQ_tS-dialog-overlay, #jQ_tS-dialog-iframe").css({height:$(window).height()+$(window).scrollTop(),width:$(window).width()})})}};var D=function(){var L=17+15;$("#jQ_tS-dialog .jQ_container:first").width($("#jQ_tS-dialog .dialog").width()+L);var J=$("#jQ_tS-dialog").width();var K=parseInt($("#jQ_tS-dialog").height()/2,10);$("#jQ_tS-dialog").css({marginTop:-K,marginLeft:-parseInt(J/2,10),width:J});if(!E){$("#jQ_tS-dialog").css({top:($(window).height()/2)+$(window).scrollTop(),left:"50%",visibility:"visible"})}else{$("#jQ_tS-dialog").css({top:"50%",left:"50%",visibility:"visible"})}$("#jQ_tS-dialog-wait").remove()};var H=function(){$("#jQ_tS-dialog-overlay, #jQ_tS-dialog, #jQ_tS-dialog-wait, #jQ_tS-dialog-iframe").remove();$(window).unbind("resize");if(!E){$("html").css("overflow","")}return false};var F=function(M,K,L){var Z;var J;var P=$("#"+M);$("#jQ_tS-dialog .jQ_top h1").html($("#jQ_tS-dialog .jQ_content h1.title").html());switch(M){case"tip-dialog":Z=$("form",P);var Y=$("textarea",Z);var U=$("input[name=tags]",Z);var J=$(".footer a",P);var O=$(J[0]);U.innerLabel();Y.maxLength();$(".footer .button a",P).centerFloat();$(".inline-help",P).addInlineHelp();$("#add-tags a",P).click(function(){var c=U.val();if(U.hasClass("inner-label")){c="";U.removeClass("inner-label")}var a=$(this).text();var b=new RegExp(a,"gi");if(!b.test(c)){c+=(c.length?", ":"")+a;U.val(c)}return false});J.click(function(){if(U.hasClass("inner-label")){U.val("")}var b=$(Z).serializeArray();b.push({name:$(this).attr("name"),value:1});P.addClass("waiting").addClass($(this).parent().attr("class"));$("#jQ_tS-dialog .close").hide();var a={url:$(this).attr("xhrurl"),type:"POST",data:b,cache:false,beforeSend:function(c){$.addRequestHeaders(c)},success:function(c,f){G(c);P.delayed(function(){$(this).removeClass("waiting").addClass("succeeded").delayed(function(){H()},$.DIALOG_CLOSE_DELAY)},$.DIALOG_SEND_DELAY,false)}};$.setAjaxOptions(a,$(this).attr("xhrmethod"));$.ajax(a);this.blur();return false});Z.bind("submit",function(){O.trigger("click");return false});$(".inline-help",P);$(".message-container",P).addMessageClose();D();Y.focus();break;case"flyer-dialog":var T=$("#flyer-image",P).get(0);var V=new Image();$(V).bind("load",function(){$(this).unbind("load");var a=Math.min($.MAX_FLYER_WIDTH,Math.max(this.width,$.MIN_FLYER_WIDTH));var b=Math.min(this.height,$.MIN_FLYER_HEIGHT);if(a<=$.MIN_FLYER_WIDTH||a>=$.MAX_FLYER_WIDTH){$(".overflow-content",P).css({width:a+$.FLYER_WIDTH_OFFSET})}if(b>=$.MIN_FLYER_HEIGHT){$(".overflow-content",P).css({height:b})}P.width(a+$.FLYER_WIDTH_OFFSET);D()});$(V).bind("error",function(){$(this).unbind("error");D()});$(V).attr("src",$(T).attr("src"));break;case"tag-dialog":var Q=$(".tag-list a",P);var S=Number($(Q.get(0)).attr("class"));var W=S;Q.each(function(){S=Math.min(S,Number($(this).attr("class")));W=Math.max(W,Number($(this).attr("class")))}).each(function(){var b=Number($(this).attr("class"));var a=S==W?0.1:(b-S)/(W-S);var c=Math.floor($.MIN_TAG_FONT_SIZE+($.MAX_TAG_FONT_SIZE-$.MIN_TAG_FONT_SIZE)*a);$(this).css({fontSize:c})});$(".tag-list",P).css({lineHeight:$.MAX_TAG_FONT_SIZE+"px"});D();break;case"feedback-dialog":$(".footer .button a",P).centerFloat();Z=$("form",P);$("textarea",Z).maxLength();J=$(".footer a");J.click(function(){var b=Z.serializeArray();b.push({name:$(this).attr("name"),value:1});P.addClass("waiting").addClass($(this).parent().attr("class"));$("#jQ_tS-dialog .close").hide();var a={url:$(this).attr("xhrurl"),type:"POST",data:b,cache:false,beforeSend:function(c){$.addRequestHeaders(c)},success:function(c,f){P.delayed(function(){$(this).removeClass("waiting").addClass("succeeded").delayed(function(){H()},$.DIALOG_CLOSE_DELAY)},$.DIALOG_SEND_DELAY,false)}};$.setAjaxOptions(a,$(this).attr("xhrmethod"));$.ajax(a);$(this).blur();return false});D();break;case"signin-dialog":$(".footer .button a",P).centerFloat();var N;if(/#/.test(K)){N=K.replace(/^.*#/,"#")}$("ul.tab-set",P).tabs(N);$("a[rel='tab']",P).each(function(){var a=$(this).attr("href");var b=$("ul.tab-set a[href='"+a+"']",P);$(this).bind("click",function(){$(b).trigger("click");return false})});var R=properties.validate;Z=$("#sign-in-form",P);J=$("a.button",Z);Z.validate({rules:{username:"required",password:{required:true,minlength:6}},messages:{username:R.signIn.username.required,password:{required:R.signIn.password.required,minlength:R.signIn.password.invalid}},submitHandler:function(b){var c=Z.serializeArray();c.push({name:$(J).attr("name"),value:1});P.addClass("waiting");$("#jQ_tS-dialog .close").hide();var a={url:J.attr("xhrurl"),type:"POST",data:c,cache:false,beforeSend:function(f){$.addRequestHeaders(f)},success:function(f,g){P.delayed(function(){if($("component#signin-feedback",f).length){$(this).removeClass("waiting");$("#jQ_tS-dialog .close").show();$("#signin-feedback",Z).replaceWith($("component#signin-feedback",f).text()).hide().delayed(function(){$(this).slideDown(300)},300,false)}else{if(/#$/.test(L)){document.location.reload(true)}else{document.location.href=L}}},$.DIALOG_SEND_DELAY,false)}};$.setAjaxOptions(a,J.attr("xhrmethod"));$.ajax(a);J.blur();return false}});J.click(function(){Z.submit();return false});D();$("ul.tab-set a",P).each(function(){$(this).bind("click",function(){var c=$(this).attr("href");if(/#/.test(c)){var f=c.replace(/^.*#/,"#");var b=$(f+" form input.text")[0];if(b){$(b).focus()}}});var a=$(this).parent();if($(a).hasClass("selected")){$(this).trigger("click")}});break;case"map-dialog":B(P);D();break;case"preview-email-dialog":var X=$("#email-message").val();X=X.replace(/(\r\n|\r|\n)/gi,"<br />");$("#preview-message",P).html(X);D();break;default:D()}};var G=function(K){if($("component",K).each(function(){var M=$($("<div />").html($(this).text())).contents();var P=M.attr("id");var N=$("#"+P);if(M.hasClass("components")){N.empty().append(M.contents());var O=N.parents(".item-slot").get(0);if($(".tippers a",N).size()===0){$(O).addClass("no-tippers")}else{N.openToggle();$(O).removeClass("no-tippers")}}else{if(M.hasClass("tip-button")){$("span.count",N).text($("span.count",M).text()).fadeTo(200,0.25).fadeTo(200,1);$("a",N).attr("class",$("a",M).attr("class")||"").attr("title",$("a",M).attr("title")||"")}else{N.empty().append(M.contents());if(N.parent().hasClass("show-attending")){N.parent().checkAttending()}if(N.hasClass("tippers")){$(N.parents(".item-slot").get(0)).checkNoTippers()}}}}).length===0){var J=$("evaluate",K).text();var L=J.replace(/([\w\W]+\(\")|(\"\))/g,"");$("#"+L).fadeOut(500,function(){$(this).remove()})}};var B=function(O){var N=$("#map-dialog-canvas",O);var L=$("#map-dialog-info",O);var J={"tipspot.nl":"ABQIAAAAGc_MHaLZMliuOLU2QZloNxSv6j3ZyYhQ_3g7s77hbxv28wyqTBR9yUk9WL_IgaITnsPjxmyDd4gEJA","tipspot.com":"ABQIAAAAGc_MHaLZMliuOLU2QZloNxSP46EBhiOiQj90cWT_68eRyWR9JhSvWeLnfm0iuobPn2TiqEAi_bKv3Q",localhost:"ABQIAAAA0txTPu3o280tFr1LQ5fikhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxRrUrUYEOoNcTOTd1Yb33ZG0SSu5A"};for(var K in J){docHostname=document.location.hostname;var M=new RegExp(K+"$","i");if(M.test(docHostname)){google.loader.ApiKey=J[K]}}google.load("maps","2",{callback:function(){var P=$(".location",N).text();var Q=new google.maps.Map2(N[0]);Q.addControl(new GLargeMapControl());Q.addControl(new GMapTypeControl());Q.enableScrollWheelZoom();clientGeocoder=new GClientGeocoder();clientGeocoder.getLatLng(String(P),function(R){if(R){Q.setCenter(R,15);var T=new GIcon(G_DEFAULT_ICON);T.image="/static/img/mapfiles/marker.png";var S=new GMarker(R,T);Q.addOverlay(S);var U=new Object();U.maxWidth=400;S.bindInfoWindow(L.html(),U);GEvent.addListener(S,"infowindowopen",function(){$("img[src$='ALL/mapfiles/iw2.png']",O).attr("src","/static/img/mapfiles/iw2.png");$("img[src$='ALL/mapfiles/iw3.png']",O).attr("src","/static/img/mapfiles/iw3.png");$("img[src$='ALL/mapfiles/iw_close.gif']",O).attr("src","/static/img/mapfiles/iw_close.gif")});GEvent.trigger(S,"click")}})},language:properties.lang})};return this.each(function(){$(this).bind("click",function(){C();var M=$(this).attr("xhrurl");var J=$(this).attr("href");if(M&&M.length){var L={url:M.replace(/#.*/,""),type:"GET",success:function(P,Q){if(typeof P=="string"){$("#jQ_tS-dialog .jQ_content").empty().append($("div:first",$("<div />").html(P)))}else{if($("component",P).length){$("#jQ_tS-dialog .jQ_content").html($("component:first",P).text())}}$("#jQ_tS-dialog .dialog").delayed(function(){F($(this).attr("id"),M,J)},200,false)}};$.setAjaxOptions(L,$(this).attr("xhrmethod"));var K=$.ajax(L)}else{var N=$($(this).attr("href")).clone();var O=$(N).attr("id")+"-dialog";$(N).attr("id",O);$("#jQ_tS-dialog .jQ_content").empty().append(N);F(O,M)}return false})})}});$.fn.extend({maxLength:function(){return $(this).each(function(){if($(this)[0].maxLength==undefined){var C=Number($(this).attr("maxLength"))||160;var B=$(this);function A(){var D=$(B).val();if(D.length>C){$(B).val(D.substring(0,C))}}$(B).keydown(A).keypress(A).keyup(A)}else{if($(this)[0].maxLength==-1){$(this)[0].maxLength=160}}})}});$.fn.extend({innerLabel:function(){return $(this).each(function(){var A=$(this).attr("title")||this.defaultValue;if($(this).val().length===0||this.defaultValue===A||$(this).val()===$(this).attr("title")){$(this).addClass("inner-label").val(A)}else{$(this).removeClass("inner-label")}$(this).attr("title","").focus(function(){var B=$(this).val();if(B===A){$(this).val("").removeClass("inner-label")}else{this.select()}$(this).bind("blur",function(){var C=$.trim($(this).val());if(C.length===0){$(this).addClass("inner-label").val(A)}$(this).unbind("blur")})}).bind("label",function(C,B){var D=$(this).val();if(D===A||D===B){$(this).addClass("inner-label").val(B)}A=B})})}});$.fn.extend({scrollIntoViewport:function(){return this.each(function(){var B=$(window).height();var C=$(window).scrollTop();var A=$(this).offset().top+$(this).height()-C+10;if(B<A){$("html,body").animate({scrollTop:C+A-B},{easing:"easeInOutQuad",duration:500})}})}});$.fn.extend({datePicker:function(){var B=properties.date.dayOffset;var A=new Date();A.setHours(0);A.setMinutes(0);A.setSeconds(0);A.setMilliseconds(0);create=function(D,G,S){var T=[];var U=new Date(S);var N=new Date(U);N.setDate(0);var C=new Date(U);C.setMonth(C.getMonth()+1);var I=new Date(C);I.setDate(0);var F=I.getDate();while(F>0){I.setDate(F--);T.unshift({date:new Date(I)})}var Q=I.getDay()-B;Q=Q<0?Q+7:Q;F=N.getDate();while(Q>0){N.setDate(F--);T.unshift({date:new Date(N)});Q--}F=7-(T.length%7);F=F==7?0:F;Q=1;while(F-->0){C.setDate(Q++);T.push({date:new Date(C)})}var E=properties.date.days.concat();var K=B;while(K-->0){E.push(E.shift())}var L=$("<tr />");for(var R=0;R<7;R++){L.append($("<th />").text(E[R]))}var J=$("<tbody />").append(L);var O;var M;var H=0;while(T.length){O=$("<tr/>");while(H++<7){currentDate=new Date(T.shift().date);M=$("<td />");if(currentDate.getMonth()!=I.getMonth()){M.addClass("other")}if(currentDate.valueOf()>=A.valueOf()){M.append('<a href="'+getURL(G,currentDate)+'">'+currentDate.getDate()+"</a>")}else{M.addClass("past").append("<span>"+currentDate.getDate()+"</span>")}if(currentDate.valueOf()==D.valueOf()){M.addClass("selected")}if(currentDate.valueOf()==A.valueOf()){M.addClass("today")}O.append(M)}H=0;J.append(O)}var P=$("<table />").attr({cellPadding:"0",cellSpacing:"0"}).addClass("jQ_datePicker").append($("<thead />").append($("<tr />").append($("<th />").addClass("prev").append($('<a href="#"><span><img src="/static/img/transparent.gif" alt="" /></span></a>'))).append($("<th></th>").attr({colSpan:"5"}).text(properties.date.months[I.getMonth()]+", "+I.getFullYear())).append($("<th>").addClass("next").append($('<a href="#"><span><img src="/static/img/transparent.gif" alt="" /></span></a>'))))).append(J);if(I>A){$("th.prev a",P).click(function(){S.setMonth(S.getMonth()-1);$($(this).parents("table").get(0)).parent().empty().append(create(D,G,S));return false})}else{$("th.prev a",P).replaceWith('<span><span><img src="/static/img/transparent.gif" alt="" /></span></span>')}$("th.next a",P).click(function(){S.setMonth(S.getMonth()+1);$($(this).parents("table").get(0)).parent().empty().append(create(D,G,S));return false});return P};getURL=function(D,C){D=D.replace(/(Y{4})/gi,C.getFullYear());m=String(C.getMonth()+1);D=D.replace(/(M{2})/gi,m.replace(/(^\d{1}$)/,"0$1"));d=String(C.getDate());D=D.replace(/(D{2})/gi,d.replace(/(^\d{1}$)/,"0$1"));return D};return this.each(function(){var E=new Date(A);$.metadata.setType("class");var G=$(this).metadata();var D=G.url||"#";var C=String(G.date).match(/(^\d{4})|(\d{2})|(\d{2}$)/g);if(C&&C.length==3){E=new Date(Number(C[0]),Number(C[1])-1,Number(C[2]))}E=(E.valueOf()<A.valueOf())?new Date(A):E;var F=new Date(E);$(this).empty().append(create(E,D,F))})}});$.fn.extend({tabs:function(A){var B=A||document.location.hash;return this.each(function(){var C=$(this);$("li a",C).each(function(){var D=$(this).parent();if($(D).hasClass("no-tab")){return }var E=$(this).attr("href");if(/#/.test(E)){E=E.replace(/^.*#/,"#")}if(E!=undefined&&E.length&&B===E){$(D).addClass("selected")}});if($("li.selected",C).length===0){$("li:first",C).addClass("selected")}$("li a",C).each(function(){var D=$(this).parent();var E=$(this).attr("href");if(E===undefined){$(D).addClass("disabled")}else{if(/#/.test(E)){var G=E.replace(/^.*#/,"#");var F=$(G);if(F){if(!$(D).hasClass("selected")){F.css({display:"none"})}$(this).click(function(){if($(D).hasClass("selected")){return false}$(C).find("li.selected a").trigger("tabOut");$(this).trigger("tabIn");return false});$(this).bind("tabIn",function(){$(D).addClass("selected");$(F).show()});$(this).bind("tabOut",function(){$(D).removeClass("selected");$(F).hide()})}else{$(D).addClass("disabled")}}}})})}});$.fn.extend({centerFloat:function(){return this.each(function(){var A=$(this).width()+1;$(this).css({width:A,"float":"none"})})}});$.fn.extend({truncate:function(){return this.each(function(){$(this).addClass("truncate");$("a.toggle",this).click(function(){$($(this).parents(".truncate").get(0)).toggleClass("more");return false})})}});$.extend(jQuery.validator.prototype,{startRequest:function(B){var A=$($(B).parents(".input-row").get(0));A.stop().addClass("validation-wait")},stopRequest:function(B,C){var A=$($(B).parents(".input-row").get(0));A.delayed(function(){$(this).removeClass("validation-wait")},200)}});$.validator.addMethod("alphaNumeric",function(B,A){return this.optional(A)||/^[a-zA-Z0-9]+$/i.test(A.value)},"");$.validator.addMethod("noWhiteSpace",function(B,A){return this.optional(A)||/^\S+$/i.test(A.value)},"");$.validator.addMethod("URL",function(B,A){return this.optional(A)||/^((https?|ftp):\/\/|)(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(B)},"");$.validator.addMethod("labelValue",function(C,A){var B=new RegExp(A.defaultValue,"gi");return this.optional(A)||!B.test(C)},"");$.validator.setDefaults({onfocusin:function(B){this.lastActive=B;if(this.settings.focusCleanup&&!this.blockFocusCleanup){if(this.settings.unhighlight){this.settings.unhighlight.call(this,B,this.settings.errorClass)}this.errorsFor(B).hide()}if($(B).rules().remote!=undefined&&!this.checkable(B)&&(B.name in this.submitted||!this.optional(B))){this.element(B)}$(B).addClass("focus");var A=$($(B).parents(".input-row").get(0));$(".inline-help",A).trigger("mouseover",[true])},onfocusout:function(B){if(!this.checkable(B)&&(B.name in this.submitted||!this.optional(B))){this.element(B)}var A=$($(B).parents(".input-row").get(0));$(".inline-help",A).trigger("mouseout",[true]);$(B).removeClass("focus")},errorPlacement:function(C,B){C.appendTo(B.parent());var A=$($(B).parents(".input-row").get(0));A.removeClass("validation-valid");A.addClass("validation-error")},success:function(B){var A=$($(B).parents(".input-row").get(0));A.removeClass("validation-error");A.addClass("validation-valid");$(B).remove()}});$.extend(jQuery.easing,{easeInQuad:function(B,C,A,E,D){return E*(C/=D)*C+A},easeOutQuad:function(B,C,A,E,D){return -E*(C/=D)*(C-2)+A},easeInOutQuad:function(B,C,A,E,D){if((C/=D/2)<1){return E/2*C*C+A}return -E/2*((--C)*(C-2)-1)+A}});$.fn.extend({delayed:function(C,B,A){return this.each(function(){$(this).animate({_dummy:0},{duration:B,complete:C,queue:false})})}});