jQuery.cookie=function(name,value,options){var expires="";if(options.expires&&(typeof options.expires=="number"||options.expires.toUTCString)){var date;if(typeof options.expires=="number"){date=new Date;date.setTime(date.getTime()+options.expires*24*60*60*1e3)}expires="; expires="+date.toUTCString();var path="; path=/"}document.cookie=[name,"=",encodeURIComponent(value),expires,path].join("")};var browserWidth=$(window).width(),browserHeight=$(window).height();$.cookie("IRTDashResolution",browserWidth+"x"+browserHeight,{expires:7});function CloseIRTAlert(alertId){var alertIRT=$("[id$="+alertId+"]:first"),openControl="[id$="+$(alertIRT).attr("OpenAlertControlID")+"]:first",api=null;$(".qtip").each(function(){api=$(this).qtip("api");if(api.elements.target.attr("id")==$(openControl).attr("id")){api.hide();$("#qtip-alert-blanket").fadeOut(10);return false}})}function ShowIRTAlert(openControlID,alertId){var api=null,openControl="[id$="+openControlID+"]:first";$(".qtip").each(function(){api=$(this).qtip("api");if(api.elements.target.attr("id")==$(openControl).attr("id"))return false;api=null});if(api==null){var alertIRT=$("[id$="+alertId+"]:first");AlertSetup(alertIRT,true)}else api.show()}function AlertSetup(alertIRT,ready){var openControl="[id$="+$(alertIRT).attr("OpenAlertControlID")+"]:first",showModalBack=$(alertIRT).attr("ShowModalBackground");$(openControl).qtip({content:{title:{text:$(alertIRT).attr("Title"),button:""},text:$(alertIRT)},position:{target:$(document.body),type:"absolute",corner:"center"},show:{when:"click",solo:true,ready:ready},hide:{when:false,fixed:true},style:{width:$(alertIRT).css("width"),height:$(alertIRT).css("height"),padding:"14px",border:{width:6,radius:6,color:$(alertIRT).attr("IsConfirm")=="True"?"#006C71":"#EDC573"},name:"light",title:{background:"#FFF",color:"#949494"},classes:{title:"IRTModalTitle",button:"IRTModalCloseButton"}},api:{beforeShow:function(){showModalBack=="True"&&$("#qtip-alert-blanket").fadeIn(this.options.show.effect.length)},beforeHide:function(){showModalBack=="True"&&$("#qtip-alert-blanket").fadeOut(this.options.hide.effect.length)},onShow:function(){}}})}function CloseIRTModal(){var api=null;$(".qtip").each(function(){api=$(this).qtip("api");api!=null&&api.hide()});api!=null&&$("#qtip-blanket").fadeOut(10)}function ShowModal(openControlID,modalId){var api=GetModalAPI(openControlID,modalId),openControl="[id$="+openControlID+"]:first";$(".qtip").each(function(){api=$(this).qtip("api");if(api.elements.target.attr("id")==$(openControl).attr("id"))return false;api=null});if(api==null){var modal=$("[id$="+modalId+"]:first");ModalSetup(modal,true)}else api.show()}function SetModalTitle(openControlID,modalId,title){var api=GetModalAPI(openControlID,modalId);api!=null&&api.updateTitle(title)}function GetModalAPI(openControlID){var api=null,openControl="[id$="+openControlID+"]:first";$(".qtip").each(function(){api=$(this).qtip("api");if(api.elements.target.attr("id")==$(openControl).attr("id"))return false;api=null});return api}function ModalSetup(modal,ready){return ModalSetupControl(modal,ready,"[id$="+$(modal).attr("OpenModalControlID")+"]:first")}function ModalSetupControl(modal,ready,openControl){$(openControl).qtip({content:{title:{text:$(modal).attr("Title"),button:""},text:$(modal)},position:{target:$(document.body),type:"absolute",corner:"center"},show:{when:"click",solo:true,effect:{type:"slide",length:250},ready:ready},hide:{when:false,fixed:true,effect:{type:"slide",length:250}},style:{width:$(modal).css("width"),height:$(modal).css("height"),padding:"14px",border:{width:9,radius:9,color:"#666666"},name:"light",title:{background:"#FFF",color:"#949494"},classes:{title:"IRTModalTitle",button:"IRTModalCloseButton"}},api:{beforeShow:function(){var disabled=$(openControl).hasClass("ui-state-disabled")||$(openControl).attr("disabled")||$(openControl).children(".irtBtn").hasClass("ui-state-disabled")||$(openControl).children(".irtBtn").attr("disabled");if(disabled)return false;this.focus();this.updateTitle($(modal).attr("Title"));$("#qtip-blanket").css("display")=="none"&&$("#qtip-blanket").fadeIn(this.options.show.effect.length)},beforeHide:function(){$("#qtip-blanket").fadeOut(this.options.hide.effect.length)},onShow:function(){this.focus();$("#qtip-blanket").css("display")=="none"&&$("#qtip-blanket").fadeIn(this.options.show.effect.length)},onHide:function(){if($(modal).attr("OnClientClose")!=null&&$(modal).attr("OnClientClose").length>0)eval($(modal).attr("OnClientClose"))}}});$(openControl).bind("keypress",function(e){if(e.keyCode==13||e.keyCode==27){CloseIRTModal();return false}})}function radScrollGridCreated(sender){var scrollArea=sender.GridDataDiv;scrollArea.style.position="relative"}function ToggleGrid_EditMode(show,gridID){$("[gridToEdit="+gridID+"]").toggle()}function pageLoadWebControls(){if($("*")!=null){$(".irtBtn:not(.ui-state-disabled)").hover(function(){$(this).addClass("ui-state-hover");$(this).addClass("irtBtnHover")},function(){$(this).removeClass("ui-state-hover");$(this).removeClass("irtBtnHover");$(this).removeClass("ui-state-active");$(this).removeClass("irtBtnDown")}).mousedown(function(){$(this).addClass("irtBtnDown");$(this).removeClass("ui-state-active");$(this).addClass("ui-state-active")}).mouseup(function(){$(this).removeClass("ui-state-active");$(this).removeClass("irtBtnDown")});$(".toolTipElement").each(function(){$(this).qtip({content:$(this).attr("toolTip"),show:{solo:false,delay:700},position:{corner:{target:"bottomMiddle",tooltip:"topLeft"}},style:{name:"dark",width:{max:200},border:{width:1,radius:8},tip:{corner:"topLeft",color:false,size:{x:12,y:15}}}})});$(".irtBtn[tooltip='True']").each(function(){var inverted=$(this).find(".irtBtnToolTip").attr("tooltipposition")=="Left"?"Right":"Left";$(this).qtip({content:$(this).find(".irtBtnToolTip").html(),show:{solo:false,delay:700},position:{corner:{target:"bottomMiddle",tooltip:"top"+inverted}},style:{name:"dark",width:{max:200},border:{width:1,radius:8},tip:{corner:"top"+inverted,color:false,size:{x:12,y:15}}}})});$(".irtCalendar").datepicker({changeMonth:true,changeYear:true,maxDate:"+0d"});$(".irtDateRangeCalendar").datepicker({changeMonth:true,changeYear:true,maxDate:"+0d",minDate:"-4y"});$(".IRTAlert").each(function(){var openControlID=$(this).attr("OpenAlertControlID"),openControl="[id$="+$(this).attr("OpenAlertControlID")+"]:first",alertId=$(this).attr("id"),confirm=$(this).attr("IsConfirm"),alertClick=$(openControl).attr("onclick");if(alertClick!=undefined&&alertClick!=""){if(confirm=="True"){var okButton="#"+$(this).attr("id")+"_AlertOkButton";if($(okButton).attr("clickSet")=="true"||$(okButton).attr("clickSet")==undefined){$(okButton).die("click");$(okButton).live("click",alertClick);$(openControl).die("click");$(openControl).attr("onclick","");$(okButton).attr("clickSet","true")}}$(openControl).live("click",function(){ShowIRTAlert(openControlID,alertId)})}})}}$(function(){if($("*")!=null){var modalOverlayHeight=$(document).height();if($.browser.msie&&modalOverlayHeight>4095)modalOverlayHeight=4095;$('<div id="qtip-blanket">').css({position:"fixed",top:0,left:0,height:modalOverlayHeight,width:"100%",zIndex:5e3,backgroundColor:"#000",filter:"alpha(opacity=70)",opacity:.7}).prependTo(document.forms[0]).hide();$('<div id="qtip-alert-blanket">').css({position:"fixed",top:0,left:0,height:modalOverlayHeight,width:"100%",zIndex:5e3,backgroundColor:"#000",filter:"alpha(opacity=70)",opacity:.7}).prependTo(document.forms[0]).hide();$(".IRTModal").each(function(){var openControlID=$(this).attr("OpenModalControlID"),openControl="[id$="+$(this).attr("OpenModalControlID")+"]:first",modalId=$(this).attr("id"),modalControl=this;ModalSetup(this,false);$(openControl).live("click",function(){ShowModal(openControlID,modalId)})});$(".IRTAlert").each(function(){AlertSetup(this,false);var openControlID=$(this).attr("OpenAlertControlID"),openControl="[id$="+$(this).attr("OpenAlertControlID")+"]:first",alertId=$(this).attr("id"),confirm=$(this).attr("IsConfirm"),alertClick=$(openControl).attr("onclick");if(confirm=="True"){var okButton="#"+$(this).attr("id")+"_AlertOkButton";$(okButton).live("click",alertClick);$(openControl).unbind();$(openControl).attr("onclick","");$(okButton).attr("clickSet","true")}$(openControl).live("click",function(){ShowIRTAlert(openControlID,alertId)})})}});
