var serviceUrls={errorLog:"http://littleone/services/Log.asmx/LogError"};$(document).ready(function(){if(typeof(Sys)=="object"&&navigator.userAgent.indexOf("WebKit/")>-1){Sys.Browser.WebKit={};Sys.Browser.agent=Sys.Browser.WebKit;Sys.Browser.version=parseFloat(navigator.userAgent.match(/WebKit\/(\d+(\.\d+)?)/)[1]);Sys.Browser.name="WebKit"}});window.onerror=logError;function logError(c,b,a){jQuery(function(d){d.post(serviceUrls.errorLog,{message:c,url:b,line:a})})}function showErrorMsg(){jQuery(function(a){a(document.body).append('<div class="error">Sorry, something has gone wrong.  Please <a href="javascript: window.location.reload();">click here</a> to reload the page and try again.</div>')})}function onCallback(b,a){if(b){b.call(a)}}$.browser.isIE6=function(){return($.browser.msie&&$.browser.version=="6.0")};jQuery.ajaxJSON=function(b,c,d,a){$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:b,data:c,dataType:"json",success:d,error:function(f,e){logError(f.responseText,b,0);if(a){a(f,e)}}})};jQuery.fn.showModal=function(c,a){if(!this.showModal.initList){this.showModal.initList={}}if(!this[0].id){throw"Show dialog failed. Element id required"}if(!this.showModal.initList[this[0].id]){var b=this.parent();this.dialog({resizable:false,modal:false,draggable:false,autoOpen:false,closeOnEscape:false,dialogClass:"modalPopup",position:"center",width:c,height:a,zIndex:1000001});this.parent().children(".ui-dialog-titlebar").remove();b.append(this.parent());this.showModal.initList[this[0].id]=true}this.dialog("open");if($.browser.isIE6()){$("select").css("visibility","hidden")}this.showModal.overlayElement().css("display","").animate({opacity:0.7},500);return this};jQuery.fn.closeModal=function(){var a=this.showModal.overlayElement();a.animate({opacity:0},500,null,function(){a.css("display","none")});this.dialog("close");if($.browser.isIE6()){$("select").css("visibility","")}return this};jQuery.fn.showModal.overlayElement=function(){var a=$(".modalBackground:first");if(a.length==0){$(document.body).append('<div class="modalBackground" style="position: fixed; top: 0; left: 0; z-index: 10000; opacity: 0; display: none; width: '+$(window).width()+"px; height: "+$(window).height()+'px;" />');a=$(".modalBackground:first");if($.browser.isIE6()){a.css("position","absolute")}$(window).resize(function(){a.css({width:$(window).width(),height:$(window).height()})})}return a};jQuery.fn.showBusy=function(a,d){if(!this[0].id){throw"Show busy failed. Element id required"}var b=jQuery.fn.showBusy.settings[this[0].id];if(!b){b=jQuery.fn.showBusy.settings[this[0].id]={}}if(a==null){a={}}if(!a.delay){a.delay=0}if(!a.minBusy){a.minBusy=500}if(!a.fadeTime){a.fadeTime=300}b.callback=d;b.overlay=$('<div class="busyOverlay" style="position: absolute; width: '+this.width()+"px; height: "+this.height()+"px; top: "+this.offset().top+"px; left: "+this.offset().left+'px; opacity: 0;"></div>');$(document.body).append(b.overlay);if(a.minBusy>0){b.isHolding=true}var c=this;b.waitingId=setTimeout(function(){b.waitingId=null;b.overlay.css({"background-image":"url(/Assets/Images/AjaxLoader.gif)","background-position":"center center","background-repeat":"no-repeat"});b.overlay.animate({opacity:1},a.fadeTime,function(){setTimeout(function(){b.isHolding=null;onCallback(b.callback,c)},a.minBusy)})},a.delay);return c};jQuery.fn.endBusy=function(){var b=jQuery.fn.showBusy.settings[this[0].id];if(b.overlay){if(b.waitingId){clearTimeout(b.waitingId);b.overlay.remove();onCallback(b.callback,this)}else{if(b.isHolding){var a=this;setTimeout(function(){a.endBusy()},100)}else{b.overlay.css("background-image","");b.overlay.animate({opacity:0},300,function(){b.overlay.remove()})}}}return this};jQuery.fn.showBusy.settings={};jQuery.slideMenu=function(b,a){jQuery(function(f){var h=f("#"+b);var e=f("#"+a);var c=null;var i=e.height();e.parent().css("position","relative");e.css({position:"absolute",zindex:"1000",left:"0px",height:"0px",overflow:"hidden",visibility:"visible"});var g=function(k,j){if(c){clearTimeout(c);c=null}f("#"+a).animate({height:i},200,null)};var d=function(k,j){c=setTimeout(function(){f("#"+a).animate({height:0},200,null)},200)};e.mouseover(g);h.mouseover(g);e.mouseout(d);h.mouseout(d)})};jQuery.fn.slideShow=function(a){var b=this.children("img");var c=b[0];setInterval(function(){var d=(b.index(c)+1==b.length)?b[0]:b[b.index(c)+1];$(c).animate({opacity:"hide"},2000,null);$(d).animate({opacity:"show"},2000,null);c=d},a)};function stringBuilder(a){this.strings=new Array("");this.append(a)}stringBuilder.prototype.append=function(a){if(a){this.strings.push(a)}};stringBuilder.prototype.clear=function(){this.strings=new Array("")};stringBuilder.prototype.length=function(){return this.strings.join("").length};stringBuilder.prototype.toString=function(){return this.strings.join("")};function pagerControl(l,d,a,k,e,b,i){var h=this;h.selectedClass="current";h.groupLength=a;h.totalGroups=Math.ceil(d/a);h.buttons=new Array();h.element=$('<ul class="pager"></ul>');l.html(h.element);h.previousElement=$('<li class="previousGroup">&lt;</li>');h.element.append(h.previousElement);for(var c=0;c<d;++c){var g=$('<li class="page"><span class="button">&nbsp;'+(c+1)+'&nbsp;</span><span class="spacer">'+k+"</span></li>");var j={element:g,pageIndex:c,groupIndex:Math.floor(c/a)};h.buttons.push(j);h.element.append(g)}h.nextElement=$('<li class="nextGroup">&gt;</li>');h.element.append(h.nextElement);h.element.children("li").children(".button").click(function(){var n;for(var m=0;m<h.buttons.length;++m){if(h.buttons[m].element[0]==this.parentNode){h.selectButton(h.buttons[m]);if(b){b({sender:h,selectedIndex:h.buttons[m].pageIndex})}return}}}).mouseover(function(){$(this).addClass("hover")}).mouseout(function(){$(this).removeClass("hover")});h.previousElement.click(function(){h.selectGroup(h.selectedGroup-1);if(i){i({sender:h,selectedIndex:h.selectedGroup})}});h.nextElement.click(function(){h.selectGroup(h.selectedGroup+1);if(i){i({sender:h,selectedIndex:h.selectedGroup})}});var f=h.buttons[e];h.selectButton(f);h.selectGroup(f.groupIndex)}pagerControl.prototype.selectGroup=function(d){this.selectedGroup=d;for(var c=0;c<this.buttons.length;++c){var b=this.buttons[c];b.element.css("display",(b.groupIndex==d)?"":"none");var a=b.pageIndex+1;if(a==this.buttons.length||a%this.groupLength==0){b.element.children(".spacer").css("display","none")}}this.previousElement.css("display",(d>0)?"":"none");this.nextElement.css("display",(d<this.totalGroups-1)?"":"none")};pagerControl.prototype.selectButton=function(a){this.selectedButton=a;this.element.children("li").removeClass(this.selectedClass);a.element.addClass(this.selectedClass)};pagerControl.prototype.selectedIndex=function(a){if(a!=null){for(var b=0;b<this.buttons.length;++b){if(this.buttons[b].pageIndex==a){this.selectedButton=this.buttons[b];break}}this.selectButton(this.selectedButton);this.selectGroup(this.selectedButton.groupIndex)}return this.selectedButton.pageIndex};function animateShow(a){jQuery(function(c){var b=$find(a);if(b){AjaxControlToolkit.Animation.FadeInAnimation.play(b._backgroundElement,1,20,0,0.8,false);b.show()}else{setTimeout("animateShow('"+a+"');",200)}})}function animateHide(modalTarget){var modal=$find(modalTarget);if(modal&&modal._backgroundElement){modal.hide();modal._backgroundElement.style.display="";var animation=new AjaxControlToolkit.Animation.FadeOutAnimation(modal._backgroundElement,0.1,100,0,0.6,false);eval('var handler = function() { var element = $get("'+modal._backgroundElement.id+'"); if (element) { element.style.display = "none"; }}');animation.onEnd=handler;animation.play()}};