var Utilities={addToBookmarks:function(url,title){window.external.AddFavorite(url,title);},changeCheckBoxState:function(id,checkState){var cb=document.getElementById(id);if(cb!=null){cb.checked=checkState;}},changeAllCheckBoxStates:function(checkBoxArray,checkState){if(checkBoxArray!=null){for(var i=0;i<checkBoxArray.length;i++){this.changeCheckBoxState(checkBoxArray[i],checkState);}}},changeHeaderAsNeeded:function(checkBoxArray){if(checkBoxArray!=null){for(var i=1;i<checkBoxArray.length;i++){var cb=document.getElementById(checkBoxArray[i]);if(!cb.checked){this.changeCheckBoxState(checkBoxArray[0],false);return;}}
this.changeCheckBoxState(checkBoxArray[0],true);}},clearContent:function(element,defaultValue){if(element.value==defaultValue)
element.value='';},cover:function(bottom,top,ignoreSize){var location=Sys.UI.DomElement.getLocation(bottom);top.style.top=location.y-2+'px';top.style.left=location.x+'px';if(!ignoreSize){top.style.height=bottom.offsetHeight+'px';top.style.width=bottom.offsetWidth+'px';}},findPosX:function(element){var curLeft=0;if(element.offsetParent){while(1){curLeft+=element.offsetLeft;if(!element.offsetParent)break;element=element.offsetParent;}}else if(element.x)
curLeft+=element.x;return curLeft;},findPosY:function(element){var curTop=0;if(element.offsetParent){while(1){curTop+=element.offsetTop;if(!element.offsetParent)break;element=element.offsetParent;}}else if(element.y)
curTop+=element.y;return curTop;},focus:function(element){window.scrollTo(this.findPosX(element),this.findPosY(element));},replaceLast:function(input,find,replace){var p=input.toLowerCase().lastIndexOf(find);return p!=-1?input.substring(0,p)+replace+input.substring(p+find.length,input.length):input;}};var Miscellaneous={dropWidget:function(sender,e){$find(e.get_droppedItem().id+'_WidgetExtender').move(parseInt(e.get_container().getAttribute('columnNo')),e.get_position());},setFCKEditorValue:function(id,value,quote){var editor=FCKeditorAPI.GetInstance(id);if(quote){editor.SetHTML('<div class="quote"><p class="first"><strong>Quote:</strong></p>'+Utilities.replaceLast(value,'<p>','<p class="last">')+'</div><br />');Utilities.focus($get('postComment'));}else{editor.SetHTML('');}},validateFCKEditorLength:function(sender,args){var editor=FCKeditorAPI.GetInstance(sender.controltovalidate);var maxLength=sender.maxLength!=null?sender.maxLength:5000;args.IsValid=editor.GetXHTML(true).length<=maxLength;},validateFCKEditorRequired:function(sender,args){var editor=FCKeditorAPI.GetInstance(sender.controltovalidate);args.IsValid=editor.GetXHTML(true).replace(/(\s|&nbsp;)+/,'').replace('<br />','')!='';}};