function percentButtons(A){percentButton(0);percentButton(100/A);percentButton(100)
}function greater_than(B,A){return(B>A)}function getWidth(){if(window.innerWidth){return window.innerWidth-30
}if(screen){return screen.availWidth-30}return 0}function percentButton(A){document.write("&nbsp;<input type=button name=p"+A+' value="'+A+'%" onClick="setSelfPercent('+A+')">')
}function setSelfPercent(A){f=document.getElementById("purchaseForm");f.selfpercent.value=A
}function openCalc(){f=document.getElementById("purchaseForm");a=f.amount;if(!checkAmount(a)){return false
}window.open("calc?amount="+a.value,"ft_calc","width=300,height=300")}function doCalc(B,A){if((B.self.value==""&&B.notself.value=="")||(B.self.value!=""&&B.notself.value!="")){alert("Please fill in either the self or not-self field.");
return }if(B.self.value!=""){forself=true;field=B.self}else{forself=false;field=B.notself
}if(!checkAmount(field)){return }val=field.value;pc=100*val/A;if(!forself){pc=100-pc
}B.pc.value=Math.floor(pc);if(window.opener){B=window.opener.document.getElementById("purchaseForm");
B.selfpercent.value=B.pc.value}}function checkPurchaseForm(){f=document.getElementById("purchaseForm");
if(!checkAmount(f.amount)){return false}if(!checkDate(f.date)){return false}if(!checkListOrBox(f,"user_id","Person")){return false
}if(!checkListOrBox(f,"store","Store")){return false}if(!checkListOrBox(f,"description","Description")){return false
}if(!checkListOrBox(f,"selfpercent","Percentage Paid By Self")){return false}if(!checkListOrBox(f,"method","Payment Method")){return false
}return true}function checkTransferForm(){f=document.transferForm;if(!checkAmount(f.amount)){return false
}if(!checkDate(f.date)){return false}return true}function helpWindow(A){window.open("help?js=1&help="+A,"ft_helpwin","width=400,height=300,scrollbars=yes")
}function checkDate(A){re=/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]([ \t]*x[ \t]*[0-9]+)?$/;
if(!re.test(A.value)){alert("Please fill in the date field using the specified format.");
return false}return true}function checkListOrBox(f,str,name){list=eval("f."+str+"_list");
if(list.type=="hidden"){listFilled=true}else{listFilled=(list.selectedIndex>0)}box=eval("f."+str);
if(!box){if(listFilled){return true}alert('Please fill in the list box for the "'+name+'" field.');
return false}boxFilled=(box.value.length>0);if(listFilled&&boxFilled){alert('Please fill in only one of the text box and list box for the "'+name+'" field.');
return false}if(!listFilled&&!boxFilled){alert('Please fill in either the text box or the list box for the "'+name+'" field.');
return false}return true}function updateDaysAhead(A){user=A.user_id.value;pd=userPayday(user);
curOption=A.da.options[A.da.selectedIndex];curDays=curOption.value;curDaysIsPd=(curOption.text.substr(0,4)=="Next");
max=0;days=new Array();for(i=A.da.options.length-1;i>=0;i--){o=A.da.options[i];v=parseInt(o.value);
days[v]=1;if(v>max){max=v}A.da.options[i]=null}l=0;si=0;if(pd){A.da.options[l++]=new Option("Next pay day ("+formatDays(pd)+")",pd);
A.da.options[l++]=new Option("----------",0);if(curDays==pd||curDaysIsPd){si=0}}if(curDaysIsPd&&!pd){curDays=37;
curDaysIsPd=false}for(i=0;i<=max;i++){if(i==pd||!days[i]){continue}if(curDays==i&&!curDaysIsPd){si=l
}A.da.options[l++]=new Option(formatDays(i),i)}A.da.selectedIndex=si}function formatDays(A){str="";
if(A==61){return"2 months"}if(A==91){return"3 months"}if(A==182){return"6 months"
}y=Math.floor(A/365);if(y>0){str+=y+" year";if(y>1){str+="s"}}A%=365;m=Math.floor(A/31);
if(m>0){if(str.length){str+=", "}str+=m+" month";if(m>1){str+="s"}}A%=31;w=Math.floor(A/7);
if(w>0){if(str.length){str+=", "}str+=w+" week";if(w>1){str+="s"}}A%=7;if(A>0){if(str.length){str+=", "
}str+=A+" day";if(A>1){str+="s"}}return str}function mf(A,C,B){if(A[C][B]&&A[C][B]<=8){return 2
}else{if(A[C][B]){return 1}else{return 0}}}function irf(A,B){if(A[B]&&A[B]<=8){return 2
}else{if(A[B]&&A[B]<=16){return 1}else{return 0}}}function opval(A){if(A.value.length>0){return A.value
}else{return A.text}}function initBox(box){alert("s");if(document.getElementById){f=document.getElementById("purchaseForm")
}else{f=document.forms[0]}alert("c");b1=eval("f."+box+"_list");alert("d");if(!b1){return 
}b1.options[0]=new Option("","");i=1;for(di=0;di<d.length;di++){if(irf(ir,di)==2){b1.options[i++]=new Option(d[di],d[di])
}}b1.options[i++]=new Option("-------------","");is=i;for(di=0;di<d.length;di++){if(irf(ir,di)==1){b1.options[i++]=new Option(d[di],d[di])
}}if(i>is){b1.options[i++]=new Option("-------------","")}for(di=0;di<d.length;di++){if(irf(ir,di)==0){b1.options[i++]=new Option(d[di],d[di])
}}}function updateBox(box){if(box=="store"){otherBox="description"}else{otherBox="store"
}f=document.getElementById("purchaseForm");b1=eval("f."+box+"_list");b2=eval("f."+otherBox+"_list");
if(b1.options.length>0){boxValue=opval(b1.options[b1.selectedIndex])}if(b2.options.length>0){otherValue=opval(b2.options[b2.selectedIndex])
}for(i=b1.options.length;i>0;i--){b1.options[i-1]=null}b1.options[0]=new Option("","");
i=1;if(box=="store"){for(di=0;di<d.length;di++){if(otherValue==d[di]){for(si=0;si<s.length;
si++){if(mf(m,di,si)==2){b1.options[i++]=new Option(s[si],s[si])}}b1.options[i++]=new Option("-------------","");
is=i;for(si=0;si<s.length;si++){if(mf(m,di,si)==1){b1.options[i++]=new Option(s[si],s[si])
}}if(i>is){b1.options[i++]=new Option("-------------","")}for(si=0;si<s.length;si++){if(mf(m,di,si)==0){b1.options[i++]=new Option(s[si],s[si])
}}break}}if(b1.options.length==1){for(si=0;si<s.length;si++){b1.options[i++]=new Option(s[si],s[si])
}}}else{for(si=0;si<s.length;si++){if(otherValue==s[si]){b1.options[0]=new Option("","");
i=1;for(di=0;di<d.length;di++){if(mf(m,di,si)==2){b1.options[i++]=new Option(d[di],d[di])
}}b1.options[i++]=new Option("-------------","");is=i;for(di=0;di<d.length;di++){if(mf(m,di,si)==1){b1.options[i++]=new Option(d[di],d[di])
}}if(i>is){b1.options[i++]=new Option("-------------","")}for(di=0;di<d.length;di++){if(mf(m,di,si)==0){b1.options[i++]=new Option(d[di],d[di])
}}break}}if(b1.options.length==1){for(di=0;di<d.length;di++){b1.options[i++]=new Option(d[di],d[di])
}}}for(i=0;i<b1.options.length;i++){if(boxValue==b1.options[i].value){b1.selectedIndex=i;
break}}}function setSelect(B,A,C){len=B.options.length;for(i=0;i<len;i++){v=opval(B.options[i]);
if(v==C){B.selectedIndex=i;return }}A.value=C}function setText(A,B){A.value=B}function goConfirm(B,A){if(confirm(B)){self.location=A
}return false}function resizeFunc(){if(document.graph_form&&document.graph_form.winwidth){document.graph_form.winwidth.value=window.innerWidth
}}function validateAccountDetailsForm(A){at=A.adjust_type;changed=false;if(A.balance.value!=A.old_balance.value){changed=true
}if(A.adjust.value!=A.zero_adjust.value){changed=true}if(at.selectedIndex==0&&changed){alert("No adjustment type specified");
return false}return true}var ajaxpending=false;function ajaxstart(){ajaxpending=true;
document.body.style.cursor="wait"}function ajaxend(){ajaxpending=false;document.body.style.cursor="default"
}function getXmlHttpObject(){ua=navigator.userAgent;if(ua.indexOf("IEMobile")>=0||ua.indexOf("Windows CE")>=0){return false
}if(window.XMLHttpRequest){return new XMLHttpRequest()}else{if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP")
}}return false}function billcalcSetEstimates(A){f=A.form;if(A.selectedIndex==0){return 
}data=A.options[A.selectedIndex].value;comma=data.indexOf(",");if(comma<0){return 
}months=data.substr(0,comma);amount=data.substr(comma+1);fc=document.getElementById("billcalcFC");
ft=document.getElementById("billcalcFT");ft.value=months;fc.value=amount}function dec_item(A){return change_item("dec",A)
}function inc_item(A){return change_item("inc",A)}function change_item(A,B){if(ajaxpending){return true
}x=getXmlHttpObject();if(!x){return false}x.onreadystatechange=function(){if(x.readyState==4){handleCoinAdjust(x,B);
ajaxend()}};ajaxstart();x.open("GET","/lib/ajaxscripts/coinAdjust?id="+B+"&ch="+A,true);
x.send(null);return true}function handleCoinAdjust(A,B){span=document.getElementById("qty"+B);
r=A.responseText;if(r.substr(0,7)=="AJAXOK:"){r=r.substr(7);c=r.indexOf(":");n=r.substr(0,c);
msg=r.substr(c+1);span.innerHTML=n;span.style.color=(n=="0")?"#808080":"#000000";
dec=document.getElementById("dec"+B);dec.disabled=(n=="0");mismatch=document.getElementById("itemMismatch");
mismatch.innerHTML=msg}else{if(r.substr(0,9)=="AJAXFAIL:"){err=r.substr(9)}else{err="Unknown AJAX error"
}alert(err)}}function updateTxAdjust(C,B,D){var A=getXmlHttpObject();A.onreadystatechange=function(){if(A.readyState==4){handleTxAdjustResponse(A,C,B,D)
}};val=C.options[C.selectedIndex].value;A.open("GET","/lib/ajaxscripts/txSetAdjust?"+D+","+val,true);
A.send(null)}function handleTxAdjustResponse(A,C,B,D){r=A.responseText;if(r.substr(0,9)=="AJAXFAIL:"){alert(r.substr(9))
}else{if(r.substr(0,7)=="AJAXOK:"){if(document.getElementById){span=document.getElementById(B);
span.innerHTML="Updated: "+r.substr(7)}}else{alert("Unknown AJAX error: "+r)}}}function updateExpires(A){f=A.form;
if(A.name=="rt_expires"&&A.value!=""){f.rt_count.value=""}if(A.name=="rt_count"&&A.value!=""){f.rt_expires.value=""
}if(A.name=="rt_forever"&&A.checked){f.rt_count.value=f.rt_expires.value=""}if(A.name=="rp_expires"&&A.value!=""){f.rp_count.value=""
}if(A.name=="rp_count"&&A.value!=""){f.rp_expires.value=""}if(A.name=="rp_forever"&&A.checked){f.rp_count.value=f.rp_expires.value=""
}if(A.name.substr(0,2)=="rt"){f.rt_forever.checked=(f.rt_count.value==""&&f.rt_expires.value=="")
}else{f.rp_forever.checked=(f.rp_count.value==""&&f.rp_expires.value=="")}}function deleteRecurTransfer(A){if(confirm("Are you sure you want to delete this recurring payment?")){self.location.href="/finance/recurtransfers?delete_recur="+A
}}function deleteRecurPurchase(A){if(confirm("Are you sure you want to delete this recurring payment?")){self.location.href="/finance/recurpurchases?delete_recur="+A
}};
var useBSNns;if(useBSNns){if(typeof (bsn)=="undefined"){bsn={}}_bsn=bsn}else{_bsn=this
}if(typeof (_bsn.Autosuggest)=="undefined"){_bsn.Autosuggest={}}_bsn.AutoSuggest=function(C,B){if(!document.getElementById){return false
}this.fld=_bsn.DOM.getElement(C);if(!this.fld){return false}this.sInput="";this.nInputChars=0;
this.aSuggestions=[];this.iHighlighted=0;this.oP=(B)?B:{};if(!this.oP.minchars){this.oP.minchars=1
}if(!this.oP.method){this.oP.meth="get"}if(!this.oP.varname){this.oP.varname="input"
}if(!this.oP.className){this.oP.className="autosuggest"}if(!this.oP.timeout){this.oP.timeout=2500
}if(!this.oP.delay){this.oP.delay=500}if(!this.oP.offsety){this.oP.offsety=-5}if(!this.oP.shownoresults){this.oP.shownoresults=true
}if(!this.oP.noresults){this.oP.noresults="No results!"}if(!this.oP.maxheight&&this.oP.maxheight!==0){this.oP.maxheight=250
}if(!this.oP.cache&&this.oP.cache!=false){this.oP.cache=true}var A=this;this.fld.onkeypress=function(D){return A.onKeyPress(D)
};this.fld.onkeyup=function(D){return A.onKeyUp(D)};this.fld.setAttribute("autocomplete","off")
};_bsn.AutoSuggest.prototype.onKeyPress=function(E){var C=(window.event)?window.event.keyCode:E.keyCode;
var B=13;var A=9;var F=27;var D=true;switch(C){case B:this.setHighlightedValue();
D=false;break;case F:this.clearSuggestions();break}return D};_bsn.AutoSuggest.prototype.onKeyUp=function(E){var B=(window.event)?window.event.keyCode:E.keyCode;
var A=38;var C=40;var D=true;switch(B){case A:this.changeHighlight(B);D=false;break;
case C:this.changeHighlight(B);D=false;break;default:this.getSuggestions(this.fld.value)
}return D};_bsn.AutoSuggest.prototype.getSuggestions=function(D){if(D==this.sInput){return false
}if(D.length<this.oP.minchars){this.sInput="";return false}if(D.length>this.nInputChars&&this.aSuggestions.length&&this.oP.cache){var A=[];
for(var B=0;B<this.aSuggestions.length;B++){if(this.aSuggestions[B].value.substr(0,D.length).toLowerCase()==D.toLowerCase()){A.push(this.aSuggestions[B])
}}this.sInput=D;this.nInputChars=D.length;this.aSuggestions=A;this.createList(this.aSuggestions);
return false}else{this.sInput=D;this.nInputChars=D.length;var C=this;clearTimeout(this.ajID);
this.ajID=setTimeout(function(){C.doAjaxRequest()},this.oP.delay)}return false};_bsn.AutoSuggest.prototype.doAjaxRequest=function(){var F=this;
var C=this.oP.script+this.oP.varname+"="+escape(this.fld.value);var B=this.oP.meth;
var E=function(G){F.setSuggestions(G)};var D=function(G){alert("AJAX error: "+G)};
var A=new _bsn.Ajax();A.makeRequest(C,B,E,D)};_bsn.AutoSuggest.prototype.setSuggestions=function(req){this.aSuggestions=[];
if(this.oP.json){var jsondata=eval("("+req.responseText+")");for(var i=0;i<jsondata.results.length;
i++){this.aSuggestions.push({id:jsondata.results[i].id,value:jsondata.results[i].value,info:jsondata.results[i].info})
}}else{var xml=req.responseXML;var results=xml.getElementsByTagName("results")[0].childNodes;
for(var i=0;i<results.length;i++){if(results[i].hasChildNodes()){this.aSuggestions.push({id:results[i].getAttribute("id"),value:results[i].childNodes[0].nodeValue,info:results[i].getAttribute("info")})
}}}this.idAs="as_"+this.fld.id;this.createList(this.aSuggestions)};_bsn.AutoSuggest.prototype.createList=function(E){var I=this;
_bsn.DOM.removeElement(this.idAs);this.killTimeout();var A=_bsn.DOM.createElement("div",{id:this.idAs,className:this.oP.className});
var G=_bsn.DOM.createElement("ul",{id:"as_ul"});for(var D=0;D<E.length;D++){var B=E[D].value;
var P=B.toLowerCase().indexOf(this.sInput.toLowerCase());var F=B.substring(0,P)+"<em>"+B.substring(P,P+this.sInput.length)+"</em>"+B.substring(P+this.sInput.length);
var L=_bsn.DOM.createElement("span",{},F,true);if(E[D].info!=""){var O=_bsn.DOM.createElement("br",{});
L.appendChild(O);var C=_bsn.DOM.createElement("small",{},E[D].info);L.appendChild(C)
}var K=_bsn.DOM.createElement("a",{href:"#"});var N=_bsn.DOM.createElement("span",{className:"tl"}," ");
var H=_bsn.DOM.createElement("span",{className:"tr"}," ");K.appendChild(N);K.appendChild(H);
K.appendChild(L);K.name=D+1;K.onclick=function(){I.setHighlightedValue();return false
};K.onmouseover=function(){I.setHighlight(this.name)};var M=_bsn.DOM.createElement("li",{},K);
G.appendChild(M)}if(E.length==0){var M=_bsn.DOM.createElement("li",{className:"as_warning"},this.oP.noresults);
G.appendChild(M)}A.appendChild(G);var J=_bsn.DOM.getPos(this.fld);A.style.left=J.x+"px";
A.style.top=(J.y+this.fld.offsetHeight+this.oP.offsety)+"px";A.style.width=this.fld.offsetWidth+"px";
A.onmouseover=function(){I.killTimeout()};A.onmouseout=function(){I.resetTimeout()
};document.getElementsByTagName("body")[0].appendChild(A);this.iHighlighted=0;var I=this;
this.toID=setTimeout(function(){I.clearSuggestions()},this.oP.timeout)};_bsn.AutoSuggest.prototype.changeHighlight=function(A){var B=_bsn.DOM.getElement("as_ul");
if(!B){return false}var C;if(A==40){C=this.iHighlighted+1}else{if(A==38){C=this.iHighlighted-1
}}if(C>B.childNodes.length){C=B.childNodes.length}if(C<1){C=1}this.setHighlight(C)
};_bsn.AutoSuggest.prototype.setHighlight=function(B){var A=_bsn.DOM.getElement("as_ul");
if(!A){return false}if(this.iHighlighted>0){this.clearHighlight()}this.iHighlighted=Number(B);
A.childNodes[this.iHighlighted-1].className="as_highlight";this.killTimeout()};_bsn.AutoSuggest.prototype.clearHighlight=function(){var A=_bsn.DOM.getElement("as_ul");
if(!A){return false}if(this.iHighlighted>0){A.childNodes[this.iHighlighted-1].className="";
this.iHighlighted=0}};_bsn.AutoSuggest.prototype.setHighlightedValue=function(){if(this.iHighlighted){this.sInput=this.fld.value=this.aSuggestions[this.iHighlighted-1].value;
this.fld.focus();if(this.fld.selectionStart){this.fld.setSelectionRange(this.sInput.length,this.sInput.length)
}this.clearSuggestions();if(typeof (this.oP.callback)=="function"){this.oP.callback(this.aSuggestions[this.iHighlighted-1])
}}};_bsn.AutoSuggest.prototype.killTimeout=function(){clearTimeout(this.toID)};_bsn.AutoSuggest.prototype.resetTimeout=function(){clearTimeout(this.toID);
var A=this;this.toID=setTimeout(function(){A.clearSuggestions()},1000)};_bsn.AutoSuggest.prototype.clearSuggestions=function(){this.killTimeout();
var A=_bsn.DOM.getElement(this.idAs);var C=this;if(A){var B=new _bsn.Fader(A,1,0,250,function(){_bsn.DOM.removeElement(C.idAs)
})}};if(typeof (_bsn.Ajax)=="undefined"){_bsn.Ajax={}}_bsn.Ajax=function(){this.req={};
this.isIE=false};_bsn.Ajax.prototype.makeRequest=function(B,A,C,D){if(A!="POST"){A="GET"
}this.onComplete=C;this.onError=D;var E=this;if(window.XMLHttpRequest){this.req=new XMLHttpRequest();
this.req.onreadystatechange=function(){E.processReqChange()};this.req.open("GET",B,true);
this.req.send(null)}else{if(window.ActiveXObject){this.req=new ActiveXObject("Microsoft.XMLHTTP");
if(this.req){this.req.onreadystatechange=function(){E.processReqChange()};this.req.open(A,B,true);
this.req.send()}}}};_bsn.Ajax.prototype.processReqChange=function(){if(this.req.readyState==4){if(this.req.status==200){this.onComplete(this.req)
}else{this.onError(this.req.status)}}};if(typeof (_bsn.DOM)=="undefined"){_bsn.DOM={}
}_bsn.DOM.createElement=function(E,B,A,D){var F=document.createElement(E);if(!F){return false
}for(var C in B){F[C]=B[C]}if(typeof (A)=="string"&&!D){F.appendChild(document.createTextNode(A))
}else{if(typeof (A)=="string"&&D){F.innerHTML=A}else{if(typeof (A)=="object"){F.appendChild(A)
}}}return F};_bsn.DOM.clearElement=function(B){var A=this.getElement(B);if(!A){return false
}while(A.childNodes.length){A.removeChild(A.childNodes[0])}return true};_bsn.DOM.removeElement=function(A){var B=this.getElement(A);
if(!B){return false}else{if(B.parentNode.removeChild(B)){return true}else{return false
}}};_bsn.DOM.replaceContent=function(D,A,B){var C=this.getElement(D);if(!C){return false
}this.clearElement(C);if(typeof (A)=="string"&&!B){C.appendChild(document.createTextNode(A))
}else{if(typeof (A)=="string"&&B){C.innerHTML=A}else{if(typeof (A)=="object"){C.appendChild(A)
}}}};_bsn.DOM.getElement=function(B){if(typeof (B)=="undefined"){return false}else{if(typeof (B)=="string"){var A=document.getElementById(B);
if(!A){return false}else{if(typeof (A.appendChild)!="undefined"){return A}else{return false
}}}else{if(typeof (B.appendChild)!="undefined"){return B}else{return false}}}};_bsn.DOM.appendChildren=function(E,B){var D=this.getElement(E);
if(!D){return false}if(typeof (B)!="object"){return false}for(var C=0;C<B.length;
C++){var A=B[C];if(typeof (A)=="string"){D.appendChild(document.createTextNode(A))
}else{if(typeof (A)=="object"){D.appendChild(A)}}}};_bsn.DOM.getPos=function(B){var B=this.getElement(B);
var C=B;var D=0;if(C.offsetParent){while(C.offsetParent){D+=C.offsetLeft;C=C.offsetParent
}}else{if(C.x){D+=C.x}}var C=B;var A=0;if(C.offsetParent){while(C.offsetParent){A+=C.offsetTop;
C=C.offsetParent}}else{if(C.y){A+=C.y}}return{x:D,y:A}};if(typeof (_bsn.Fader)=="undefined"){_bsn.Fader={}
}_bsn.Fader=function(B,F,E,A,D){if(!B){return false}this.ele=B;this.from=F;this.to=E;
this.callback=D;this.nDur=A;this.nInt=50;this.nTime=0;var C=this;this.nID=setInterval(function(){C._fade()
},this.nInt)};_bsn.Fader.prototype._fade=function(){this.nTime+=this.nInt;var A=Math.round(this._tween(this.nTime,this.from,this.to,this.nDur)*100);
var C=A/100;if(this.ele.filters){try{this.ele.filters.item("DXImageTransform.Microsoft.Alpha").opacity=A
}catch(B){this.ele.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+A+")"
}}else{this.ele.style.opacity=C}if(this.nTime==this.nDur){clearInterval(this.nID);
if(this.callback!=undefined){this.callback()}}};_bsn.Fader.prototype._tween=function(B,A,D,C){return A+((D-A)*(B/C))
};
function getAnchorPosition(E){var C=false;var I=new Object();var H=0,G=0;var D=false,A=false,K=false;
if(document.getElementById){D=true}else{if(document.all){A=true}else{if(document.layers){K=true
}}}if(D&&document.all){H=AnchorPosition_getPageOffsetLeft(document.all[E]);G=AnchorPosition_getPageOffsetTop(document.all[E])
}else{if(D){var B=document.getElementById(E);H=AnchorPosition_getPageOffsetLeft(B);
G=AnchorPosition_getPageOffsetTop(B)}else{if(A){H=AnchorPosition_getPageOffsetLeft(document.all[E]);
G=AnchorPosition_getPageOffsetTop(document.all[E])}else{if(K){var J=0;for(var F=0;
F<document.anchors.length;F++){if(document.anchors[F].name==E){J=1;break}}if(J==0){I.x=0;
I.y=0;return I}H=document.anchors[F].x;G=document.anchors[F].y}else{I.x=0;I.y=0;return I
}}}}I.x=H;I.y=G;return I}function getAnchorWindowPosition(B){var C=getAnchorPosition(B);
var A=0;var D=0;if(document.getElementById){if(isNaN(window.screenX)){A=C.x-document.body.scrollLeft+window.screenLeft;
D=C.y-document.body.scrollTop+window.screenTop}else{A=C.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
D=C.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset
}}else{if(document.all){A=C.x-document.body.scrollLeft+window.screenLeft;D=C.y-document.body.scrollTop+window.screenTop
}else{if(document.layers){A=C.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
D=C.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset
}}}C.x=A;C.y=D;return C}function AnchorPosition_getPageOffsetLeft(B){var A=B.offsetLeft;
while((B=B.offsetParent)!=null){A+=B.offsetLeft}return A}function AnchorPosition_getWindowOffsetLeft(A){return AnchorPosition_getPageOffsetLeft(A)-document.body.scrollLeft
}function AnchorPosition_getPageOffsetTop(A){var B=A.offsetTop;while((A=A.offsetParent)!=null){B+=A.offsetTop
}return B}function AnchorPosition_getWindowOffsetTop(A){return AnchorPosition_getPageOffsetTop(A)-document.body.scrollTop
}var MONTH_NAMES=new Array("January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
var DAY_NAMES=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat");
function LZ(A){return(A<0||A>9?"":"0")+A}function isDate(B,C){var A=getDateFromFormat(B,C);
if(A==0){return false}return true}function compareDates(D,E,C,F){var B=getDateFromFormat(D,E);
var A=getDateFromFormat(C,F);if(B==0||A==0){return -1}else{if(B>A){return 1}}return 0
}function formatDate(b,X){X=X+"";var A="";var i=0;var e="";var F="";var J=b.getYear()+"";
var G=b.getMonth()+1;var a=b.getDate();var N=b.getDay();var L=b.getHours();var U=b.getMinutes();
var P=b.getSeconds();var Q,S,C,R,f,D,Z,Y,V,O,j,L,g,I,B,W;var T=new Object();if(J.length<4){J=""+(J-0+1900)
}T.y=""+J;T.yyyy=J;T.yy=J.substring(2,4);T.M=G;T.MM=LZ(G);T.MMM=MONTH_NAMES[G-1];
T.NNN=MONTH_NAMES[G+11];T.d=a;T.dd=LZ(a);T.E=DAY_NAMES[N+7];T.EE=DAY_NAMES[N];T.H=L;
T.HH=LZ(L);if(L==0){T.h=12}else{if(L>12){T.h=L-12}else{T.h=L}}T.hh=LZ(T.h);if(L>11){T.K=L-12
}else{T.K=L}T.k=L+1;T.KK=LZ(T.K);T.kk=LZ(T.k);if(L>11){T.a="PM"}else{T.a="AM"}T.m=U;
T.mm=LZ(U);T.s=P;T.ss=LZ(P);while(i<X.length){e=X.charAt(i);F="";while((X.charAt(i)==e)&&(i<X.length)){F+=X.charAt(i++)
}if(T[F]!=null){A=A+T[F]}else{A=A+F}}return A}function _isInteger(C){var A="1234567890";
for(var B=0;B<C.length;B++){if(A.indexOf(C.charAt(B))==-1){return false}}return true
}function _getInt(F,D,E,C){for(var A=C;A>=E;A--){var B=F.substring(D,D+A);if(B.length<E){return null
}if(_isInteger(B)){return B}}return null}function getDateFromFormat(U,N){U=U+"";N=N+"";
var S=0;var T=0;var Q="";var E="";var J="";var G,F;var B=new Date();var H=B.getYear();
var R=B.getMonth()+1;var P=1;var C=B.getHours();var O=B.getMinutes();var L=B.getSeconds();
var I="";while(T<N.length){Q=N.charAt(T);E="";while((N.charAt(T)==Q)&&(T<N.length)){E+=N.charAt(T++)
}if(E=="yyyy"||E=="yy"||E=="y"){if(E=="yyyy"){G=4;F=4}if(E=="yy"){G=2;F=2}if(E=="y"){G=2;
F=4}H=_getInt(U,S,G,F);if(H==null){return 0}S+=H.length;if(H.length==2){if(H>70){H=1900+(H-0)
}else{H=2000+(H-0)}}}else{if(E=="MMM"||E=="NNN"){R=0;for(var M=0;M<MONTH_NAMES.length;
M++){var D=MONTH_NAMES[M];if(U.substring(S,S+D.length).toLowerCase()==D.toLowerCase()){if(E=="MMM"||(E=="NNN"&&M>11)){R=M+1;
if(R>12){R-=12}S+=D.length;break}}}if((R<1)||(R>12)){return 0}}else{if(E=="EE"||E=="E"){for(var M=0;
M<DAY_NAMES.length;M++){var K=DAY_NAMES[M];if(U.substring(S,S+K.length).toLowerCase()==K.toLowerCase()){S+=K.length;
break}}}else{if(E=="MM"||E=="M"){R=_getInt(U,S,E.length,2);if(R==null||(R<1)||(R>12)){return 0
}S+=R.length}else{if(E=="dd"||E=="d"){P=_getInt(U,S,E.length,2);if(P==null||(P<1)||(P>31)){return 0
}S+=P.length}else{if(E=="hh"||E=="h"){C=_getInt(U,S,E.length,2);if(C==null||(C<1)||(C>12)){return 0
}S+=C.length}else{if(E=="HH"||E=="H"){C=_getInt(U,S,E.length,2);if(C==null||(C<0)||(C>23)){return 0
}S+=C.length}else{if(E=="KK"||E=="K"){C=_getInt(U,S,E.length,2);if(C==null||(C<0)||(C>11)){return 0
}S+=C.length}else{if(E=="kk"||E=="k"){C=_getInt(U,S,E.length,2);if(C==null||(C<1)||(C>24)){return 0
}S+=C.length;C--}else{if(E=="mm"||E=="m"){O=_getInt(U,S,E.length,2);if(O==null||(O<0)||(O>59)){return 0
}S+=O.length}else{if(E=="ss"||E=="s"){L=_getInt(U,S,E.length,2);if(L==null||(L<0)||(L>59)){return 0
}S+=L.length}else{if(E=="a"){if(U.substring(S,S+2).toLowerCase()=="am"){I="AM"}else{if(U.substring(S,S+2).toLowerCase()=="pm"){I="PM"
}else{return 0}}S+=2}else{if(U.substring(S,S+E.length)!=E){return 0}else{S+=E.length
}}}}}}}}}}}}}}if(S!=U.length){return 0}if(R==2){if(((H%4==0)&&(H%100!=0))||(H%400==0)){if(P>29){return 0
}}else{if(P>28){return 0}}}if((R==4)||(R==6)||(R==9)||(R==11)){if(P>30){return 0}}if(C<12&&I=="PM"){C=C-0+12
}else{if(C>11&&I=="AM"){C-=12}}var A=new Date(H,R-1,P,C,O,L);return A.getTime()}function parseDate(G){var D=(arguments.length==2)?arguments[1]:false;
generalFormats=new Array("y-M-d","MMM d, y","MMM d,y","y-MMM-d","d-MMM-y","MMM d");
monthFirst=new Array("M/d/y","M-d-y","M.d.y","MMM-d","M/d","M-d");dateFirst=new Array("d/M/y","d-M-y","d.M.y","d-MMM","d/M","d-M");
var B=new Array("generalFormats",D?"dateFirst":"monthFirst",D?"monthFirst":"dateFirst");
var F=null;for(var E=0;E<B.length;E++){var A=window[B[E]];for(var C=0;C<A.length;
C++){F=getDateFromFormat(G,A[C]);if(F!=0){return new Date(F)}}}return null}function PopupWindow_getXYPosition(A){var B;
if(this.type=="WINDOW"){B=getAnchorWindowPosition(A)}else{B=getAnchorPosition(A)}this.x=B.x;
this.y=B.y}function PopupWindow_setSize(A,B){this.width=A;this.height=B}function PopupWindow_populate(A){this.contents=A;
this.populated=false}function PopupWindow_setUrl(A){this.url=A}function PopupWindow_setWindowProperties(A){this.windowProperties=A
}function PopupWindow_refresh(){if(this.divName!=null){if(this.use_gebi){document.getElementById(this.divName).innerHTML=this.contents
}else{if(this.use_css){document.all[this.divName].innerHTML=this.contents}else{if(this.use_layers){var A=document.layers[this.divName];
A.document.open();A.document.writeln(this.contents);A.document.close()}}}}else{if(this.popupWindow!=null&&!this.popupWindow.closed){if(this.url!=""){this.popupWindow.location.href=this.url
}else{this.popupWindow.document.open();this.popupWindow.document.writeln(this.contents);
this.popupWindow.document.close()}this.popupWindow.focus()}}}function PopupWindow_showPopup(A){this.getXYPosition(A);
this.x+=this.offsetX;this.y+=this.offsetY;if(!this.populated&&(this.contents!="")){this.populated=true;
this.refresh()}if(this.divName!=null){if(this.use_gebi){document.getElementById(this.divName).style.left=this.x+"px";
document.getElementById(this.divName).style.top=this.y+"px";document.getElementById(this.divName).style.visibility="visible"
}else{if(this.use_css){document.all[this.divName].style.left=this.x;document.all[this.divName].style.top=this.y;
document.all[this.divName].style.visibility="visible"}else{if(this.use_layers){document.layers[this.divName].left=this.x;
document.layers[this.divName].top=this.y;document.layers[this.divName].visibility="visible"
}}}}else{if(this.popupWindow==null||this.popupWindow.closed){if(this.x<0){this.x=0
}if(this.y<0){this.y=0}if(screen&&screen.availHeight){if((this.y+this.height)>screen.availHeight){this.y=screen.availHeight-this.height
}}if(screen&&screen.availWidth){if((this.x+this.width)>screen.availWidth){this.x=screen.availWidth-this.width
}}var B=window.opera||(document.layers&&!navigator.mimeTypes["*"])||navigator.vendor=="KDE"||(document.childNodes&&!document.all&&!navigator.taintEnabled);
this.popupWindow=window.open(B?"":"about:blank","window_"+A,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+"")
}this.refresh()}}function PopupWindow_hidePopup(){if(this.divName!=null){if(this.use_gebi){document.getElementById(this.divName).style.visibility="hidden"
}else{if(this.use_css){document.all[this.divName].style.visibility="hidden"}else{if(this.use_layers){document.layers[this.divName].visibility="hidden"
}}}}else{if(this.popupWindow&&!this.popupWindow.closed){this.popupWindow.close();
this.popupWindow=null}}}function PopupWindow_isClicked(B){if(this.divName!=null){if(this.use_layers){var C=B.pageX;
var D=B.pageY;var A=document.layers[this.divName];if((C>A.left)&&(C<A.left+A.clip.width)&&(D>A.top)&&(D<A.top+A.clip.height)){return true
}else{return false}}else{if(document.all){var A=window.event.srcElement;while(A.parentElement!=null){if(A.id==this.divName){return true
}A=A.parentElement}return false}else{if(this.use_gebi&&B){var A=B.originalTarget;
while(A.parentNode!=null){if(A.id==this.divName){return true}A=A.parentNode}return false
}}}return false}return false}function PopupWindow_hideIfNotClicked(A){if(this.autoHideEnabled&&!this.isClicked(A)){this.hidePopup()
}}function PopupWindow_autoHide(){this.autoHideEnabled=true}function PopupWindow_hidePopupWindows(C){for(var A=0;
A<popupWindowObjects.length;A++){if(popupWindowObjects[A]!=null){var B=popupWindowObjects[A];
B.hideIfNotClicked(C)}}}function PopupWindow_attachListener(){if(document.layers){document.captureEvents(Event.MOUSEUP)
}window.popupWindowOldEventListener=document.onmouseup;if(window.popupWindowOldEventListener!=null){document.onmouseup=new Function("window.popupWindowOldEventListener(); PopupWindow_hidePopupWindows();")
}else{document.onmouseup=PopupWindow_hidePopupWindows}}function PopupWindow(){if(!window.popupWindowIndex){window.popupWindowIndex=0
}if(!window.popupWindowObjects){window.popupWindowObjects=new Array()}if(!window.listenerAttached){window.listenerAttached=true;
PopupWindow_attachListener()}this.index=popupWindowIndex++;popupWindowObjects[this.index]=this;
this.divName=null;this.popupWindow=null;this.width=0;this.height=0;this.populated=false;
this.visible=false;this.autoHideEnabled=false;this.contents="";this.url="";this.windowProperties="toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable,alwaysRaised,dependent,titlebar=no";
if(arguments.length>0){this.type="DIV";this.divName=arguments[0]}else{this.type="WINDOW"
}this.use_gebi=false;this.use_css=false;this.use_layers=false;if(document.getElementById){this.use_gebi=true
}else{if(document.all){this.use_css=true}else{if(document.layers){this.use_layers=true
}else{this.type="WINDOW"}}}this.offsetX=0;this.offsetY=0;this.getXYPosition=PopupWindow_getXYPosition;
this.populate=PopupWindow_populate;this.setUrl=PopupWindow_setUrl;this.setWindowProperties=PopupWindow_setWindowProperties;
this.refresh=PopupWindow_refresh;this.showPopup=PopupWindow_showPopup;this.hidePopup=PopupWindow_hidePopup;
this.setSize=PopupWindow_setSize;this.isClicked=PopupWindow_isClicked;this.autoHide=PopupWindow_autoHide;
this.hideIfNotClicked=PopupWindow_hideIfNotClicked}function CalendarPopup(){var A;
if(arguments.length>0){A=new PopupWindow(arguments[0])}else{A=new PopupWindow();A.setSize(150,175)
}A.offsetX=-152;A.offsetY=25;A.autoHide();A.monthNames=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
A.monthAbbreviations=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
A.dayHeaders=new Array("S","M","T","W","T","F","S");A.returnFunction="CP_tmpReturnFunction";
A.returnMonthFunction="CP_tmpReturnMonthFunction";A.returnQuarterFunction="CP_tmpReturnQuarterFunction";
A.returnYearFunction="CP_tmpReturnYearFunction";A.weekStartDay=0;A.isShowYearNavigation=false;
A.displayType="date";A.disabledWeekDays=new Object();A.disabledDatesExpression="";
A.yearSelectStartOffset=2;A.currentDate=null;A.todayText="Today";A.cssPrefix="";A.isShowNavigationDropdowns=false;
A.isShowYearNavigationInput=false;window.CP_calendarObject=null;window.CP_targetInput=null;
window.CP_dateFormat="MM/dd/yyyy";A.copyMonthNamesToWindow=CP_copyMonthNamesToWindow;
A.setReturnFunction=CP_setReturnFunction;A.setReturnMonthFunction=CP_setReturnMonthFunction;
A.setReturnQuarterFunction=CP_setReturnQuarterFunction;A.setReturnYearFunction=CP_setReturnYearFunction;
A.setMonthNames=CP_setMonthNames;A.setMonthAbbreviations=CP_setMonthAbbreviations;
A.setDayHeaders=CP_setDayHeaders;A.setWeekStartDay=CP_setWeekStartDay;A.setDisplayType=CP_setDisplayType;
A.setDisabledWeekDays=CP_setDisabledWeekDays;A.addDisabledDates=CP_addDisabledDates;
A.setYearSelectStartOffset=CP_setYearSelectStartOffset;A.setTodayText=CP_setTodayText;
A.showYearNavigation=CP_showYearNavigation;A.showCalendar=CP_showCalendar;A.hideCalendar=CP_hideCalendar;
A.getStyles=getCalendarStyles;A.refreshCalendar=CP_refreshCalendar;A.getCalendar=CP_getCalendar;
A.select=CP_select;A.setCssPrefix=CP_setCssPrefix;A.showNavigationDropdowns=CP_showNavigationDropdowns;
A.showYearNavigationInput=CP_showYearNavigationInput;A.copyMonthNamesToWindow();return A
}function CP_copyMonthNamesToWindow(){if(typeof (window.MONTH_NAMES)!="undefined"&&window.MONTH_NAMES!=null){window.MONTH_NAMES=new Array();
for(var A=0;A<this.monthNames.length;A++){window.MONTH_NAMES[window.MONTH_NAMES.length]=this.monthNames[A]
}for(var A=0;A<this.monthAbbreviations.length;A++){window.MONTH_NAMES[window.MONTH_NAMES.length]=this.monthAbbreviations[A]
}}}function CP_tmpReturnFunction(D,A,C){if(window.CP_targetInput!=null){var B=new Date(D,A-1,C,0,0,0);
if(window.CP_calendarObject!=null){window.CP_calendarObject.copyMonthNamesToWindow()
}window.CP_targetInput.value=formatDate(B,window.CP_dateFormat)}else{alert("Use setReturnFunction() to define which function will get the clicked results!")
}}function CP_tmpReturnMonthFunction(B,A){alert("Use setReturnMonthFunction() to define which function will get the clicked results!\nYou clicked: year="+B+" , month="+A)
}function CP_tmpReturnQuarterFunction(B,A){alert("Use setReturnQuarterFunction() to define which function will get the clicked results!\nYou clicked: year="+B+" , quarter="+A)
}function CP_tmpReturnYearFunction(A){alert("Use setReturnYearFunction() to define which function will get the clicked results!\nYou clicked: year="+A)
}function CP_setReturnFunction(A){this.returnFunction=A}function CP_setReturnMonthFunction(A){this.returnMonthFunction=A
}function CP_setReturnQuarterFunction(A){this.returnQuarterFunction=A}function CP_setReturnYearFunction(A){this.returnYearFunction=A
}function CP_setMonthNames(){for(var A=0;A<arguments.length;A++){this.monthNames[A]=arguments[A]
}this.copyMonthNamesToWindow()}function CP_setMonthAbbreviations(){for(var A=0;A<arguments.length;
A++){this.monthAbbreviations[A]=arguments[A]}this.copyMonthNamesToWindow()}function CP_setDayHeaders(){for(var A=0;
A<arguments.length;A++){this.dayHeaders[A]=arguments[A]}}function CP_setWeekStartDay(A){this.weekStartDay=A
}function CP_showYearNavigation(){this.isShowYearNavigation=(arguments.length>0)?arguments[0]:true
}function CP_setDisplayType(A){if(A!="date"&&A!="week-end"&&A!="month"&&A!="quarter"&&A!="year"){alert("Invalid display type! Must be one of: date,week-end,month,quarter,year");
return false}this.displayType=A}function CP_setYearSelectStartOffset(A){this.yearSelectStartOffset=A
}function CP_setDisabledWeekDays(){this.disabledWeekDays=new Object();for(var A=0;
A<arguments.length;A++){this.disabledWeekDays[arguments[A]]=true}}function CP_addDisabledDates(B,A){if(arguments.length==1){A=B
}if(B==null&&A==null){return }if(this.disabledDatesExpression!=""){this.disabledDatesExpression+="||"
}if(B!=null){B=parseDate(B);B=""+B.getFullYear()+LZ(B.getMonth()+1)+LZ(B.getDate())
}if(A!=null){A=parseDate(A);A=""+A.getFullYear()+LZ(A.getMonth()+1)+LZ(A.getDate())
}if(B==null){this.disabledDatesExpression+="(ds<="+A+")"}else{if(A==null){this.disabledDatesExpression+="(ds>="+B+")"
}else{this.disabledDatesExpression+="(ds>="+B+"&&ds<="+A+")"}}}function CP_setTodayText(A){this.todayText=A
}function CP_setCssPrefix(A){this.cssPrefix=A}function CP_showNavigationDropdowns(){this.isShowNavigationDropdowns=(arguments.length>0)?arguments[0]:true
}function CP_showYearNavigationInput(){this.isShowYearNavigationInput=(arguments.length>0)?arguments[0]:true
}function CP_hideCalendar(){if(arguments.length>0){window.popupWindowObjects[arguments[0]].hidePopup()
}else{this.hidePopup()}}function CP_refreshCalendar(B){var A=window.popupWindowObjects[B];
if(arguments.length>1){A.populate(A.getCalendar(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]))
}else{A.populate(A.getCalendar())}A.refresh()}function CP_showCalendar(A){if(arguments.length>1){if(arguments[1]==null||arguments[1]==""){this.currentDate=new Date()
}else{this.currentDate=new Date(parseDate(arguments[1]))}}this.populate(this.getCalendar());
this.showPopup(A)}function CP_select(C,A,E){var B=(arguments.length>3)?arguments[3]:null;
if(!window.getDateFromFormat){alert("calendar.select: To use this method you must also include 'date.js' for date formatting");
return }if(this.displayType!="date"&&this.displayType!="week-end"){alert("calendar.select: This function can only be used with displayType 'date' or 'week-end'");
return }if(C.type!="text"&&C.type!="hidden"&&C.type!="textarea"){alert("calendar.select: Input object passed is not a valid form input object");
window.CP_targetInput=null;return }if(C.disabled){return }window.CP_targetInput=C;
window.CP_calendarObject=this;this.currentDate=null;var D=0;if(B!=null){D=getDateFromFormat(B,E)
}else{if(C.value!=""){D=getDateFromFormat(C.value,E)}}if(B!=null||C.value!=""){if(D==0){this.currentDate=null
}else{this.currentDate=new Date(D)}}window.CP_dateFormat=E;this.showCalendar(A)}function getCalendarStyles(){var A="";
var B="";if(this!=null&&typeof (this.cssPrefix)!="undefined"&&this.cssPrefix!=null&&this.cssPrefix!=""){B=this.cssPrefix
}A+="<STYLE>\n";A+="."+B+"cpYearNavigation,."+B+"cpMonthNavigation { background-color:#C0C0C0; text-align:center; vertical-align:center; text-decoration:none; color:#000000; font-weight:bold; }\n";
A+="."+B+"cpDayColumnHeader, ."+B+"cpYearNavigation,."+B+"cpMonthNavigation,."+B+"cpCurrentMonthDate,."+B+"cpCurrentMonthDateDisabled,."+B+"cpOtherMonthDate,."+B+"cpOtherMonthDateDisabled,."+B+"cpCurrentDate,."+B+"cpCurrentDateDisabled,."+B+"cpTodayText,."+B+"cpTodayTextDisabled,."+B+"cpText { font-family:arial; font-size:8pt; }\n";
A+="TD."+B+"cpDayColumnHeader { text-align:right; border:solid thin #C0C0C0;border-width:0px 0px 1px 0px; }\n";
A+="."+B+"cpCurrentMonthDate, ."+B+"cpOtherMonthDate, ."+B+"cpCurrentDate  { text-align:right; text-decoration:none; }\n";
A+="."+B+"cpCurrentMonthDateDisabled, ."+B+"cpOtherMonthDateDisabled, ."+B+"cpCurrentDateDisabled { color:#D0D0D0; text-align:right; text-decoration:line-through; }\n";
A+="."+B+"cpCurrentMonthDate, .cpCurrentDate { color:#000000; }\n";A+="."+B+"cpOtherMonthDate { color:#808080; }\n";
A+="TD."+B+"cpCurrentDate { color:white; background-color: #C0C0C0; border-width:1px; border:solid thin #800000; }\n";
A+="TD."+B+"cpCurrentDateDisabled { border-width:1px; border:solid thin #FFAAAA; }\n";
A+="TD."+B+"cpTodayText, TD."+B+"cpTodayTextDisabled { border:solid thin #C0C0C0; border-width:1px 0px 0px 0px;}\n";
A+="A."+B+"cpTodayText, SPAN."+B+"cpTodayTextDisabled { height:20px; }\n";A+="A."+B+"cpTodayText { color:black; }\n";
A+="."+B+"cpTodayTextDisabled { color:#D0D0D0; }\n";A+="."+B+"cpBorder { border:solid thin #808080; }\n";
A+="</STYLE>\n";return A}function CP_getCalendar(){var now=new Date();if(this.type=="WINDOW"){var windowref="window.opener."
}else{var windowref=""}var result="";if(this.type=="WINDOW"){result+="<HTML><HEAD><TITLE>Calendar</TITLE>"+this.getStyles()+"</HEAD><BODY MARGINWIDTH=0 MARGINHEIGHT=0 TOPMARGIN=0 RIGHTMARGIN=0 LEFTMARGIN=0>\n";
result+="<CENTER><TABLE WIDTH=100% BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>\n"
}else{result+='<TABLE CLASS="'+this.cssPrefix+'cpBorder" WIDTH=144 BORDER=1 BORDERWIDTH=1 CELLSPACING=0 CELLPADDING=1>\n';
result+="<TR><TD ALIGN=CENTER>\n";result+="<CENTER>\n"}if(this.displayType=="date"||this.displayType=="week-end"){if(this.currentDate==null){this.currentDate=now
}if(arguments.length>0){var month=arguments[0]}else{var month=this.currentDate.getMonth()+1
}if(arguments.length>1&&arguments[1]>0&&arguments[1]-0==arguments[1]){var year=arguments[1]
}else{var year=this.currentDate.getFullYear()}var daysinmonth=new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
if(((year%4==0)&&(year%100!=0))||(year%400==0)){daysinmonth[2]=29}var current_month=new Date(year,month-1,1);
var display_year=year;var display_month=month;var display_date=1;var weekday=current_month.getDay();
var offset=0;offset=(weekday>=this.weekStartDay)?weekday-this.weekStartDay:7-this.weekStartDay+weekday;
if(offset>0){display_month--;if(display_month<1){display_month=12;display_year--}display_date=daysinmonth[display_month]-offset+1
}var next_month=month+1;var next_month_year=year;if(next_month>12){next_month=1;next_month_year++
}var last_month=month-1;var last_month_year=year;if(last_month<1){last_month=12;last_month_year--
}var date_class;if(this.type!="WINDOW"){result+="<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>"
}result+="<TR>\n";var refresh=windowref+"CP_refreshCalendar";var refreshLink="javascript:"+refresh;
if(this.isShowNavigationDropdowns){result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="78" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpMonthNavigation" name="cpMonth" onChange="'+refresh+"("+this.index+",this.options[this.selectedIndex].value-0,"+(year-0)+');">';
for(var monthCounter=1;monthCounter<=12;monthCounter++){var selected=(monthCounter==month)?"SELECTED":"";
result+='<option value="'+monthCounter+'" '+selected+">"+this.monthNames[monthCounter-1]+"</option>"
}result+="</select></TD>";result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';
result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="56" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpYearNavigation" name="cpYear" onChange="'+refresh+"("+this.index+","+month+',this.options[this.selectedIndex].value-0);">';
for(var yearCounter=year-this.yearSelectStartOffset;yearCounter<=year+this.yearSelectStartOffset;
yearCounter++){var selected=(yearCounter==year)?"SELECTED":"";result+='<option value="'+yearCounter+'" '+selected+">"+yearCounter+"</option>"
}result+="</select></TD>"}else{if(this.isShowYearNavigation){result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+"("+this.index+","+last_month+","+last_month_year+');">&lt;</A></TD>';
result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="58"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+"</SPAN></TD>";
result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+"("+this.index+","+next_month+","+next_month_year+');">&gt;</A></TD>';
result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';
result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+"("+this.index+","+month+","+(year-1)+');">&lt;</A></TD>';
if(this.isShowYearNavigationInput){result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><INPUT NAME="cpYear" CLASS="'+this.cssPrefix+'cpYearNavigation" SIZE="4" MAXLENGTH="4" VALUE="'+year+'" onBlur="'+refresh+"("+this.index+","+month+',this.value-0);"></TD>'
}else{result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><SPAN CLASS="'+this.cssPrefix+'cpYearNavigation">'+year+"</SPAN></TD>"
}result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+"("+this.index+","+month+","+(year+1)+');">&gt;</A></TD>'
}else{result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+"("+this.index+","+last_month+","+last_month_year+');">&lt;&lt;</A></TD>\n';
result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="100"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+" "+year+"</SPAN></TD>\n";
result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+"("+this.index+","+next_month+","+next_month_year+');">&gt;&gt;</A></TD>\n'
}}result+="</TR></TABLE>\n";result+="<TABLE WIDTH=120 BORDER=0 CELLSPACING=0 CELLPADDING=1 ALIGN=CENTER>\n";
result+="<TR>\n";for(var j=0;j<7;j++){result+='<TD CLASS="'+this.cssPrefix+'cpDayColumnHeader" WIDTH="14%"><SPAN CLASS="'+this.cssPrefix+'cpDayColumnHeader">'+this.dayHeaders[(this.weekStartDay+j)%7]+"</TD>\n"
}result+="</TR>\n";for(var row=1;row<=6;row++){result+="<TR>\n";for(var col=1;col<=7;
col++){var disabled=false;if(this.disabledDatesExpression!=""){var ds=""+display_year+LZ(display_month)+LZ(display_date);
eval("disabled=("+this.disabledDatesExpression+")")}var dateClass="";if((display_month==this.currentDate.getMonth()+1)&&(display_date==this.currentDate.getDate())&&(display_year==this.currentDate.getFullYear())){dateClass="cpCurrentDate"
}else{if(display_month==month){dateClass="cpCurrentMonthDate"}else{dateClass="cpOtherMonthDate"
}}if(disabled||this.disabledWeekDays[col-1]){result+='	<TD CLASS="'+this.cssPrefix+dateClass+'"><SPAN CLASS="'+this.cssPrefix+dateClass+'Disabled">'+display_date+"</SPAN></TD>\n"
}else{var selected_date=display_date;var selected_month=display_month;var selected_year=display_year;
if(this.displayType=="week-end"){var d=new Date(selected_year,selected_month-1,selected_date,0,0,0,0);
d.setDate(d.getDate()+(7-col));selected_year=d.getYear();if(selected_year<1000){selected_year+=1900
}selected_month=d.getMonth()+1;selected_date=d.getDate()}result+='	<TD CLASS="'+this.cssPrefix+dateClass+'"><A HREF="javascript:'+windowref+this.returnFunction+"("+selected_year+","+selected_month+","+selected_date+");"+windowref+"CP_hideCalendar('"+this.index+'\');" CLASS="'+this.cssPrefix+dateClass+'">'+display_date+"</A></TD>\n"
}display_date++;if(display_date>daysinmonth[display_month]){display_date=1;display_month++
}if(display_month>12){display_month=1;display_year++}}result+="</TR>"}var current_weekday=now.getDay()-this.weekStartDay;
if(current_weekday<0){current_weekday+=7}result+="<TR>\n";result+='	<TD COLSPAN=7 ALIGN=CENTER CLASS="'+this.cssPrefix+'cpTodayText">\n';
if(this.disabledDatesExpression!=""){var ds=""+now.getFullYear()+LZ(now.getMonth()+1)+LZ(now.getDate());
eval("disabled=("+this.disabledDatesExpression+")")}if(disabled||this.disabledWeekDays[current_weekday+1]){result+='		<SPAN CLASS="'+this.cssPrefix+'cpTodayTextDisabled">'+this.todayText+"</SPAN>\n"
}else{result+='		<A CLASS="'+this.cssPrefix+'cpTodayText" HREF="javascript:'+windowref+this.returnFunction+"('"+now.getFullYear()+"','"+(now.getMonth()+1)+"','"+now.getDate()+"');"+windowref+"CP_hideCalendar('"+this.index+"');\">"+this.todayText+"</A>\n"
}result+="		<BR>\n";result+="	</TD></TR></TABLE></CENTER></TD></TR></TABLE>\n"}if(this.displayType=="month"||this.displayType=="quarter"||this.displayType=="year"){if(arguments.length>0){var year=arguments[0]
}else{if(this.displayType=="year"){var year=now.getFullYear()-this.yearSelectStartOffset
}else{var year=now.getFullYear()}}if(this.displayType!="year"&&this.isShowYearNavigation){result+="<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";
result+="<TR>\n";result+='	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+"CP_refreshCalendar("+this.index+","+(year-1)+');">&lt;&lt;</A></TD>\n';
result+='	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="100">'+year+"</TD>\n";
result+='	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+"CP_refreshCalendar("+this.index+","+(year+1)+');">&gt;&gt;</A></TD>\n';
result+="</TR></TABLE>\n"}}if(this.displayType=="month"){result+="<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n";
for(var i=0;i<4;i++){result+="<TR>";for(var j=0;j<3;j++){var monthindex=((i*3)+j);
result+='<TD WIDTH=33% ALIGN=CENTER><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnMonthFunction+"("+year+","+(monthindex+1)+");"+windowref+"CP_hideCalendar('"+this.index+'\');" CLASS="'+date_class+'">'+this.monthAbbreviations[monthindex]+"</A></TD>"
}result+="</TR>"}result+="</TABLE></CENTER></TD></TR></TABLE>\n"}if(this.displayType=="quarter"){result+="<BR><TABLE WIDTH=120 BORDER=1 CELLSPACING=0 CELLPADDING=0 ALIGN=CENTER>\n";
for(var i=0;i<2;i++){result+="<TR>";for(var j=0;j<2;j++){var quarter=((i*2)+j+1);
result+='<TD WIDTH=50% ALIGN=CENTER><BR><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnQuarterFunction+"("+year+","+quarter+");"+windowref+"CP_hideCalendar('"+this.index+'\');" CLASS="'+date_class+'">Q'+quarter+"</A><BR><BR></TD>"
}result+="</TR>"}result+="</TABLE></CENTER></TD></TR></TABLE>\n"}if(this.displayType=="year"){var yearColumnSize=4;
result+="<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";result+="<TR>\n";
result+='	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="50%"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+"CP_refreshCalendar("+this.index+","+(year-(yearColumnSize*2))+');">&lt;&lt;</A></TD>\n';
result+='	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="50%"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+"CP_refreshCalendar("+this.index+","+(year+(yearColumnSize*2))+');">&gt;&gt;</A></TD>\n';
result+="</TR></TABLE>\n";result+="<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n";
for(var i=0;i<yearColumnSize;i++){for(var j=0;j<2;j++){var currentyear=year+(j*yearColumnSize)+i;
result+='<TD WIDTH=50% ALIGN=CENTER><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnYearFunction+"("+currentyear+");"+windowref+"CP_hideCalendar('"+this.index+'\');" CLASS="'+date_class+'">'+currentyear+"</A></TD>"
}result+="</TR>"}result+="</TABLE></CENTER></TD></TR></TABLE>\n"}if(this.type=="WINDOW"){result+="</BODY></HTML>\n"
}return result};
function checkAmount_AUD_decimal(A){A.value=A.value.replace(/[, \t]/g,"");if(!A.value.length){return true
}re=/^-?[0-9]*\.[0-9][0-9]$/;if(!re.test(A.value)){alert("Please fill in the currency field(s) using the format NN.pp,\nwhere NN is the number of dollars and pp the number of cents, e.g. 12.99");
A.focus();A.style.backgroundColor="#ff9999";return false}else{A.style.backgroundColor="#ffffff";
return true}}function checkAmount_AUD_integer(A){A.value=A.value.replace(/[, \t]/g,"");
if(!A.value.length){return true}re=/^-?[0-9]+$/;if(!re.test(A.value)){alert("Please fill in the currency field(s) using the format pp,\nwhere pp is the number of cents, e.g. 1299 for 12 dollars and 99 cents");
A.focus();A.style.backgroundColor="#ff9999";return false}else{A.style.backgroundColor="#ffffff";
return true}}function checkAmount_CAD_decimal(A){A.value=A.value.replace(/[, \t]/g,"");
if(!A.value.length){return true}re=/^-?[0-9]*\.[0-9][0-9]$/;if(!re.test(A.value)){alert("Please fill in the currency field(s) using the format NN.pp,\nwhere NN is the number of dollars and pp the number of cents, e.g. 12.99");
A.focus();A.style.backgroundColor="#ff9999";return false}else{A.style.backgroundColor="#ffffff";
return true}}function checkAmount_CAD_integer(A){A.value=A.value.replace(/[, \t]/g,"");
if(!A.value.length){return true}re=/^-?[0-9]+$/;if(!re.test(A.value)){alert("Please fill in the currency field(s) using the format pp,\nwhere pp is the number of cents, e.g. 1299 for 12 dollars and 99 cents");
A.focus();A.style.backgroundColor="#ff9999";return false}else{A.style.backgroundColor="#ffffff";
return true}}function checkAmount_EUR_decimal(A){A.value=A.value.replace(/[, \t]/g,"");
if(!A.value.length){return true}re=/^-?[0-9]*\.[0-9][0-9]$/;if(!re.test(A.value)){alert("Please fill in the currency field(s) using the format NN.pp,\nwhere NN is the number of euros and pp the number of cents, e.g. 12.99");
A.focus();A.style.backgroundColor="#ff9999";return false}else{A.style.backgroundColor="#ffffff";
return true}}function checkAmount_EUR_integer(A){A.value=A.value.replace(/[, \t]/g,"");
if(!A.value.length){return true}re=/^-?[0-9]+$/;if(!re.test(A.value)){alert("Please fill in the currency field(s) using the format pp,\nwhere pp is the number of cents, e.g. 1299 for 12 euros and 99 cents");
A.focus();A.style.backgroundColor="#ff9999";return false}else{A.style.backgroundColor="#ffffff";
return true}}function checkAmount_GBP_decimal(A){A.value=A.value.replace(/[, \t]/g,"");
if(!A.value.length){return true}re=/^-?[0-9]*\.[0-9][0-9]$/;if(!re.test(A.value)){alert("Please fill in the currency field(s) using the format NN.pp,\nwhere NN is the number of pounds and pp the number of pence, e.g. 12.99");
A.focus();A.style.backgroundColor="#ff9999";return false}else{A.style.backgroundColor="#ffffff";
return true}}function checkAmount_GBP_integer(A){A.value=A.value.replace(/[, \t]/g,"");
if(!A.value.length){return true}re=/^-?[0-9]+$/;if(!re.test(A.value)){alert("Please fill in the currency field(s) using the format pp,\nwhere pp is the number of pence, e.g. 1299 for 12 pounds and 99 pence");
A.focus();A.style.backgroundColor="#ff9999";return false}else{A.style.backgroundColor="#ffffff";
return true}}function checkAmount_JPY_decimal(A){A.value=A.value.replace(/[, \t]/g,"");
if(!A.value.length){return true}re=/^-?[0-9]*\.[0-9][0-9]$/;if(!re.test(A.value)){alert("Please fill in the currency field(s) using the format NN.pp,\nwhere NN is the number of yen and pp the number of , e.g. 12.99");
A.focus();A.style.backgroundColor="#ff9999";return false}else{A.style.backgroundColor="#ffffff";
return true}}function checkAmount_JPY_integer(A){A.value=A.value.replace(/[, \t]/g,"");
if(!A.value.length){return true}re=/^-?[0-9]+$/;if(!re.test(A.value)){alert("Please fill in the currency field(s) with the number of yen");
A.focus();A.style.backgroundColor="#ff9999";return false}else{A.style.backgroundColor="#ffffff";
return true}}function checkAmount_USD_decimal(A){A.value=A.value.replace(/[, \t]/g,"");
if(!A.value.length){return true}re=/^-?[0-9]*\.[0-9][0-9]$/;if(!re.test(A.value)){alert("Please fill in the currency field(s) using the format NN.pp,\nwhere NN is the number of dollars and pp the number of cents, e.g. 12.99");
A.focus();A.style.backgroundColor="#ff9999";return false}else{A.style.backgroundColor="#ffffff";
return true}}function checkAmount_USD_integer(A){A.value=A.value.replace(/[, \t]/g,"");
if(!A.value.length){return true}re=/^-?[0-9]+$/;if(!re.test(A.value)){alert("Please fill in the currency field(s) using the format pp,\nwhere pp is the number of cents, e.g. 1299 for 12 dollars and 99 cents");
A.focus();A.style.backgroundColor="#ff9999";return false}else{A.style.backgroundColor="#ffffff";
return true}};
