if(typeof Array.prototype.indexOf!="function"){Array.prototype.indexOf=function(b){for(var a=0,c=this.length;a<c;a++){if(this[a]==b){return a}}return -1}}if(typeof String.prototype.trim!="function"){String.prototype.trim=function(){return this.replace(/^\s*/,"").replace(/\s*$/,"")}}var _loadList=[];if(window.addEventListener){window.addEventListener("DOMContentLoaded",$ol,false);window.addEventListener("load",$ol,false)}else{document.onreadystatechange=$ol;window.attachEvent("onload",$ol)}function $ol(){if(window.removeEventListener){window.removeEventListener("DOMContentLoaded",$ol,false);window.removeEventListener("load",$ol,false)}else{if(document.readyState!="complete"){return}document.onreadystatechange=null;window.detachEvent("onload",$ol)}for(var a=0,b=_loadList.length;a<b;a++){_loadList[a]()}}function $(a){return document.getElementById(a)}function $c(a){while(a.lastChild){a.removeChild(a.lastChild)}}function $e(f,g,d,c){if(!g){f.appendChild(document.createTextNode(d));return f}var e=document.createElement(g);if(typeof d=="string"){e.appendChild(document.createTextNode(d))}for(var b in c){switch(b){case"class":case"for":break;default:e.setAttribute(b,c[b]);break}}if(f!=null){f.appendChild(e)}if(typeof c!="undefined"){if(typeof c["class"]!="undefined"){e.className=c["class"]}if(typeof c["for"]!="undefined"){e.htmlFor=c["for"]}}return e}function $ea(c,a){for(var b=0,d=a.length;b<d;b++){$e(c,a[b][0],a[b][1],a[b][2])}return c}function $cna(c,a){var b=c.className.split(/\s+/);if(b.length&&b[0]==""){b.shift()}if(b.length&&b[b.length-1]==""){b.pop()}if(b.indexOf(a)<0){b.push(a)}c.className=b.join(" ")}function $cnr(d,a){var c=d.className.split(/\s+/);if(c.length&&c[0]==""){c.shift()}if(c.length&&c[c.length-1]==""){c.pop()}var b=c.indexOf(a);if(b>=0){c.splice(b,1)}d.className=c.join(" ")}function $cnc(c,a){var b=c.className.split(/\s+/);return b.indexOf(a)>=0}function $up(b,c){c=c.toUpperCase();var a=b.parentNode;while(a&&a.nodeName.toUpperCase()!=c){a=a.parentNode}return a}if(typeof JSON!="object"||typeof JSON.stringify!="function"){var JSON={$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(c){var a=JSON.$specialChars[c];if(a){return a}var b=c.charCodeAt().toString(16);while(b.length<4){b="0"+b}return"\\u"+b},stringify:function(g){switch(typeof g){case"number":case"boolean":return g.toString();case"string":return'"'+g.replace(/[\x00-\x1f\u0080-\uffff\\"]/g,JSON.$replaceChars)+'"';case"object":var e=[];var a=true;var b=0;for(var d in g){if(typeof g[d]!="function"){if(d!=b){a=false}b++}}for(var d in g){var f=g[d];var c=JSON.stringify(f);if(c){e.push(a?c:JSON.stringify(d)+":"+c)}}if(a){return"["+e+"]"}else{return"{"+e+"}"}}return null}}};
Date.dayInitials=["S","M","T","W","T","F","S"];Date.monthShortNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Date.monthFullNames=["January","February","March","April","May","June","July","August","September","October","November","December"];Date.fromISODate=function(b){if(b){var a=b.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})([ T]([0-9]{2}):([0-9]{2}):([0-9]{2}))?/);if(a&&a[4]){return new Date(a[1],a[2]-1,a[3],a[5],a[6],a[7])}else{if(a){return new Date(a[1],a[2]-1,a[3])}}}return null};Date.prototype.toISODate=function(f){var e=this.getFullYear();var a=this.getMonth()+1;var c=this.getDate();var b=e+"-"+(a<10?"0"+a:a)+"-"+(c<10?"0"+c:c);if(f){return b+" "+this.toISOTime()}return b};Date.prototype.toISOTime=function(){var c=this.getHours();var a=this.getMinutes();var b=this.getSeconds();return(c<10?"0"+c:c)+":"+(a<10?"0"+a:a)+":"+(b<10?"0"+b:b)};Date.prototype.toMyFullDate=function(){return Date.monthFullNames[this.getMonth()]+" "+this.getDate()+", "+this.getFullYear()};Date.prototype.toMyDate=function(b){var a=this.getDate()+" "+Date.monthShortNames[this.getMonth()]+", "+this.getFullYear();if(b){return a+" "+this.toMyTime()}return a};Date.prototype.toMyTime=function(){var b=this.getHours();var a=this.getMinutes();return(b<13?(b==0?"12":b):b-12)+":"+(a<10?"0"+a:a)+(b<12?"am":"pm")};Date.prototype.isMidnight=function(){return this.getHours()==0&&this.getMinutes()==0&&this.getSeconds()==0};Date.prototype.isSameDate=function(a){return a&&this.getFullYear()==a.getFullYear()&&this.getMonth()==a.getMonth()&&this.getDate()==a.getDate()};Date.prototype.isSameMonth=function(a){return a&&this.getFullYear()==a.getFullYear()&&this.getMonth()==a.getMonth()};Date.prototype.isToday=function(){return this.isSameDate(new Date())};Date.fromHumanDate=function(d){var b=new Date();if(d=="yesterday"){return new Date(b.getFullYear(),b.getMonth(),b.getDate()-1).valueOf()}else{if(d=="today"||d=="now"){return new Date(b.getFullYear(),b.getMonth(),b.getDate()).valueOf()}else{if(d=="tomorrow"){return new Date(b.getFullYear(),b.getMonth(),b.getDate()+1).valueOf()}}}var c=new Date(Date.parse(d));var a=d.match(new RegExp("^([0-9]{1,2})[ -/]([0-9]{1,2})[ -/]((19|20)?[0-9]{2})"));if(a){if(a[3]<70){a[3]="20"+a[3]}else{if(a[3]<100){a[3]="19"+a[3]}}c.setFullYear(a[3]);c.setMonth(a[2]-1);c.setDate(a[1])}return c.valueOf()};function formatDate(a){if(a.isMidnight()){return a.getDate()+" "+Date.monthShortNames[a.getMonth()]}else{return a.getDate()+" "+Date.monthShortNames[a.getMonth()]+", "+a.toMyTime()}}function formatDateRange(b,a){if(b>=a){return formatDate(b)}else{if(b.isSameDate(a)){return b.getDate()+" "+Date.monthShortNames[b.getMonth()]+", "+b.toMyTime()+" - "+a.toMyTime()}else{if(b.isSameMonth(a)&&b.isMidnight()&&a.isMidnight()){return b.getDate()+" - "+formatDate(a)}else{return formatDate(b)+" - "+formatDate(a)}}}};
var TextBoxUtils={doTextBox:function(a){if(a.getAttribute("dt:pf")){this.doPasswordFake(a)}else{if(a.getAttribute("dt:hs")){this.doHelpString(a)}}if(a.getAttribute("dt:int")){a.onkeydown=this.Integer.keyDown}else{if(a.getAttribute("dt:pn")){a.onkeydown=this.PhoneNumber.keyDown;a.onkeyup=this.PhoneNumber.keyUp}}},doHelpString:function(a){if(typeof a.placeholder=="string"){a.placeholder=a.getAttribute("dt:hs");a.removeAttribute("dt:hs");return}if(a.value==""||a.value==a.getAttribute("dt:hs")){$cna(a,"helpstring");a.value=a.getAttribute("dt:hs")}a.onfocus=function(){if($cnc(a,"helpstring")){$cnr(a,"helpstring");a.value=""}};a.onblur=function(){if(a.value==""){$cna(a,"helpstring");a.value=a.getAttribute("dt:hs")}}},doPasswordFake:function(a){var b=$(a.getAttribute("dt:pf"));if(typeof b.placeholder=="string"){b.placeholder=a.getAttribute("dt:hs");a.parentNode.removeChild(a);return}$cna(a,"helpstring");a.value=a.getAttribute("dt:hs");if(b.value==""){$cnr(a,"passwordfake");$cna(b,"passwordfake")}a.onfocus=function(){$cnr(b,"passwordfake");b.focus();$cna(a,"passwordfake")};b.onblur=function(){if(b.value==""){$cnr(a,"passwordfake");$cna(b,"passwordfake")}}},undoTextBox:function(a){if(a.getAttribute("dt:hs")){this.undoHelpString(a)}},undoHelpString:function(a){if($cnc(a,"helpstring")){$cnr(a,"helpstring");a.value=""}},doAllTextBoxes:function(){var a=document.getElementsByTagName("input");for(var b=0;b<a.length;b++){if(a[b].type=="text"){TextBoxUtils.doTextBox(a[b])}}},undoAllTextBoxes:function(){var a=document.getElementsByTagName("input");for(var b=0,c=a.length;b<c;b++){if(a[b].type=="text"){TextBoxUtils.undoTextBox(a[b])}}},Integer:{keyDown:function(a){if(!a){a=window.event}if(a.keyCode<=47&&a.keyCode!=32){return}if(a.keyCode>=48&&a.keyCode<=57&&!a.shiftKey){return}if(a.keyCode>=96&&a.keyCode<=105){return}if(a.keyCode>=112&&a.keyCode<=135){return}if(a.stopPropagation){a.stopPropagation();a.preventDefault()}else{a.returnValue=false}}},Real:{keyDown:function(a){if(!a){a=window.event}if(a.keyCode<=47&&a.keyCode!=32){return}if(a.keyCode>=48&&a.keyCode<=57&&!a.shiftKey){return}if(a.keyCode>=96&&a.keyCode<=105){return}if(a.keyCode>=112&&a.keyCode<=135){return}if((a.keyCode==190||a.keyCode==110)&&this.value.indexOf(".")<0){return}if(a.stopPropagation){a.stopPropagation();a.preventDefault()}else{a.returnValue=false}}},PhoneNumber:{keyDown:function(a){if(!a){a=window.event}if(a.keyCode<=47&&a.keyCode!=32){return}if(a.keyCode==48&&!a.shiftKey){return}if(a.keyCode>=49&&a.keyCode<=57&&!a.shiftKey&&this.value.length>0){return}if(a.keyCode==96){return}if(a.keyCode>=97&&a.keyCode<=105&&this.value.length>0){return}if(a.keyCode>=112&&a.keyCode<=135){return}if(a.stopPropagation){a.stopPropagation();a.preventDefault()}else{a.returnValue=false}},keyUp:function(b){if(!b){b=window.event}if(b.keyCode==8){return}var a=this.value;a=a.replace(/^(0[13-9]|02[1-9])([^ ]*)$/,function(e,d,c){return d+" "+c});this.value=a}}};_loadList.push(function(){TextBoxUtils.doAllTextBoxes()});
function makeRequest(){if(window.XMLHttpRequest){return new XMLHttpRequest()}if(window.ActiveXObject){try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(a){}}return false}function performAjax(b,d,a){var c=makeRequest();if(c){c.open("GET",b,true);c.onreadystatechange=function(){if(c.readyState==4){if(c.status==200&&c.responseXML&&c.responseXML.firstChild&&c.responseXML.lastChild.nodeName!="parsererror"){d(c)}else{a(c)}}};c.onerror=function(e){a(c,e)};c.send(null)}else{a(c)}}function performAjaxPost(b,d,g,a,h){if(!h){h="application/x-www-form-urlencoded"}var c=makeRequest();if(c){try{c.open("POST",b,true);c.onreadystatechange=function(){if(c.readyState==4){if(c.status==200&&c.responseXML!=null){g(c)}else{a(c)}}};if(c.onerror){c.onerror=function(e){a(c,e)}}c.setRequestHeader("Content-Type",h);c.setRequestHeader("Content-Length",d.length);c.setRequestHeader("Connection","close");c.send(d)}catch(f){a(c)}}else{a(c)}}function performAjaxPostWS(c,d,e,b){var a='<?xml version="1.0" encoding="utf-8" ?><soap:Envelope xmlns:tns="http://soapinterop.org/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body>'+d+"</soap:Body></soap:Envelope>";performAjaxPost(c,a,e,b,"text/xml;charset=utf-8")}function encodeXML(b){if(typeof(b)=="boolean"){return b.toString()}if(typeof(b)=="number"){return b}var a={"&":"&amp;","<":"&lt;",">":"&gt;"};b=b.replace(/[\x00-\x1f\x26\x3c\x3e\u0080-\uffff]/g,function(d){return a[d]||"&#x"+d.charCodeAt().toString(16)+";"});return b}function decodeXMLDOM(c,b){var a=c.getElementsByTagName(b);if(a.length>0&&a[0].firstChild){return a[0].firstChild.nodeValue}return""};
