window.paginationComponents={};
WORKING_AJAX_THREADS=0;
function toggleLoadingIndication(state){var loader=$("#loading");
if(state){WORKING_AJAX_THREADS+=1;
if(loader.hasClass("hid")){loader.removeClass("hid")
}}else{WORKING_AJAX_THREADS-=1;
if(WORKING_AJAX_THREADS<1){WORKING_AJAX_THREADS=0;
loader.addClass("hid")
}}}function _u(url){return $("base").attr("href")+url
}function removeBlankChars(s){return s.replace(/[\n\r\t]/g," ")
}function addDatePicker(){if(typeof $.fn.datepicker!="undefined"){$(".datepicker_aware").datepicker({speed:"",showOn:"both",buttonImage:"images/calendar.gif",buttonImageOnly:"true"})
}}function inputSizeCheck(){$("label[maxLength]").each(function(){var max=$(this).attr("maxLength");
$(this).children(":input").attr("maxLength",max)
});
$("label[maxLength] :input").keyup(function(){var rest=$(this).attr("maxLength")-this.value.length;
if(rest<0){this.value=this.value.substr(0,$(this).attr("maxLength"));
rest=0
}$(this).parents("label").children("span.charactersLeftInfo").html(rest+"")
});
$("label[maxLength] :input").keyup()
}function makeBubblePreview(){$("#textBubleHeading").keyup(copyText).keyup();
$("#textBubleText").keyup(copyText).keyup();
$("#textBubleLinkText").keyup(function(){$("#bubbletextBubleLinkText").html($("#textBubleLinkText").val());
$("#bubblewtextBubleLinkText").attr("href","http://"+$("#textBubleLinkText").val());
$("#footerMoreInfo").attr("href","http://"+$("#textBubleLinkText").val())
});
function copyText(){$("#bubble"+$(this).attr("id")).html($(this).val())
}}$(document).ready(function(){parseResources();
$("#pageSpecificUI").append("<div class='decoration'>&nbsp;</div>");
$("a.externalLink").click(function(){return !window.open(this.href)
});
$("#pageSpecificUI #hint").prepend("<strong id='infoIcon'>Info</strong>");
$("form.forgottenPassword").hide();
$("a#showForgottenPassword").click(function(){$("form.forgottenPassword").show("fast");
return false
});
if(document.getElementById("errors")){$("form.forgottenPassword").show("fast")
}$("input:checkbox.error,input:radio.error,input:file.error").wrap("<span class='error'></span>");
$(".onChangeSubmitTrigger").change(function(){$(this).parents("form")[0].submit()
});
addDatePicker();
$(".switcher").click(function(){var showAttr=$(this).attr("show");
var hideAttr=$(this).attr("hide");
var shows=[],hides=[];
if(showAttr){shows=showAttr.split(" ")
}if(hideAttr){hides=hideAttr.split(" ")
}for(var i=0;
i<shows.length;
i++){$(shows[i]).show()
}for(var i=0;
i<hides.length;
i++){$(hides[i]).hide()
}})
});
function showDetails(campaign){campaign.className+=" detailedView"
}function bindHelp(){var wikiBase=getResource("wikiBase")+"?pageId=";
$("[help]").click(function(event){$("#helpFrame").attr("src",wikiBase+$(this).attr("help")+"&language="+getResource("currentLocale"));
var x=event.pageX;
var y=event.pageY;
if($("#helpContainer").width()+10+x>$(window).width()){x=$(window).width()-10-$("#helpContainer").width();
x=x<0?0:x
}if($("#helpContainer").height()+10+y>$(window).height()){y=$(window).height()-10-$("#helpContainer").height();
y=y<0?0:y
}$("#helpContainer").css({top:y+"px",left:x+"px"}).show();
setTimeout(function(){$("body").one("click",function(){$("#helpContainer").hide()
})
},100);
return false
})
}$(function(){$("#helpClose").click(function(){$("#helpContainer").hide()
});
bindHelp()
});
function parseResources(){if(!window.resourceBundle){window.resourceBundle={}
}$("UL.jsresources LI").each(function(){window.resourceBundle[""+this.id]=this.innerHTML
})
}function getResource(key,params){if(!window.resourceBundle||!window.resourceBundle[key]){return""
}var re=/\{(\d+)\}/gim;
var value=window.resourceBundle[key];
value=value.replace(re,function(match,number,offset,str){var index=parseInt(number);
if(!isNaN(index)){return params[index]?params[index]:match
}});
return value
}function daysInMonth(month,year){return 32-new Date(year,month,32).getDate()
}$.fn.disable=function(){return this.each(function(){if(typeof this.disabled!="undefined"){this.disabled=true
}})
};
$.fn.enable=function(){return this.each(function(){if(typeof this.disabled!="undefined"){this.disabled=false
}})
};
$.fn.extend({check:function(){return this.each(function(){this.checked=true
})
},uncheck:function(){return this.each(function(){this.checked=false
})
}});
$(function(){$("FORM INPUT[type=text],FORM :radio,FORM :checkbox").keypress(function(e){if(e.keyCode==13){return false
}})
});
