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(r,o,l,j,g){var f=null;var p=null;var s=null;if(j==null){j=0;}if(j>0){f=$get("divDialogBlock"+(j-1));}var a=$get("divDialogBackground"+j);var d=$get("divDialogShadow"+j);var t=$get("divDialogBlock"+j);var i=$get("iframeEdit"+j);var k=$get("hidEditClosePostback"+j);SetLoadingMessage(i);if(k){k.value="";}var b=$(window).height();var m=$(window).width();var c=$(document).height();var h=$(document).width();var n=GetStartPos($(document).scrollTop(),b,c,o);var e=GetStartPos($(document).scrollLeft(),m,h,r);pnlEdit[j].style.top=n+"px";pnlEdit[j].style.left=e+"px";pnlEditDrag[j].style.width=(r-l)+"px";d.style.width=(24+r)+"px";d.style.height=(24+o)+"px";i.width=r;i.height=o;if(t){t.style.width=d.style.width;t.style.height=d.style.height;}if(a){var q=Math.max(b,c);var u=Math.max(m,h);if(navigator.appName=="Microsoft Internet Explorer"){a.style.filter="alpha(opacity=35)";a.style.width=Math.max(u,screen.width)+"px";a.style.height=Math.max(q,screen.height)+"px";}else{a.style.minWidth=u+"px";a.style.minHeight=q+"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[j].style.visibility="visible";$(pnlEdit[j]).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,k,g,e,j,i,d,a){DialogShow(e,j,220,0);if(b){SetPostbackFunction(b+((k==-1)?"":"_lbtnRefresh"),0);}var c=new Date();var h=""+c.getDay()+c.getMonth()+c.getFullYear()+c.getHours()+c.getMinutes()+c.getSeconds();if(i!=null){i="&parent="+i;}else{i="";}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="+k+"&ts="+h+i+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");}function SetRadDatePicker(j,i,a,g,c,f,b){var e=new Date();e.setFullYear(i,a,g);e.setHours(c,f,b,0);$find(j).set_selectedDate(e);}function ClearRadDatePicker(i,g,a,f,c,e,b){$find(i).clear();}