
var isIE=document.all?true:false;function startPing(orl,newActivity){if(Anonymous){Anonymous.Service.Ping(orl,newActivity);setTimeout("startPing('"+orl+"', false);",30000);}}
function findPosition(element){if(typeof(element.offsetParent)!='undefined'){var top=element.offsetTop;var left=element.offsetLeft;while(element=element.offsetParent){top+=element.offsetTop;left+=element.offsetLeft;}}
return[top,left];}
function getMousePosition(e){var pos=!isIE?[e.pageX,e.pageY]:[event.clientX+document.documentElement.scrollLeft,event.clientY+document.documentElement.scrollTop];return pos;}
function textCounter(fieldToCountId,resultsTextId,max){var field=$get(fieldToCountId);var cntfield=$get(resultsTextId);if(field.value.length>max)
field.value=field.value.substring(0,max);else
cntfield.innerHTML=max-field.value.length+' characters to go.';}
function clickOnEnter(domElementButton,domElementSearch,e)
{var evtobj=window.event?event:e
var code=evtobj.charCode?evtobj.charCode:evtobj.keyCode
if(code==13)
{evtobj.cancelBubble=true;if(window.event)
evtobj.returnValue=false;else
evtobj.preventDefault();domElementButton.click();}}
function disableRepost(element,imgControl,performValidation){if(performValidation)
if(!Page_ClientValidate())return false;var get_imgControl=$get(imgControl);if(get_imgControl!=null)
get_imgControl.style.display='';if(element!=null)
element.style.display='none';return true;}
function confirmAction(event,confirmText){cancelBubble(event);return confirm(confirmText);}
function cancelBubble(event){var e=!event?new Sys.UI.DomEvent(window.event):new Sys.UI.DomEvent(event);e.stopPropagation();}
var scrollTimer;function scrollVertically(id,value){clearInterval(scrollTimer);var element=document.getElementById(id);var scrollValue=value/10;var scrollEnd=element.scrollTop+value;if(element!=null&&scrollValue!=0)
scrollTimer=setInterval(function(){scrollVerticalInterval(element,scrollValue,scrollEnd);},10);}
function scrollVerticalInterval(element,scrollValue,endValue){element.scrollTop+=scrollValue;if((scrollValue>0&&element.scrollTop>=endValue)||(scrollValue<0&&element.scrollTop<=endValue))
clearInterval(scrollTimer);}
function scrollHorizontally(id,value){clearInterval(scrollTimer);var element=document.getElementById(id);var scrollValue=value/10;var scrollEnd=element.scrollLeft+value;if(element!=null&&scrollValue!=0)
scrollTimer=setInterval(function(){scrollHorizontalInterval(element,scrollValue,scrollEnd);},10);}
function scrollHorizontalInterval(element,scrollValue,endValue){element.scrollLeft+=scrollValue;if((scrollValue>0&&element.scrollLeft>=endValue)||(scrollValue<0&&element.scrollLeft<=endValue))
clearInterval(scrollTimer);}
var isDragging=false;function onDrag(event,element,offsetX,offsetY){var elemStyle=element.style;var mousePosition;isDragging=true;document.onmousemove=startDrag;document.onmouseup=stopDrag;function startDrag(event){if(isDragging){mousePosition=getMousePosition(event);var xVal=((mousePosition[0]+element.offsetWidth)>document.documentElement.offsetWidth)?document.documentElement.offsetWidth-element.offsetWidth:mousePosition[0]+offsetX;var yVal=mousePosition[1]+offsetY;elemStyle.position="absolute";elemStyle.left=xVal+'px';elemStyle.top=yVal+'px';}}
startDrag(event);}
function stopDrag(){isDragging=false;document.onmousemove=null;document.onmouseup=null;}
function loadRadStripTags(editor)
{editor.AttachEventHandler("RADEVENT_SUBMIT",function(e)
{oTool=new Object();oTool.GetSelectedValue=function(){return"ALL";}
editor.Fire("FormatStripper",oTool);});}
function loadAllowableTags(editor){editor.FiltersManager.Add(new AllowableTagsCustomFilter());}
function AllowableTagsCustomFilter()
{this.GetDesignContent=function(content)
{var newContent=content;newContent=newContent.toLowerCase();return newContent;};this.GetHtmlContent=function(content)
{var newContent=content;newContent=newContent.toUpperCase();return newContent;};this.GetPreviewContent=null;}
function ShowCommonDialog(event,url,title,width,height){cancelBubble(event);$("#_commonDialogFrame").attr("src",url);$("#_commonDialog").dialog('option','height',height);$("#_commonDialog").dialog('option','width',width);$("#_commonDialog").dialog('option','title',title);$("#_commonDialog").dialog('open');return false;}
function CancelCommonDialog(){$("#_commonDialog").dialog('close');return false;}
function CloseCommonDialog(redirectUrl){window.location=redirectUrl;}
function initCommonDialog(){$("#_commonDialog").dialog({modal:true,resizable:false,autoOpen:false});}
function checkAvailability(orbOrl,groupName,controlId){var control=$get(controlId);if(!control)return;if(groupName.length<3)return;if(Anonymous)
Anonymous.Service.CheckGroupAvailability(orbOrl,groupName,onCheckAvailabilitySuccess,onCheckAvailabilityFail,control);}
function onCheckAvailabilitySuccess(result,control){if(result){control.innerHTML="Available!";Sys.UI.DomElement.removeCssClass(control,"error");Sys.UI.DomElement.addCssClass(control,"success");return;}
control.innerHTML="Name taken.";Sys.UI.DomElement.removeCssClass(control,"success");Sys.UI.DomElement.addCssClass(control,"error");}
function onCheckAvailabilityFail(result,control){control.innerHTML="an error occurred";Sys.UI.DomElement.removeCssClass(control,"success");Sys.UI.DomElement.addCssClass(control,"error");}