var JShareable=new function(){var n,t;this.getDateString=function(n){var i=n.toString(),t;r=i;t=new Date(i);isNaN(t.getTime())&&(t=new Date);var u=t.getDate(),f=t.getMonth()+1,e=t.getFullYear(),r=e+"-"+f+"-"+u;return r};n="divToastMessage";this.initFields=function(n){var i,t;for(i in n){t=i;t.startsWith("m_")&&(t=t.replace("m_",""));t=this.ucfirst(t);var r="txt"+t,u="chk"+t,f="lbl"+t;document.getElementById(r)!=null?this.setTextBox(r,n[i]):document.getElementById(u)!=null?this.setCheckBox(u,n[i]):document.getElementById(f)!=null&&this.setHTML(f,n[i])}};this.setFocusByElement=function(n){this.setFocusByElementId(n)};this.setFocusByElementId=function(n){var t=document.getElementById(n);t!=null&&t.focus()};this.getTextByObject=function(n,t){for(var i in t)n=n.replaceAll("$"+i,t[i]);return n};this.getStringByObject=function(n){var t="";for(var i in n)t+="["+i+"]="+n[i]+" ";return t};this.msgboxObj=function(n){for(var t in n)alert(t+" - "+n[t])};this.getUniqueId=function(){var n=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};return n()+n()+"-"+n()+"-"+n()+"-"+n()+"-"+n()+n()+n()};this.isChecked=function(n){return document.getElementById(n).checked};this.setCheckBox=function(n,t){document.getElementById(n).checked=t};this.setHTML=function(n,t){var i=document.getElementById(n);i&&(i.innerHTML=t)};this.setTextBox=function(n,t){var i=document.getElementById(n);i&&(i.value=t)};this.setElementById=function(n,t){var i=document.getElementById(n);i&&(i.value=t)};this.setTextByElementId=function(n,t){this.setTextBox(n,t)};this.getValueByDropDownList=function(n){return this.getSelectedValue(n)};this.getTextByDropDownList=function(n){var i="",t=document.getElementById(n),r;return t&&(r=t.selectedIndex,i=t.options[r].text),i};this.getSelectedValue=function(n){var i="",t=document.getElementById(n),r;return t&&(r=t.selectedIndex,i=t.options[r].value),i};this.setValueByDropDownList=function(n,t){for(var r=document.getElementById(n),i=0;i Processing... Please Wait.<\/b>",300,200)};this.hideLoading=function(){this.hideMessage()};this.gotoUrl=function(n){window.location=n};this.gotoAnchor=function(n){window.location.hash=n};this.getQueryString=function(n,t){t==null&&(t="");n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var r=new RegExp("[\\?&]"+n+"=([^&#]*)"),i=r.exec(window.location.href);return i==null?t:i[1]};this.getQueryStringAsInteger=function(n){var t=parseInt(this.getQueryString(n,0));return isNaN(t)&&(t=0),t};this.closeAndReload=function(){self.close();opener.window.location.reload()};this.reloadPage=function(){window.location.reload()};this.showElementById=function(n){this.showElement(n)};this.showElement=function(n){this.showHideElement(n,!1)};this.disableElementById=function(n){var t=document.getElementById(n);t.disabled=!0};this.enableElementById=function(n){var t=document.getElementById(n);t.disabled=!1};this.hideElementById=function(n){this.hideElement(n)};this.hideElement=function(n){this.showHideElement(n,!0)};this.showHideElement=function(n,t){var i=document.getElementById(n),r;i&&(t?i.style.display="none":(r="block",i.nodeName=="LABEL"&&(r=""),i.style.display=r))};this.getJSONStringByObject=function(n){return JSON.stringify(n)};this.getObjectByJSONString=function(n){return JSON.parse(n)};this.getUrl=function(){return window.location.href};this.getIdsByElementName=function(n){var i=[],r=document.getElementsByTagName("input"),t;for(item in r)t=r[item],t.name==n&&t.checked&&i.push(parseInt(t.value));return i};this.selectAllByElementName=function(n,t){var r=document.getElementsByTagName("input"),i;for(item in r)i=r[item],i.name==n&&(i.checked=t)};this.blank=function(n,t){var i="",r=document.getElementById(n);if(r!=null?(i=r.value,this.isEmpty(i,t)&&r.focus()):alert("Unable to find element id: "+n),i==null||i=="")throw"JShareable.blank - Abort Execution";return i};this.isEmpty=function(n,t){var i=!1;return(n==null||n=="")&&(t&&alert(t),i=!0),i};this.pleaseWait=function(n,t){var i=document.getElementById(n);i.disabled=!0;t||(t="Please wait...");i.value=t};t=function(n,t){var i=typeof screenX!="undefined"?window.screenX:window.screenLeft,r=typeof screenY!="undefined"?window.screenY:window.screenTop,u=typeof outerWidth!="undefined"?window.outerWidth:document.documentElement.clientWidth,f=typeof outerHeight!="undefined"?window.outerHeight:document.documentElement.clientHeight-22,e=i<0?window.screen.width+i:i,o=parseInt(e+(u-n)/2,10),s=parseInt(r+(f-t)/2.5,10);return"width="+n+",height="+t+",left="+o+",top="+s+",scrollbars=1"};this.showMsgBox=function(n,t,i){MsgBox.showUrl("",i,n,t);return};this.showMsgBox500=function(n,t){this.showMsgBox(550,500,n,t)};this.showMsgBox800=function(n,t){this.showMsgBox(800,750,n,t)}},documentOverlay;typeof String.prototype.startsWith!="function"&&(String.prototype.startsWith=function(n){return this.indexOf(n)==0});String.prototype.trim=function(){return this.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};String.prototype.ltrim=function(){return this.replace(/^\s+/,"")};String.prototype.rtrim=function(){return this.replace(/\s+$/,"")};String.prototype.fulltrim=function(){return this.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g,"").replace(/\s+/g," ")};String.prototype.contains=function(n){return this.indexOf(n)!=-1};String.prototype.replaceAll=function(n,t,i){return this.replace(new RegExp(n.replace(/([\/\,\!\\\^\$\{\}\[\]\(\)\.\*\+\?\|\<\>\-\&])/g,"\\$&"),i?"gi":"g"),typeof t=="string"?t.replace(/\$/g,"$$$$"):t)};documentOverlay={show:function(){var t="black",i=.7,n=document.getElementById("doc_overlay");n?documentOverlay.style(n,{background:t||"#000",display:"block"}):(n=document.createElement("div"),n.id="doc_overlay",documentOverlay.style(n,{position:"absolute",top:0,left:0,width:"100%",height:documentOverlay.getDocHeight()+"px",background:t,zIndex:1e3,opacity:i,filter:"alpha(opacity="+i*100+")"}),document.getElementsByTagName("body")[0].appendChild(n))},hide:function(){var n=document.getElementById("doc_overlay");n.style.display="none"},style:function(n,t){for(var i in t)n.style[i]=t[i]},getDocHeight:function(){var n,t;return self.innerHeight?n=self.innerHeight:document.documentElement&&document.documentElement.clientHeight&&(n=document.documentElement.clientHeight),document.body&&(t=document.body.clientHeight),t>n&&(n=t),n}}