var tip=new Array();var iTips=0;var altText="Click here for information";var infoIcon="/_layouts/custom/jQuery/images/question-mark-icon.gif";function closeTips(a){tip[a].simpletip().close()}function InitialiseInfoPopupQW(b){if($(b).find("img").size()<1){$(b).prepend('<img src="'+infoIcon+'" alt="'+altText+'" />')}var a="<h3>"+$(b).children("input[type=hidden]:eq(0)").val()+"</h3><br />";a+=$(b).children("input[type=hidden]:eq(1)").val()+"<br /><br />";a+="<a class='l3' style='text-decoration:underline' href='javascript:closeTips("+iTips.toString()+");' >Close</a>";tip[iTips]=$(b).simpletip({modal:true,position:null,opener:$(b).children("img"),fixed:true,hideEffect:"none",onBeforeShow:function(){this.update(a);this.getTooltip().css("z-index","10000");this.showModal()}});iTips++}$(document).ready(function(){function c(e,f){if(f.base){var d=f.base;$("#header").css("z-index","200");$("#content-body").css("z-index","100");$(".password-info").css("z-index","190");d.update(e+d.getCloseFn());d.showModal()}}function b(d){oLbox["lbox-generic"].setError("Unfortunately, an error occurred while trying to retrieve the information.");oLbox["lbox-generic"].update("append");oLbox["lbox-generic"].open()}$(".info-popup").each(function(d){$(this).prepend('<img src="'+infoIcon+'" alt="'+altText+'" />');tip[iTips]=$(this).simpletip({modal:true,position:$(this).children("input[type=hidden]").val().split(";")[3],opener:$(this).children("img"),fixed:true,closeFn:"<br /><br /><a class='l3 closeTip' style='text-decoration:underline' href='#' onclick='closeTips("+iTips.toString()+"); return false;' tabindex='100' >Close</a>",param1:$(this).children("input[type=hidden]").val().split(";")[0],param2:$(this).children("input[type=hidden]").val().split(";")[1],param3:$(this).children("input[type=hidden]").val().split(";")[2],onBeforeShow:function(){Tower.OSC.MOSS.Forms.WebServices.OSCServices.GetInfoPopupHtml(this.getParam(1),this.getParam(2),this.getParam(3),c,b,{base:this})},onBeforeHide:function(){$("#header").css("z-index","0");$("#content-body").css("z-index","0");$(".password-info").css("z-index","0")}});iTips++});$(".info-popup-qw").each(function(){if($(this).parent().is(":visible")||$(this).parent().css("display")!="none"){InitialiseInfoPopupQW(this)}});var a=100;$("#content-body div").each(function(){$(this).css("zIndex",a);a-=1})});(function(){var defaults={};$.OscLightboxMgr=function(config){this.Init(config)};$olbm=$.OscLightboxMgr;$olbm.fn=$olbm.prototype={};$olbm.fn.extend=$olbm.extend=$.extend;$olbm.fn.extend({Init:function(config){this.config=$.extend({},defaults,config||{});jQuery.each(oLboxCfg,function(idx,config){oLbox[idx]=new $.OscLightbox(config)})}});var dlg_defaults={id:"",dpo:"autoOpen: false, modal: true, closeOnEscape: false, resizable: false",m:60,w:600,o:'backgroundColor: "#000"',btns:'"Close": function() {$(this).dialog("close");}',ajax:false,prod:"",page:""};$.OscLightbox=function(config){this.Init(config)};$olb=$.OscLightbox;$olb.fn=$olb.prototype={};$olb.fn.extend=$olb.extend=$.extend;$olb.fn.extend({Init:function(config){this.config=$.extend({},dlg_defaults,config||{});if(this.config.id!=""){eval('$("#'+this.config.id+'").dialog({'+this.config.dpo+", margin: "+this.config.m+", width: "+this.config.w+", overlay: { "+this.config.o+" }, buttons: { "+this.config.btns+" }});")}},setError:function(error){this.error="<ul><li>"+error+"</li></ul>";if(this.content==null||this.content==""){this.content=$("#"+this.config.id).html()}},update:function(type,head,desc,html){var content="";if(this.content==null){this.content=$("#"+this.config.id).html()}if(type==null){type="overwrite"}if(head!=null&&head!=""){content+='<h6 class="h2">'+head+"</h6>\r\n"}if(type=="append"){content+=this.content}if(desc!=null&&desc!=""){content+='<p class="bc1">'+desc+"</p>\r\n"}if(html!=null&&html!=""){content+=html}if(this.error!=null){content+=this.error}if(type=="prepend"){content+=this.content}$("#"+this.config.id).html(content)},open:function(){UnlockScreen();if(this.config.ajax){Tower.OSC.MOSS.Forms.WebServices.OSCServices.GetLightboxHtml(this.config.prod,this.config.page,this.config.id,this.WSCallSuccessful,this.WSCallFailed,{base:this})}else{$("#"+this.config.id).dialog("open")}},close:function(){$("#"+this.config.id).dialog("close")},callbackFn:null,WSCallSuccessful:function(results,params){var divID=params.base.config.id;oLbox[divID].update("append","","",results);$("#"+divID).dialog("open")},WSCallFailed:function(message){oLbox["lbox-generic"].setError("Unfortunately, an error occurred while retrieving lightbox content.");oLbox["lbox-generic"].update("append");oLbox["lbox-generic"].open()}})})(jQuery);$(document).ready(function(){$("input").checkBox();$("#password-input").hide();$("#login-input").hide()});function showRealPasswordInput(){$("#fake-password-input").hide();$("#password-input").show();$(".password-input:last").focus()}function showRealLoginInput(){$("#fake-login-input").hide();$("#login-input").show();$(".login-input:last").focus()}function checkLoginInput(){if($("#txtUserName").val()==""){$("#fake-login-input").show();$("#login-input").hide();$(".login-input:last").focus()}}function checkPasswordInput(){if($("#txtPassword").val()==""){$("#fake-password-input").show();$("#password-input").hide();$(".password-input:last").focus()}}function fnum(h,g){var a=h.split(".");var e=a[0];var b="";var c=a[1]+"";for(var f=c.length;f<=g;f++){b+="0"}var d=/(\d*)(\d{3})/;while(d.test(e)){e=e.replace(d,"$1,$2")}return e+c+b}function getPageScroll(){var a;if(self.pageYOffset){a=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollTop}else{if(document.body){a=document.body.scrollTop}}}arrayPageScroll=new Array("",a);return arrayPageScroll}function getPageSize(){var c,a;if(window.innerHeight&&window.scrollMaxY){c=document.body.scrollWidth;a=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){c=document.body.scrollWidth;a=document.body.scrollHeight}else{c=document.body.offsetWidth;a=document.body.offsetHeight}}var b,d;if(self.innerHeight){b=self.innerWidth;d=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){b=document.documentElement.clientWidth;d=document.documentElement.clientHeight}else{if(document.body){b=document.body.clientWidth;d=document.body.clientHeight}}}if(a<d){pageHeight=d}else{pageHeight=a}if(c<b){pageWidth=b}else{pageWidth=c}arrayPageSize=new Array(pageWidth,pageHeight,b,d);return arrayPageSize}function showPTC(i){if(typeof i=="undefined"){i="Processing, please wait..."}var j=document.getElementsByTagName("body").item(0);var a=document.getElementById("loadingDiv");var e=getPageSize();var f=getPageScroll();if(a){var g=f[1]+((e[3]-35-parseInt(a.style.height))/2);var d=((e[0]-20-parseInt(a.style.width))/2);a.style.top=(g<0)?"0px":g+"px";a.style.left=(d<0)?"0px":d+"px";a.style.display="block"}else{var b=document.createElement("img");b.src="/_layouts/Custom/TowerOSC/images/page-loader.gif";b.setAttribute("id","loadingImage");var h=document.createElement("div");h.setAttribute("id","loadingDivText");h.innerHTML=i;var c=document.createElement("div");c.setAttribute("id","loadingDiv");c.style.width="350px";c.style.height="150px";c.style.backgroundColor="#ffffff";var g=f[1]+((e[3]-35-parseInt(c.style.height))/2);var d=((e[0]-20-parseInt(c.style.width))/2);c.style.top=(g<0)?"0px":g+"px";c.style.left=(d<0)?"0px":d+"px";c.insertBefore(b,c.firstChild);c.insertBefore(h,c.firstChild);j.insertBefore(c,j.firstChild);c.style.display="block"}}function DisallowSpaces(a){if(a.charCode==0){return true}if((!a)||(!a.keyCode&&!a.charCode)){return false}if((!a.charCode)||(a.charCode==0)){key=a.keyCode}else{key=a.charCode}if(key==32){key=0;return false}return true}function hidePTC(){var a=document.getElementById("loadingDiv");if(a){a.style.display="none"}}function LockScreen(a,b){var c=$("#lockPane");if(typeof a=="undefined"){a=true}if(typeof b=="undefined"){b="Processing, please wait..."}if(c){c.css("width",($(window)[0].document.documentElement.scrollWidth)+"px");c.css("height",($(window)[0].document.documentElement.scrollHeight)+"px");c.css("display","");c.css("cursor","wait");c.css("z-index","999997")}if(a){showPTC(b)}}function UnlockScreen(){var a=$("#lockPane");if(a){a.css("display","none");a.css("cursor","default");a.css("z-index","-1")}hidePTC()}function CurrencyIntegerOnly_KeyPress(a){if(!((a.which>=48&&a.which<=57)||a.which==44||a.which==32||a.which==8||a.which==0)){if(!a){var a=window.event;a.returnValue=false;a.cancelBubble=true}if(a.stopPropagation){a.stopPropagation();a.preventDefault()}}else{if(a.target.value==""){a.target.value="$ "}else{if(document.selection){var b=document.selection.createRange().text;document.selection.clear();if(b.indexOf("$ ")>-1){a.target.value="$ "}else{if(b.indexOf("$")>-1){a.target.value="$ "}}}}}}function FormatNumberThousands(b){var c=b;var a=/(-?\d+)(\d{3})/;while(a.test(c)){c=c.replace(a,"$1,$2")}return c}function MobilePhoneNumber_KeyPress(b){window.status=b.which;if(!((b.which>=48&&b.which<=57)||b.which==32||b.which==8||b.which==0)){if(b.stopPropagation){b.stopPropagation();b.preventDefault()}}else{if(b.target.value!=""){var a=b.target.value;a=a.replace(/[ ]/g,"");if(a.length>7&&!(b.which==8||b.which==0)){if(b.stopPropagation){b.stopPropagation();b.preventDefault()}}}}}function LandLineNumber_KeyPress(b){window.status=b.which;if(!((b.which>=48&&b.which<=57)||b.which==32||b.which==8||b.which==0)){if(b.stopPropagation){b.stopPropagation();b.preventDefault()}}else{if(b.target.value!=""){var a=b.target.value;a=a.replace(/[ ]/g,"");if(a.length>6&&!(b.which==8||b.which==0)){if(b.stopPropagation){b.stopPropagation();b.preventDefault()}}}}}function FormatPhoneNumber(b){var c=b;var a=/(-?\d+)(\d{4})/;while(a.test(c)){c=c.replace(a,"$1 $2")}return c};
