function GetPostbackFunction(b){return $get(b).href.replace("javascript:","");}function SetPostbackFunction(b,d){if(d==null){d=0;}var c=document.getElementById("hidEditClosePostback"+d);c.value=GetPostbackFunction(b);}function GetStartPos(a,d,b,c){var e=a+(d-c)/2;if(e<a){e=a;}if(e+c+40>b){e=b-c-40;if(e<0){e=0;}}return e;}function DialogShow(t,q,n,l,g){var f=null;var r=null;var u=null;if(l==null){l=0;}if(l>0){f=$get("divDialogBlock"+(l-1));}var a=$get("divDialogBackground"+l);var d=$get("divDialogShadow"+l);var v=$get("divDialogBlock"+l);var k=$get("iframeEdit"+l);var m=$get("hidEditClosePostback"+l);SetLoadingMessage(k);if(m){m.value="";}var b=$(window).height();var o=$(window).width();var c=$(document).height();var h=$(document).width();var p=GetStartPos($(document).scrollTop(),b,c,q);var e=GetStartPos($(document).scrollLeft(),o,h,t);pnlEdit[l].style.top=p+"px";pnlEdit[l].style.left=e+"px";pnlEditDrag[l].style.width=(t-n)+"px";d.style.width=(24+t)+"px";d.style.height=(24+q)+"px";k.width=t;k.height=q;if(v){v.style.width=d.style.width;v.style.height=d.style.height;}if(a){var s=Math.max(b,c);var w=Math.max(o,h);if(navigator.appName=="Microsoft Internet Explorer"){a.style.filter="alpha(opacity=35)";a.style.width=Math.max(w,screen.width)+"px";a.style.height=Math.max(s,screen.height)+"px";}else{a.style.minWidth=w+"px";a.style.minHeight=s+"px";}$(a).fadeIn("slow");}if(f){if(navigator.appName=="Microsoft Internet Explorer"){$(f).css("padding-bottom","3px");f.style.filter="alpha(opacity=35)";}$(f).fadeIn("slow");}pnlEdit[l].style.visibility="visible";$(pnlEdit[l]).show();}function DialogSubmit(d,f){if(f==0){var a=$get($get("hidChildResult"+f).value);var c=$get("hidChildSubmit"+f).value;a.value=d;ClickLink(c);}else{var b=document.getElementById("iframeEdit"+(f-1));var e=b.contentDocument;if(e==undefined||e==null){e=b.contentWindow.document;}var a=e.getElementById($get("hidChildResult"+f).value);var c=$get("hidChildSubmit"+f).value;a.value=d;b.contentWindow.ClickLink(c);}DialogClose(0,f);}function DialogClose(refresh,z){var divEdit=null;if(z==null){z=0;}var parentBlock=document.getElementById("divDialogBlock"+(z-1));if(parentBlock){$(parentBlock).fadeOut("slow");}var divBackground=document.getElementById("divDialogBackground"+z);if(divBackground){$(divBackground).fadeOut("slow");}pnlEdit[z].style.visibility="hidden";$(pnlEdit[z]).hide();if(refresh){var refresh_func=document.getElementById("hidEditClosePostback"+z).value;if(refresh_func==""){window.location=window.location.href.split("#",2)[0];}else{eval(refresh_func);}}}var _loadingImage=null;function SetLoadingMessage(a){if(!_loadingImage){_loadingImage=new Image();_loadingImage.src="/Images/Loading.gif";}var b=a.contentDocument;if(b==undefined||b==null){b=a.contentWindow.document;}b.open();b.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>");b.write("<html xmlns='http://www.w3.org/1999/xhtml'><head><title></title></head><body>");b.write("<div style='width: 150px; top: 50%; left: 50%; margin: -50px 0px 0px -75px; font-family: Sans-Serif; font-size: 24px; color: #999; position: absolute;'>");b.write("<center><img id='imgLoading' style='padding-bottom: 5px' /><br />Loading...</center>");b.write("</div></body></html>");b.close();b.getElementById("imgLoading").src=_loadingImage.src;}function ClickLink(link){eval(GetPostbackFunction(link));}function IncChildrenIDs(a){return"#"+a+",#"+a+" > *:not(script)";}function ChildrenIDs(a){return"#"+a+" > *:not(script)";}function ToggleDiv(b){var a=$get(b);if(!a){return;}if(a.getAttribute("MyDisplay")=="1"){a.MyDisplay=1;a.setAttribute("MyDisplay","0");}if(a.MyDisplay){HideDiv(b);}else{ShowDiv(b);}}function HideDiv(b){var a=$get(b);if(!a){return;}if(!a.MyDisplay){return;}a.MyDisplay=0;$(IncChildrenIDs(a.id)).fadeOut("slow");}function ShowDiv(b){var a=$get(b);if(!a||a.MyDisplay){return;}if(a.className!=""){$("."+a.className+":not(#"+a.id+"):visible").each(function(){HideDiv(this.id);});}$("#"+a.id+" > *").css("display","none");a.MyDisplay=1;$(IncChildrenIDs(a.id)).fadeIn("normal");}function ViewPage(page,rootID,lbtnID,hidID){var hid=document.getElementById(rootID+hidID);hid.value=page;eval(GetPostbackFunction(rootID+lbtnID));}function EditPage(b,a){EditGizmo(null,b,"page",680,400,a);}function AddGizmo(d,f,c,a,b,e){EditGizmo(d,-1,f,c,a,b,e);}function EditGizmo(b,m,g,e,l,k,d,a){DialogShow(e,l,220,0);if(b){SetPostbackFunction(b+((m==-1)?"":"_lbtnRefresh"),0);}var c=new Date();var h=""+c.getDay()+c.getMonth()+c.getFullYear()+c.getHours()+c.getMinutes()+c.getSeconds();if(k!=null){k="&parent="+k;}else{k="";}if(d!=null&&d!=undefined){d="&area="+d;}else{d="";}if(a!=null&&a!=undefined){a="&misc="+a;}else{a="";}var f=document.getElementById("iframeEdit0");f.src="/Popups/EditGizmo.aspx?tp="+g+"&iid="+m+"&ts="+h+k+d+a;}function MovingCalendar(d,b){var f=d._clientID;if(!f){f=d._dateInput._clientID;}var c=f.replace("dateInput","calendar_wrapper");$get(c).style.visibility="hidden";setTimeout("MoveCalendar('"+c+"',-210)",0);var e=f.replace("dateInput","timeView_wrapper");var a=$get(e);if(a){a.style.visibility="hidden";setTimeout("MoveCalendar('"+e+"',-262)",0);}}function MoveCalendar(e,a){var d=$get(e);var c=d.offsetParent;if(!c){c=d.parentNode;}var b=parseInt(c.style.top.replace("px"))+a;if(b>30){c.style.top=b+"px";}d.style.visibility="visible";}function GetQueryStringValue(b){var d=window.location.search.substring(1);var a=query.split("&");for(var c=0;c<a.length;c++){var e=a[c].split("=");if(e[0]==b){return e[1];}}return null;}function SetQueryStringValue(d,c,g){var b="";var a=d.split("&");var f=0;for(var e=0;e<a.length;e++){var h=a[e].split("=");if(h[0]==c){h[1]=g;f=1;}b+="&"+h[0]+"="+h[1];}if(!f){b+="&"+c+"="+g;}if(b.length>0){return b.substring(1);}return null;}function ErrorPopup(b){var a=$get(b);if(a&&a.value!=""){alert(a.value);}}function PrinterFriendly(){var b="?";if(window.location.search){b="&";}var a=window.open(window.location+b+"pf=1","PrinterFriendly","status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=1,height=800,width=850");}var blankSearchText="Site search...";function SetSiteSearchBox(c,b){var a=$("#"+c);a.focus(function(){var d=$(this);d.css("color","#000");if(d.val()==blankSearchText){d.val("");}else{d.select();}});a.blur(function(){var d=$(this);d.css("color","#666");if(d.val()==""){d.val(blankSearchText);}});a.keypress(function(d){if(d.keyCode==13){DoSiteSearch(this.id);return false;}});a.blur();if(b&&b!=""){a.val(b);}}function DoSiteSearch(c){var a=$("#"+c);var b=a.val();if(b!=""&&b!=blankSearchText){window.location="/Site_Search_Results.html?q="+b.replace(/"/g,"");}else{alert("Please enter search keywords");a.focus();}return false;}function SetCookie(a,b){date=new Date;date.setTime(date.getTime()+31536000000);document.cookie=a+"="+b+"; expires="+date.toGMTString()+"; path=/";}function GetCookie(a){a+="=";var b=document.cookie.split(";");for(i=0;i<b.length;i++){var c=TrimStart(b[i]);if(c.indexOf(a)==0){return c.substring(a.length,c.length);}}return"";}function TrimStart(a){for(j=0;j<a.length;j++){if(a.substring(j,j+1)!=" "){return a.substring(j,a.length);}}return"";}