function getElementsByTagNameWithClass(a,b,c){for(var a=a.getElementsByTagName(b),b=[],d=0;d<a.length;d++)a[d].className==c&&b.push(a[d]);return b}function addLoadEvent(a){var b=window.onload;window.onload=typeof window.onload!="function"?a:function(){b();a()}}function prepareAllInputsForHints(a){typeof a!="string"&&(a=null);prepareInputsForHints("input",a);prepareInputsForHints("select",a);prepareInputsForHints("textarea",a)} function prepareInputsForHints(a,b){var c=document;b!=null&&(c=document.getElementById(b));for(var c=c.getElementsByTagName(a),d=0;d<c.length;d++)c[d].parentNode.getElementsByTagName("span")[0]?(addListener(c[d],"focus",showHint),addListener(c[d],"blur",hideHint)):addListener(c[d],"blur",setValid),c[d].className=="valueHint"&&(addListener(c[d],"focus",hideValueHint),addListener(c[d],"blur",showValueHint),showValueHintForObject(c[d]))} function hideHint(a){a=getEventSource(a).parentNode;a=getElementsByTagNameWithClass(a,"span","hint")[0];if(a!=null)a.style.display="none",setValid()} function showHint(a){var b=getEventSource(a),c=b.parentNode,a=getElementsByTagNameWithClass(c,"span","hint")[0];if(a!=null){a.style.display="inline";var d=0,e="";window.navigator.userAgent.indexOf("MSIE 8")>=0?e=d+b.offsetLeft+b.offsetWidth+15+"px":window.navigator.userAgent.indexOf("MSIE")>=0?(b=getElementsByTagNameWithClass(c,"span","ieHint")[0],d=b!=null?b.offsetLeft+15:this.offsetLeft+this.offsetWidth+15,e=d+"px"):e=d+this.offsetLeft+this.offsetWidth+15+"px";a.style.left=e}} function setValid(a){a=getEventSource(a);a!=null&&a.className=="invalidField"&&window.setTimeout("setValidById( '"+a.id+"')",5E3)}function setValidById(a){a=document.getElementById(a);if(a!=null)a.className="validField"} function validationAlert(a,b,c){c==null&&(c="validationMessage");a=document.getElementById(a);c=document.getElementById(c);if(c!=null)c.innerHTML=b,c.className="validationMessage",c.style.visibility="visible",c.style.display="block",c.scrollIntoView(!1);if(a!=null)a.className="invalidField",a.focus();return!1}function hideValidationMessage(a){a==null&&(a="validationMessage");a=document.getElementById(a);if(a!=null)a.innerHTML="",a.style.display="none"} function showValueHint(a){a=getEventSource(a);showValueHintForObject(a)}function showValueHintForObject(a){var b=a.getAttribute("alt");if(a.value=="")a.value=b!=null?b:""}function hideValueHint(a){var a=getEventSource(a),b=a.getAttribute("alt");if(a.value==b)a.value=""}function addListener(a,b,c,d){d==null&&(d=!1);return a.addEventListener?(a.addEventListener(b,c,d),!0):a.attachEvent?(a.attachEvent("on"+b,c),!0):!1} function getEventSource(a){if(a&&a.target)return a.target;a=null;if(this==window){if(window.event==null)return null;a=window.event.srcElement}else a=this;return a}function getOffsetX(a,b){if(!a.offsetParent)return 0;for(var c=a.offsetParent,d=a.offsetLeft;c;)d+=c.offsetLeft,c=c.offsetParent;return b==null||b.pageX==null?d:b.pageX-d}function getOffsetLeft(a){if(!a.offsetParent)return 0;for(var b=a.offsetParent,a=a.offsetLeft;b;)a+=b.offsetLeft,b=b.offsetParent;return a} function getOffsetTop(a){if(!a.offsetParent)return 0;for(var b=a.offsetParent,a=a.offsetTop;b;)a+=b.offsetTop,b=b.offsetParent;return a}function getElementOffsetPosition(a){var b={offsetTop:0,offsetLeft:0};if(a==null)return offset;if(a.offsetParent){for(var c=0,d=0,d=a.offsetLeft,c=a.offsetTop;a;)d+=a.offsetLeft,c+=a.offsetTop,a=a.offsetParent;b.offsetLeft=d;b.offsetTop=c}return b} function showBubbleForElement(a,b,c,d,e,f){e==null&&(e=!0);f==null&&(f=getDefaultBubbleInitialDelay());bblInfo=getBubbleInfoForEvent(a,b,c,d);bblInfo.linger=e;bblInfo.initialDelayExpires=(new Date).valueOf()+f-50;if(b!=null&&b.onmouseout==null)b.onmouseout=function(){phaseOutBubble(b)};setTimeout("showBubbleFromInfo()",f)} function showBubble(a,b,c,d,e){e==null&&(e=getDefaultBubbleInitialDelay());bblInfo=getBubbleInfoForEvent(a,null,b,c);bblInfo.linger=d;bblInfo.initialDelayExpires=(new Date).valueOf()+e-50;setTimeout("showBubbleFromInfo()",e)}function showBubbleOnLeft(a,b,c,d){return showBubble(a,b,"left",c,d)}function showBubbleOnRight(a,b,c,d){return showBubble(a,b,"right",c,d)}function hideBubble(){document.getElementById("bubbleHint").style.display="none"} function hideBubbleForId(a){bblInfo!=null&&bblInfo.source.id==a&&(bblInfo.isInUse?setTimeout("hideBubbleForId('"+a+"')",getDefaultBubbleLingerDelay()):hideBubble())}function hideBubbleForElement(a){bblInfo!=null&&bblInfo.source==a&&(bblInfo.isInUse?setTimeout(function(){hideBubbleForElement(a)},getDefaultBubbleLingerDelay()):hideBubble())} function showBubbleAjax(a,b,c){showBubble(a,"<div class='loading'></div>",c,!0);AjaxGetWithCallback(b,"bubbleText","failed to retrieve data...",function(a){if(bblInfo!=null)bblInfo.content=a.responseText,showBubbleFromInfo()})}function showBubbleAjaxRight(a,b){return showBubbleAjax(a,b,"right")}function showBubbleAjaxLeft(a,b){return showBubbleAjax(a,b,"left")}function addBubbleTextToObject(a,b,c,d){addBubbleToElementById(a,b,c,!d);return!0} function getActionLinksTemplateContainerElem(a){var b=window.document,a=a==null?"":a,c="actionLinkTemplate";c+=a!=""?"_"+a:"";a=b.getElementById(c);if(a==null)a=b.createElement("span"),a.setAttribute("id",c),a.style.display="none",b.body.appendChild(a);return a} function getActionLinksTemplateForCurrentPage(a){var b=new String("");a==null&&(a="");var c=getActionLinksTemplateContainerElem(a),b=c!=null?String(c.innerHTML):"";if(b!="")return b;var d=null,e=null,a="objectType="+a;try{e={url:"/Components/GetActionLinksTemplate.asp",type:"get",async:!1,data:a,success:function(a,d,e){b=new String(e.responseText);if(c!=null)c.innerHTML=b},error:function(){d=Error("Request to retrieve action links template failed.","function getActionLinksTemplateForCurrentPage")}}, jQuery.ajax(e)}catch(f){e={method:"get",asynchronous:!1,parameters:a,onSuccess:function(a){b=String(a.responseText);if(c!=null)c.innerHTML=b},onFailure:function(){d=Error("Request to retrieve action links template failed.","function getActionLinksTemplateForCurrentPage")}},new Ajax.Request("/Components/GetActionLinksTemplate.asp",e)}finally{e=null}if(d!=null)throw d;return b} function showBubbleWithActionsForCurrentPage(a,b,c,d){var e=new String("");try{e=getActionLinksTemplateForCurrentPage(d)}catch(f){e="Oops. Unable to show action links."}if(!(b==null&&typeof b=="object")){if(b.onmouseout==null)b.onmouseout=function(){phaseOutBubble(b)};e=String(e.replace(/#ObjectID#/gim,c));showBubbleForElement(a,b,e,null,!0)}} function bubbleInfo(){this.top=this.left="0px";this.hintClass="hint";this.content="";this.linger=this.cancel=!1;this.source=null;this.initialDelayExpires=0;this.toString=bubbleInfoToString;this.isInUse=!1}function bubbleInfoToString(){return"left="+this.left+"\n top="+this.top+"\n hintClass="+this.hintClass+"\n html="+this.content+"\n cancel="+this.cancel+"\n linger="+this.linger} function getBubbleInfoForEvent(a,b,c,d){if(a==null)a=window.event;if(a==null)return null;var e=window.document,f=navigator.userAgent,h=f.indexOf("MSIE")>=0&&f.indexOf("MSIE 8")==-1,o=f.indexOf("Gecko")>=0,p=f.indexOf("Firefox")>=0;d==null&&(d="auto");var j=e.getElementById("bubbleHint");if(j==null)return null;f="hint";j.style.left="-2000px";j.style.display="block";var i=b==null?getEventSource(a):b,g=a.clientX,k=a.clientY;if(b!=null)g=getElementOffsetPosition(i),k=g.offsetTop,g=g.offsetLeft;var n= i.offsetWidth,l=i.clientWidth;h&&(l=n);var h=0,h=typeof a.offsetX=="number"?a.offsetX:getOffsetX(i,a),m=a=0;if(b==null&&(b=e.getElementsByTagName("html")[0],o&&!p&&(b=e.getElementsByTagName("body")[0]),b!=null))a=b.scrollTop,m=b.scrollLeft;d=="auto"&&(d=h<l/2?"left":"right");e=Math.max(n-h,10);d=="right"?g=g+10+e+m:(g=g-(10+j.offsetWidth+l)+m+e,f="hint left");k=k-10+a;d=new bubbleInfo;d.hintClass=f;d.left=g+"px";d.top=k+"px";d.content=c;d.source=i;return d} function stopBubble(){bblInfo==null&&(bblInfo=new bubbleInfo);bblInfo.cancel=!0;hideBubble()}function getDefaultBubbleLingerDelay(){return 7E3}function getDefaultBubbleInitialDelay(){return 200}function phaseOutBubbleById(a,b){b==null&&(b=getDefaultBubbleLingerDelay());isBubbleVisible()?setTimeout("hideBubbleForId('"+a+"')",b):stopBubble()}function phaseOutBubble(a,b){b==null&&(b=getDefaultBubbleLingerDelay());isBubbleVisible()?setTimeout(function(){hideBubbleForElement(a)},b):stopBubble()} function isBubbleVisible(){var a=document.getElementById("bubbleHint");return a==null?!1:a.style.display=="block"&&a.style.visibility=="visible"} function showBubbleFromInfo(){if(bblInfo!=null&&!bblInfo.cancel)if(bblInfo.initialDelayExpires>(new Date).valueOf())setTimeout("showBubbleFromInfo()",1E3);else{var a=document.getElementById("bubbleHint");if(a!=null){var b=document.getElementById("bubbleText");a.className=bblInfo.hintClass;a.style.position="absolute";a.style.left=bblInfo.left;a.style.top=bblInfo.top;a.style.display="block";a.style.visibility="visible";a=document.getElementById("bubbleClose");if(a!=null)a.style.display=bblInfo.linger== !0?"block":"none";b.innerHTML=bblInfo.content}}}function addBubbleToElement(a,b,c,d){d==null&&(d=!0);addListener(a,"mouseover",function(e){var f=getEventSource(e);f!=null&&f.id==a.id&&showBubbleForElement(e,a,b,c,d)});d?addListener(a,"mouseout",function(){phaseOutBubble(a)}):addListener(a,"mouseout",stopBubble)} function addBubbleToElementById(a,b,c,d){d==null&&(d=!0);var e=document.getElementById(a);e!=null&&(addListener(e,"mouseover",function(e){var h=getEventSource(e);h!=null&&h.id==a&&showBubbleForElement(e,null,b,c,d)}),d?addListener(e,"mouseout",function(){phaseOutBubbleById(a)}):addListener(e,"mouseout",stopBubble))}function bubbleMouseOver(){if(bblInfo!=null)bblInfo.isInUse=!0}function bubbleMouseOut(){if(bblInfo!=null)bblInfo.isInUse=!1} function showImgInBubble(a,b,c){c=parseInt(c);if(isNaN(c)||c<=0)c=200;var b='<img src="'+("/Scripts/Thumbnail.asp?f="+b+"&amp;s="+c)+'"/>',d=document.getElementById("bubbleHint");if(d!=null)d.style.width=c+"px";showBubble(a,b,"right")}function tell(a,b){b==null&&(b=!1);var c=document.getElementById("tell");if(c!=null)b?c.innerHTML+="; "+a:c.innerHTML=a}bblInfo=null;addLoadEvent(prepareAllInputsForHints);
