function lib_bwcheck_(){
this.ver=navigator.appVersion;
this.agent=navigator.userAgent;
this.dom=document.getElementById?1:0;
this.opera5=this.agent.indexOf("Opera 5")>-1;
this.opera=this.agent.indexOf("Opera")>-1;
this.ie5=(this.ver.indexOf("MSIE 5")>-1&&this.dom&&!this.opera5)?1:0;
this.ie6=(this.ver.indexOf("MSIE 6")>-1&&this.dom&&!this.opera5)?1:0;
this.ie7=(this.ver.indexOf("MSIE 7")>-1&&this.dom&&!this.opera5)?1:0;
this.ie8=(this.ver.indexOf("MSIE 8")>-1&&this.dom&&!this.opera5)?1:0;
this.ie4=(document.all&&!this.dom&&!this.opera5&&!this.opera)?1:0;
this.ie=this.ie4||this.ie5||this.ie6||this.ie7||this.ie8;
this.mac=this.agent.indexOf("Mac")>-1;
this.ns6=(this.dom&&parseInt(this.ver)>=5)?1:0;
this.ns4=(document.layers&&!this.dom)?1:0;
this.ns=this.ns4||this.ns6||this.opera5;
this.bw=(this.ie8||this.ie7||this.ie6||this.ie5||this.ie4||this.ns4||this.ns6||this.opera5||this.opera);
return this;
}
bw=new lib_bwcheck_();
function lib_message(_1){
alert(_1);
return false;
}
function lib_obj(_2,_3){
if(!bw.bw){
return lib_message("Old browser");
}
_3=(!_3)?"":"document."+_3+".";
this.evnt=bw.dom?document.getElementById(_2):bw.ie4?document.all[_2]:bw.ns4?eval(_3+"document.layers."+_2):0;
if(!this.evnt){
return lib_message("The layer does not exist ("+_2+")"+"- \nIf your using Netscape please check the nesting of your tags!");
}
this.css=bw.dom||bw.ie4?this.evnt.style:this.evnt;
this.ref=bw.dom||bw.ie4?document:this.css.document;
this.x=parseInt(this.css.left)||this.css.pixelLeft||this.evnt.offsetLeft||0;
this.y=parseInt(this.css.top)||this.css.pixelTop||this.evnt.offsetTop||0;
this.w=this.evnt.offsetWidth||this.css.clip.width||this.ref.width||this.css.pixelWidth||0;
this.h=this.evnt.offsetHeight||this.css.clip.height||this.ref.height||this.css.pixelHeight||0;
this.c=0;
if((bw.dom||bw.ie4)&&this.css.clip){
this.c=this.css.clip;
this.c=this.c.slice(5,this.c.length-1);
this.c=this.c.split(" ");
for(var i=0;i<4;i++){
this.c[i]=parseInt(this.c[i]);
}
}
this.ct=this.css.clip.top||this.c[0]||0;
this.cr=this.css.clip.right||this.c[1]||this.w||0;
this.cb=this.css.clip.bottom||this.c[2]||this.h||0;
this.cl=this.css.clip.left||this.c[3]||0;
this.divElem=document.getElementById(_2);
this.obj=_2+"Object";
eval(this.obj+"=this");
this.showXY=0;
this.stayY=-1;
this.stayX=-1;
this.oldStayY=this.stayY;
this.IsCheckingPosition=false;
this.dragging=false;
this.onDrag=0;
this.handle=0;
this.timeoutID=0;
this.anchorObj=null;
this.anchorLeftRel=null;
this.anchorTopRel=null;
return this;
}
lib_obj.prototype.moveIt=function(x,y){
this.x=x;
this.y=y;
this.css.left=x+"px";
this.css.top=y+"px";
};
lib_obj.prototype.moveBy=function(x,y){
var tx=this.x+=x;
var ty=this.y+=y;
this.css.left=tx+"px";
this.css.top=ty+"px";
};
lib_obj.prototype.stayAt=function(x,y){
this.stayX=x;
this.stayY=y;
};
lib_obj.prototype.isVisible=function(){
return (this.css.visibility=="visible");
};
lib_obj.prototype.checkPosition=function(){
if(!this.dragging){
if(window.innerHeight){
posY=window.pageYOffset;
}else{
if(document.documentElement&&document.documentElement.scrollTop){
posY=document.documentElement.scrollTop;
}else{
if(document.body){
posY=document.body.scrollTop;
}
}
}
if(this.anchorTopRel==null){
if(posY<this.stayY){
posY=this.stayY;
}else{
posY+=this.stayY;
}
}else{
posY=getPosTop(this.anchorObj)+this.anchorTopRel;
}
if(window.innerWidth){
posX=window.pageXOffset;
}else{
if(document.documentElement&&document.documentElement.scrollLeft){
posX=document.documentElement.scrollLeft;
}else{
if(document.body){
posX=document.body.scrollLeft;
}
}
}
if(this.anchorLeftRel==null){
if(posX<this.stayX){
posX=this.stayX;
}else{
posX+=this.stayX;
}
}else{
posX=getPosLeft(this.anchorObj)+this.anchorLeftRel;
}
if(posY==this.oldStayY){
this.moveIt(posX,posY);
if(this.css.visibility=="visible"){
v=1;
}else{
v=0;
}
document.cookie="w"+this.handle+"Pos="+this.stayX+"^"+this.stayY+"v"+v;
}
this.oldStayY=posY;
this.oldStayX=posX;
}
this.IsCheckingPosition=true;
this.timeoutID=setTimeout(this.obj+".checkPosition()",200);
};
lib_obj.prototype.checkPositionCancel=function(){
this.IsCheckingPosition=false;
clearTimeout(this.timeoutID);
};
lib_obj.prototype.showIt=function(){
this.css.visibility="visible";
};
lib_obj.prototype.hideIt=function(){
this.css.visibility="hidden";
};
lib_obj.prototype.bg=function(_d){
if(bw.opera){
this.css.background=_d;
}else{
if(bw.dom||bw.ie4){
this.css.backgroundColor=_d;
}else{
if(bw.ns4){
this.css.bgColor=_d;
}
}
}
};
lib_obj.prototype.writeIt=function(_e,_f,_10){
if(bw.ns4){
if(!_f){
_f="";
_10="";
}
this.ref.open("text/html");
this.ref.write(_f+_e+_10);
this.ref.close();
}else{
this.evnt.innerHTML=_e;
}
};
lib_obj.prototype.clipTo=function(t,r,b,l,_15){
this.ct=t;
this.cr=r;
this.cb=b;
this.cl=l;
if(bw.ns4){
this.css.clip.top=t;
this.css.clip.right=r;
this.css.clip.bottom=b;
this.css.clip.left=l;
}else{
if(t<0){
t=0;
}
if(r<0){
r=0;
}
if(b<0){
b=0;
}
if(b<0){
b=0;
}
this.css.clip="rect("+t+","+r+","+b+","+l+")";
if(_15){
this.css.pixelWidth=this.css.width=r;
this.css.pixelHeight=this.css.height=b;
}
}
};
lib_obj.prototype.clipBy=function(t,r,b,l,_1a){
this.clipTo(this.ct+t,this.cr+r,this.cb+b,this.cl+l,_1a);
};
lib_obj.prototype.clipIt=function(t,r,b,l,_1f,fn,wh){
tstep=Math.max(Math.max(Math.abs((t-this.ct)/_1f),Math.abs((r-this.cr)/_1f)),Math.max(Math.abs((b-this.cb)/_1f),Math.abs((l-this.cl)/_1f)));
if(!this.clipactive){
this.clipactive=true;
if(!wh){
wh=0;
}
if(!fn){
fn=0;
}
this.clip(t,r,b,l,(t-this.ct)/tstep,(r-this.cr)/tstep,(b-this.cb)/tstep,(l-this.cl)/tstep,tstep,0,fn,wh);
}
};
lib_obj.prototype.clip=function(t,r,b,l,ts,rs,bs,ls,_2a,_2b,fn,wh){
if(_2b<_2a){
if(wh){
eval(wh);
}
_2b++;
this.clipBy(ts,rs,bs,ls,1);
setTimeout(this.obj+".clip("+t+","+r+","+b+","+l+","+ts+","+rs+","+bs+","+ls+","+_2a+","+_2b+",'"+fn+"','"+wh+"')",50);
}else{
this.clipactive=false;
this.clipTo(t,r,b,l,1);
if(fn){
eval(fn);
}
}
};
lib_obj.prototype.slideIt=function(_2e,_2f,inc,_31,fn,wh){
if(!this.slideactive){
var _34=_2e-this.x;
var _35=_2f-this.y;
var num=Math.sqrt(Math.pow(_34,2)+Math.pow(_35,2))/inc;
var dx=_34/num;
var dy=_35/num;
this.slideactive=1;
if(!wh){
wh=0;
}
if(!fn){
fn=0;
}
this.slide(dx,dy,_2e,_2f,_31,fn,wh);
}
};
lib_obj.prototype.slide=function(dx,dy,_3b,_3c,_3d,fn,wh){
if(this.slideactive&&(Math.floor(Math.abs(dx))<Math.floor(Math.abs(_3b-this.x))||Math.floor(Math.abs(dy))<Math.floor(Math.abs(_3c-this.y)))){
this.moveBy(dx,dy);
if(wh){
eval(wh);
}
setTimeout(this.obj+".slide("+dx+","+dy+","+_3b+","+_3c+","+_3d+",'"+fn+"','"+wh+"')",_3d);
}else{
this.slideactive=0;
this.moveIt(_3b,_3c);
if(fn){
eval(fn);
}
}
};
lib_obj.prototype.circleIt=function(rad,_41,a,_43,xc,yc,_46,fn){
if((Math.abs(_41)<Math.abs(_43-a))){
a+=_41;
var x=xc+rad*Math.cos(a*Math.PI/180);
var y=yc-rad*Math.sin(a*Math.PI/180);
this.moveIt(x,y);
setTimeout(this.obj+".circleIt("+rad+","+_41+","+a+","+_43+","+xc+","+yc+","+_46+",'"+fn+"')",_46);
}else{
if(fn&&fn!="undefined"){
eval(fn);
}
}
};
function lib_doc_size(){
this.x=0;
this.x2=bw.ie&&document.body.offsetWidth-20||innerWidth||0;
this.y=0;
this.y2=bw.ie&&document.body.offsetHeight-5||innerHeight||0;
if(!this.x2||!this.y2){
return message("Document has no width or height");
}
this.x50=this.x2/2;
this.y50=this.y2/2;
return this;
}
dd_is_active=0;
dd_obj=0;
dd_mobj=0;
function lib_dd(){
dd_is_active=1;
if(bw.ns4){
document.captureEvents(Event.MOUSEMOVE|Event.MOUSEDOWN|Event.MOUSEUP);
}
document.onmousemove=lib_dd_move;
document.onmousedown=lib_dd_down;
document.onmouseup=lib_dd_up;
}
lib_obj.prototype.dragdrop=function(obj){
if(!dd_is_active){
lib_dd();
}
this.evnt.onmouseover=new Function("lib_dd_over("+this.obj+")");
this.evnt.onmouseout=new Function("dd_mobj=0");
if(obj){
this.ddobj=obj;
}
};
lib_obj.prototype.nodragdrop=function(){
this.evnt.onmouseover="";
this.evnt.onmouseout="";
dd_obj=0;
dd_mobj=0;
};
function lib_dd_over(obj){
dd_mobj=obj;
}
function lib_dd_up(e){
dd_obj.dragging=false;
dd_obj=0;
if(bw.ns4){
routeEvent(e);
}
}
function lib_dd_down(e){
if(dd_mobj){
x=(bw.ns4||bw.ns6)?e.pageX:event.x||event.clientX;
y=(bw.ns4||bw.ns6)?e.pageY:event.y||event.clientY;
dd_obj=dd_mobj;
dd_obj.dragging=true;
dd_obj.clX=x-dd_obj.x;
dd_obj.clY=y-dd_obj.y;
}
if(bw.ns4){
routeEvent(e);
}
}
function lib_dd_move(e,y,_50){
x=(bw.ns4||bw.ns6)?e.pageX:event.x||event.clientX;
y=(bw.ns4||bw.ns6)?e.pageY:event.y||event.clientY;
if(dd_obj){
nx=x-dd_obj.clX;
ny=y-dd_obj.clY;
if(dd_obj.IsCheckingPosition){
dd_obj.stayX+=nx-dd_obj.x;
dd_obj.stayY+=ny-dd_obj.y;
if(dd_obj.stayY<1){
dd_obj.stayY=1;
}
}
if(dd_obj.ddobj){
dd_obj.ddobj.moveIt(nx,ny);
}else{
dd_obj.moveIt(nx,ny);
}
if(dd_obj.showXY==1){
dd_obj.writeIt("x:"+nx+" y:"+ny);
}
if(dd_obj.onDrag){
dd_obj.onDrag();
}
}
if(!bw.ns4){
return false;
}
}
function getEventXY(e){
var _52=0,posY=0;
if(!e){
e=window.event;
}
if(!e){
return [0,0];
}
if(typeof (e.pageX)=="number"){
_52=e.pageX;
posY=e.pageY;
}else{
if(typeof (e.clientX)=="number"){
_52=e.clientX;
posY=e.clientY;
if(document.body&&!(window.opera||window.debug||navigator.vendor=="KDE")){
if(typeof (document.body.scrollTop)=="number"){
_52+=document.body.scrollLeft;
posY+=document.body.scrollTop;
}
}
if(document.documentElement&&!(window.opera||window.debug||navigator.vendor=="KDE")){
if(typeof (document.documentElement.scrollTop)=="number"){
_52+=document.documentElement.scrollLeft;
posY+=document.documentElement.scrollTop;
}
}
}
}
return [_52,posY];
}
function getObjPosition(obj){
var _54=obj;
var _55=_54.offsetWidth;
var _56=_54.offsetHeight;
var _57=0;
var _58=0;
while(_54){
_57+=_54.offsetLeft;
_58+=_54.offsetTop;
_54=_54.offsetParent;
}
if(navigator.userAgent.indexOf("Mac")!=-1&&typeof document.body.leftMargin!="undefined"){
_57+=document.body.leftMargin;
_58+=document.body.topMargin;
}
_55+=_57;
_56+=_58;
var _59=_55-_57;
var _5a=_56-_58;
return {left:_57,right:_55,top:_58,bottom:_56,width:_59,height:_5a};
}
function getElementPosition(_5b){
var obj=document.getElementById(_5b);
return getObjPosition(obj);
}
function getPosLeft(obj){
var _5e=getObjPosition(obj);
return _5e.left;
}
function getPosTop(obj){
var _60=getObjPosition(obj);
return _60.top;
}
function eventTarget(e){
e=(e)?e:((event)?event:null);
var _62=null;
if(e){
_62=(e.target)?e.target:((e.srcElement)?e.srcElement:null);
}
return _62;
}

var PopInitComplete=false;
var PopUpLibExists=true;
function objPopupBase(w,_2,_3,_4,_5){
function show(x,y,hd,_9){
if((hd=="")&&(_9=="")){
}else{
if(this.defaultBorder){
this.win.css.border="solid "+this.h_bgColor+" 1px";
}
var _a="<table width="+this.w+" cellspacing=0 cellpadding=0 border=0>";
if(hd!=""){
_a+="<tr><td bgcolor="+this.h_bgColor+">";
_a+="<div style=\""+this.headStyle+"\">";
_a+=hd;
_a+="</div>";
_a+="</td></tr>";
}
if(_9!=""){
_a+="<tr><td bgcolor="+this.t_bgColor+">";
_a+="<div style=\""+this.bodyStyle+"\">";
_a+=_9;
_a+="</div>";
_a+="</td></tr>";
}
_a+="</table>";
this.win.writeIt(_a);
var _b=(x+this.w)-document.body.offsetWidth;
x=(_b>0)?x-=_b:x;
if(this.relativeToObj){
y-=this.relativeToObj.scrollTop;
}
this.win.moveIt(x,y);
this.win.showIt();
this.h=this.win.divElem.offsetHeight;
}
}
function hide(){
this.win.hideIt();
}
function setRelativeToObj(_c){
this.relativeToObj=_c;
}
function setHeadStyle(_d){
this.headStyle=_d;
}
function setBodyStyle(_e){
this.bodyStyle=_e;
}
this.win=new lib_obj("pu");
this.show=show;
this.hide=hide;
this.w=w;
this.h=0;
this.t_fontSize="1";
this.win.css.fontFamily="Verdana,Arial,Times";
this.h_bgColor=_2;
this.t_bgColor=_3;
this.h_Color=_4;
this.t_Color=_5;
this.headStyle="color:"+this.h_Color+"; background-color:"+this.h_bgColor+"; font-size:8pt; padding: 2px;";
this.bodyStyle="color:"+this.t_Color+"; background-color:"+this.t_bgColor+"; font-size:8pt; padding: 2px;";
this.defaultBorder=false;
this.relativeToObj=null;
this.setRelativeToObj=setRelativeToObj;
this.setBodyStyle=setBodyStyle;
this.setHeadStyle=setHeadStyle;
}
function objPopup(w,_10,_11,_12,_13){
function show(e,hd,txt){
var xy=getEventXY(e);
var x=xy[0];
var y=xy[1];
x+=15;
y+=5;
this.popupBase.show(x,y,hd,txt);
}
function showRel(e,_1b,_1c,_1d,hd,txt){
var _20=eventTarget(e);
if(_20){
var _21=getObjPosition(_20);
var oL=0;
var oT=0;
switch(_1b){
case 0:
oT=_1c;
oL=_1d;
break;
case 1:
oT=_1c;
oL=_21.width+_1d;
break;
case 2:
oT=_21.height+_1c;
oL=_21.width+_1d;
break;
case 3:
oT=_21.height+_1c;
oL=_1d;
break;
}
var x=_21.left+oL;
var y=_21.top+oT;
this.popupBase.show(x,y,hd,txt);
}
}
function showAt(x,y,hd,txt){
this.popupBase.show(x,y,hd,txt);
}
function hide(e){
this.popupBase.hide();
}
function setHeadStyle(sty){
this.popupBase.setHeadStyle(sty);
}
function setBodyStyle(sty){
this.popupBase.setBodyStyle(sty);
}
function setDefaultBorder(opt){
this.popupBase.defaultBorder=opt;
}
function setHideMyselfFunc(_2e){
this.popupBase.win.divElem.onmouseout=_2e;
this.isHideMyself=true;
}
function hideOnMouseOut(e){
if(!e){
e=window.event;
}
var xy=getEventXY(e);
var x=xy[0];
var y=xy[1];
var o=this.popupBase;
if(x>=o.win.x&&x<=o.win.x+o.w&&y>=o.win.y-3&&y<=o.win.y+o.h-1){
}else{
this.hide();
}
}
this.popupBase=new objPopupBase(w,_10,_11,_12,_13);
this.show=show;
this.hide=hide;
this.showAt=showAt;
this.showRel=showRel;
this.setBodyStyle=setBodyStyle;
this.setHeadStyle=setHeadStyle;
this.setDefaultBorder=setDefaultBorder;
this.setHideMyselfFunc=setHideMyselfFunc;
this.isHideMyself=false;
this.hideOnMouseOut=hideOnMouseOut;
}
function PopInit(n,w,hbg,tbg,hC,tC){
if(!document.getElementById("pu")){
var _3a=document.createElement("div");
_3a.setAttribute("id","pu");
var txt="z-index:1001; visibility:hidden; position:absolute; left:1px; top:1px;";
if(bw.ie){
_3a.style.setAttribute("cssText",txt);
}else{
_3a.setAttribute("style",txt);
}
document.body.appendChild(_3a);
}
eval("objPop"+n+" = new objPopup(w,hbg,tbg,hC,tC)");
}
function popS(e,n,hd,txt){
if(PopInitComplete){
eval("objPop"+n+".show(e,hd,txt)");
}
}
function popSAt(x,y,n,hd,txt){
if(PopInitComplete){
eval("objPop"+n+".showAt(x,y,hd,txt)");
}
}
function popSRel(e,s,oT,oL,n,hd,txt){
if(PopInitComplete){
eval("objPop"+n+".showRel(e,s,oT,oL,hd,txt)");
}
}
function popH(n,e){
if(PopInitComplete){
eval("objPop"+n+".hide(e)");
}
}
function popRelativeToObj(n,obj){
eval("objPop"+n+".popupBase.setRelativeToObj(obj)");
}

var validNumLibIsPresent=true;
function errEmpty(){
return "Please enter something here";
}
function errNumber(){
return "Please enter a number here";
}
function isNull(_1){
if(_1==null||_1==""){
return true;
}
return false;
}
function isEmpty(_2){
for(var i=0;i<_2.length;i++){
var _4=_2.charAt(i);
if(_4!=" "){
return false;
}
}
return true;
}
function isNotEmpty(_5){
if(!isEmpty(_5)){
return true;
}
return false;
}
function isZero(_6){
if(isEmpty(_6)){
return false;
}
inputStr=_6.toString();
if(inputStr==","){
return false;
}
for(var i=0;i<inputStr.length;i++){
var _8=inputStr.charAt(i);
if((_8!="0")&&(_8!=".")){
return false;
}
}
return true;
}
function leftTrim(_9){
_9=_9.toString();
while(_9.substring(0,1)==" "){
_9=_9.substring(1,_9.length);
}
return _9;
}
function rightTrim(_a){
_a=_a.toString();
while(_a.substring(_a.length-1,_a.length)==" "){
_a=_a.substring(0,_a.length-1);
}
return _a;
}
function allTrim(_b){
return rightTrim(leftTrim(_b));
}
function isPosInteger(_c){
inputStr=_c.toString();
for(var i=0;i<inputStr.length;i++){
var _e=inputStr.charAt(i);
if(_e<"0"||_e>"9"){
return false;
}
}
return true;
}
function isPosIntegerReq(_f){
if(isEmpty(_f)){
return false;
}else{
if(isPosInteger(_f)){
return true;
}
}
return false;
}
function isPosIntegerGTZeroReq(_10){
if(isZero(_10)){
return false;
}else{
if(isPosIntegerReq(_10)){
return true;
}
}
return false;
}
function isPosIntegerGTZero(_11){
if(isEmpty(_11)){
return true;
}
if(isZero(_11)){
return false;
}else{
if(isPosInteger(_11)){
return true;
}
}
return false;
}
function isInteger(_12){
inputStr=_12.toString();
for(var i=0;i<inputStr.length;i++){
var _14=inputStr.charAt(i);
if(i==0&&_14=="-"){
continue;
}
if(_14<"0"||_14>"9"){
return false;
}
}
return true;
}
function isPosNumber(_15){
oneDecimal=false;
inputStr=_15.toString();
for(var i=0;i<inputStr.length;i++){
var _17=inputStr.charAt(i);
if(_17=="-"){
return false;
}
if(_17=="."&&!oneDecimal){
oneDecimal=true;
continue;
}
if(_17<"0"||_17>"9"){
return false;
}
}
return true;
}
function isPosNumberReq(_18){
if(isEmpty(_18)){
return false;
}else{
if(isPosNumber(_18)){
return true;
}
}
return false;
}
function isPosNumberGTZero(_19){
if(isEmpty(_19)){
return true;
}
if(isZero(_19)){
return false;
}else{
if(isPosNumber(_19)){
return true;
}
}
return false;
}
function isPosNumberGTZeroReq(_1a){
if(isEmpty(_1a)){
return false;
}
if(isZero(_1a)){
return false;
}
if(isPosNumberGTZero(_1a)){
return true;
}
return false;
}
function isNumber(_1b){
oneDecimal=false;
inputStr=_1b.toString();
for(var i=0;i<inputStr.length;i++){
var _1d=inputStr.charAt(i);
if(i==0&&_1d=="-"){
continue;
}
if(_1d=="."&&!oneDecimal){
oneDecimal=true;
continue;
}
if(_1d<"0"||_1d>"9"){
return false;
}
}
return true;
}
function RoundTo(ex,_1f){
var str=""+Math.round(eval(ex)*Math.pow(10,_1f));
while(str.length<=_1f){
str="0"+str;
}
var _21=str.length-_1f;
var res=str.substring(0,_21);
if(_1f!=0){
res+="."+str.substring(_21,str.length);
}
return res;
}
function DollarFormat(num){
return "$"+RoundTo(num,2);
}
function DecimalPart(num){
var res=-1;
var dp=num.indexOf(".");
if(dp==-1){
res=0;
}else{
res=num.slice(dp+1);
}
return res;
}
function inRange(num,_28,_29){
if(num>=_28&&num<=_29){
return true;
}
return false;
}
function formatPhone(_2a,Len){
var _2c="";
var OK=true;
for(var i=0;i<_2a.length;i++){
var _2f=_2a.charAt(i);
if(Len==2){
if((_2f>="0"&&_2f<="9")||(_2f==" ")||(_2f=="+")){
_2c+=_2f;
}else{
OK=false;
break;
}
}else{
if(_2f==" "){
_2f="";
}
if((_2f>="0"&&_2f<="9")||(_2f=="")){
_2c+=_2f;
}else{
OK=false;
break;
}
}
}
if(OK){
if(_2c.length<Len){
OK=false;
}else{
if(Len==10){
_2c=_2c.substring(0,2)+" "+_2c.substring(2,6)+" "+_2c.substring(6);
}else{
_2c=_2c.substring(0,4)+" "+_2c.substring(4);
}
}
}
if(OK){
return _2c;
}else{
return false;
}
}
function isValidPhone(frm,fld,L){
if(isEmpty(fld.value)){
return true;
}
var _33=formatPhone(fld.value,L);
if(_33==false){
return false;
}else{
var obj=eval("frm."+fld.name);
obj.value=_33;
return true;
}
}
function isValidPhoneReq(_35,fld,L){
if(isEmpty(fld.value)){
return false;
}
var _38=isValidPhone(_35,fld,L);
return _38;
}
function isHTML(_39){
return ((_39.indexOf("<")!=-1)||(_39.indexOf(">")!=-1));
}
function isNotHTML(_3a){
return !isHTML(_3a);
}
function StrReplace(str,f,t){
var _3e=eval("/"+f+"/gi");
str=str.replace(_3e,t);
return str;
}
function FixDoubleQuotes(fld){
fld.value=StrReplace(fld.value,"\"","''");
}
function setCaptitalAt(Str,pos){
return Str.substring(0,pos)+Str.charAt(pos).toUpperCase()+Str.substring(pos+1);
}
function capitalise(Str,_43){
var tmp,p;
if(isNotEmpty(Str)){
Str=Str.toLowerCase();
switch(_43){
case 0:
Str=Str.toUpperCase();
break;
case 1:
Str=setCaptitalAt(Str,0);
break;
case 2:
Str=setCaptitalAt(Str,0);
p=Str.indexOf(" ");
while(p!=-1){
Str=setCaptitalAt(Str,p+1);
p=Str.indexOf(" ",p+2);
}
p=Str.indexOf("\"");
while(p!=-1){
Str=setCaptitalAt(Str,p+1);
p=Str.indexOf("\"",p+2);
}
p=Str.indexOf("'");
while(p!=-1){
Str=setCaptitalAt(Str,p+1);
p=Str.indexOf("'",p+2);
}
break;
}
}
return Str;
}
function capitaliseIfNew(fld,_46){
if(fld.defaultValue==""&&!fld.alreadyEdited){
fld.value=capitalise(fld.value,_46);
fld.alreadyEdited=true;
}
}

function isValidEmail(_1){
if(isEmpty(_1)){
return true;
}
var at="@";
var _3=".";
var _4=_1.indexOf(at);
var _5=_1.length;
var _6=_1.indexOf(_3);
var _7=_1.charAt(_5-1);
if(_1.indexOf(at)==-1){
return false;
}
if(_1.indexOf(at)==-1||_1.indexOf(at)==0||_1.indexOf(at)==_5){
return false;
}
if(_1.indexOf(_3)==-1||_1.indexOf(_3)==0||_1.indexOf(_3)==_5){
return false;
}
if(_1.indexOf(at,(_4+1))!=-1){
return false;
}
if(_1.substring(_4-1,_4)==_3||_1.substring(_4+1,_4+2)==_3){
return false;
}
if(_1.indexOf(_3,(_4+2))==-1){
return false;
}
if(_1.indexOf(" ")!=-1){
return false;
}
if((_7>="A"&&_7<="Z")||(_7>="a"&&_7<="z")){
}else{
return false;
}
return true;
}
function isNotValidEmail(_8){
if(!isValidEmail(_8)){
return true;
}
return false;
}
function isValidEmailReq(_9){
if(isEmpty(_9)){
return false;
}else{
if(isValidEmail(_9)){
return true;
}
}
return false;
}

if((validNumLibIsPresent)=="undefined"){
alert("validNumLib.js missing");
}
var vdOneSecond=1000;
var vdOneMinute=60*vdOneSecond;
var vdOneHour=vdOneMinute*60;
var vdOneDay=vdOneHour*24;
var vdOneWeek=vdOneDay*7;
var vdOneYear=vdOneWeek*52.14;
function replaceChar(_1,_2,_3){
p=_1.indexOf(_2);
while(p!=-1){
_1=_1.substring(0,p)+_3+_1.substring(p+1,_1.length);
p=_1.indexOf(_2);
}
return _1;
}
function formatTheDate(_4,_5){
var _6="";
function isNum(_7){
var n=null;
if(_7==null||_7==""){
}else{
if(isPosInteger(_7)){
n=parseInt(_7,10);
}else{
n=NaN;
}
}
return n;
}
if(_4==null||_4==""){
return _6;
}
_4=replaceChar(_4,"-","/");
var _9=_4.indexOf("/");
var _a=_4.lastIndexOf("/");
if(_9==_a){
_a=-1;
}
var _b=new Date();
var dd=_b.getDate();
var mm=_b.getMonth()+1;
var yy=_b.getFullYear();
if(_9==-1){
dd=isNum(_4.substring(0,_4.length));
}else{
var d=isNum(_4.substring(0,_9));
if(isNaN(d)||(d==null)){
dd=NaN;
}else{
dd=d;
}
if(_a==-1){
var m=isNum(_4.substring(_9+1,_4.length));
if(m!=null){
mm=m;
}
}else{
var m=isNum(_4.substring(_9+1,_a));
if(isNaN(m)||(m==null)){
mm=NaN;
}else{
mm=m;
}

var y=isNum(_4.substring(_a+1,_4.length));
if(y!=null){
yy=y;
}
}
}
if(isNaN(mm)||isNaN(dd)||isNaN(yy)){
return false;
}
if((yy>=100)&&(yy<1930)){
return false;
}
if(yy<100){
if(yy>=30){
yy+=1900;
}else{
yy+=2000;
}
}
if(mm<1||mm>12){
return false;
}
if(mm==2){
if((yy%4>0)&&(dd>28)){
return false;
}else{
if(dd>29){
return false;
}
}
}else{
if((mm==4||mm==6||mm==9||mm==11)&&(dd>30)){
return false;
}else{
if(dd>31){
return false;
}
}
}
if(_5==2){
var x=yy.toString();
yy=x.substring(2,4);
}
_6=dd+"/"+mm+"/"+yy;
return _6;
}
function isValidDateReq(_12){
if(_12==null||_12==""){
return false;
}
if(!isValidDate(_12)){
return false;
}
return true;
}
function isValidDate(_13){
if(isEmpty(_13)){
return true;
}
if(formatTheDate(_13,4)==false){
return false;
}else{
return true;
}
}
function formatDate(obj,_15){
if(!isEmpty(obj.value)){
var dt=formatTheDate(obj.value,_15);
if(dt==false){
writeError(obj,"Invalid date");
}else{
obj.value=dt;
}
}
}
function SQLDate(_17){
var _18=_17.indexOf("/");
var _19=_17.lastIndexOf("/");
var d=_17.substring(0,_18);
var m=_17.substring(_18+1,_19);
var y=_17.substring(_19+1,_17.length);
return m+"/"+d+"/"+y;
}
function dateObjFromDate(_1d){
_1d=allTrim(_1d);
var _1e=_1d.indexOf("/");
var _1f=_1d.lastIndexOf("/");
var _20=_1d.indexOf(" ");
var _21=_1d.indexOf(":");
var _22=_1d.lastIndexOf(":");
if(_21==_22){
_22=-1;
}
var dd=parseInt(_1d.substring(0,_1e),10);
var mm=parseInt(_1d.substring(_1e+1,_1f)-1,10);
if(_20!=-1){
var yy=parseInt(_1d.substring(_1f+1,_20),10);
}else{
var yy=parseInt(_1d.substring(_1f+1),10);
}
var hr=0;
var mn=0;
var se=0;
if(_21!=-1){
hr=parseInt(_1d.substring(_20+1,_21),10);
}
if(_22!=-1){
mn=parseInt(_1d.substring(_21+1,_22),10);
se=parseInt(_1d.substring(_22+1),10);
}else{
mn=parseInt(_1d.substring(_21+1),10);
}
if(yy<100){
if(yy>=30){
yy+=1900;
}else{
yy+=2000;
}
}
var _29=new Date(yy,mm,dd,hr,mn,se);
return _29;
}
function dateFromDateObj(_2a,_2b){
var dd=_2a.getDate();
var mm=parseInt(_2a.getMonth(),10)+1;
var yy=_2a.getFullYear();
var hr=_2a.getHours();
var mn=_2a.getMinutes();
var se=_2a.getSeconds();
var _32=_2b.indexOf("yyyy");
if(_32==-1){
yy=yy.toString();
yy=yy.substr(2);
_2b=StrReplace(_2b,"yy",yy);
}else{
_2b=StrReplace(_2b,"yyyy",yy);
}
_2b=StrReplace(_2b,"dd",dd);
_2b=StrReplace(_2b,"mm",mm);
_2b=StrReplace(_2b,"hr",hr);
if(mn<10){
mn="0"+mn;
}
_2b=StrReplace(_2b,"mn",mn);
if(se<10){
se="0"+se;
}
_2b=StrReplace(_2b,"se",se);
return _2b;
}
function DateDiff(_33,_34){
var _35=dateObjFromDate(_33);
var _36=dateObjFromDate(_34);
var _37=(_36.getTime()-_35.getTime())/vdOneDay;
_37=Math.round(_37);
return _37;
}
function DateCompare(_38,_39){
var _3a=DateDiff(_38,_39);
var res=(_3a==0)?0:(_3a>0)?-1:1;
return res;
}
function DateAdd(_3c,_3d){
var _3e=dateObjFromDate(_3d);
var tmp=_3e.getTime()+(vdOneDay*_3c);
var _40=new Date(tmp);
rDate=dateFromDateObj(_40,"dd/mm/yy");
return rDate;
}
function DateTimeObjAdd(_41,_42,_43){
switch(_41){
case "s":
unit=vdOneSecond;
break;
case "n":
unit=vdOneMinute;
break;
case "h":
unit=vdOneHour;
break;
case "d":
unit=vdOneDay;
break;
case "w":
unit=vdOneWeek;
break;
default:
alert("Date part '"+_41+"' not valid");
break;
}
var _44=dateObjFromDate(_43);
var tmp=_44.getTime()+(unit*_42);
var _46=new Date(tmp);
return _46;
}
function isMilitaryTime(_47){
if(isEmpty(_47)||isZero(_47)){
return true;
}
oneColon=false;
for(var i=0;i<_47.length;i++){
var _49=_47.charAt(i);
if(_49==":"&&!oneColon){
oneColon=true;
continue;
}
if(_49<"0"||_49>"9"){
return false;
}
}
if(!oneColon){
return false;
}
var c=_47.indexOf(":");
var h=_47.substring(0,c);
var m=_47.slice(c+1);
if(!inRange(h,0,23)){
return false;
}
if(!inRange(m,0,59)){
return false;
}
return true;
}
function isMilitaryTimeReq(_4d){
if(isNull(_4d)||isZero(_4d)){
return false;
}
if(!isMilitaryTime(_4d)){
return false;
}
return true;
}
function validateTime(obj){
if(!isEmpty(obj.value)){
var dt=isMilitaryTime(obj.value);
if(dt==false){
writeError(obj,errTimeMsg);
}
}
}
var frmt_ToMins=0;
var frmt_ToSecs=1;
var errTimeMsg="Please enter the time in 24 hour format eg 14:30 for 2:30 pm";
function formatTheTime(_50,_51){
var _52="";
function isNum(str){
var n=null;
if(str==null||str==""){
}else{
if(isPosInteger(str)){
n=parseInt(str,10);
}else{
n=NaN;
}
}
return n;
}
if(isEmpty(_50)||isZero(_50)){
return _52;
}
var _55=_50.indexOf(":");
var _56=_50.lastIndexOf(":");
if(_55==_56){
_56=-1;
}
var now=new Date();
var hh=now.getHours();
var mm=0;
var ss=0;
if(_55==-1){
hh=isNum(_50.substring(0,_50.length));
}else{
var h=isNum(_50.substring(0,_55));
if(isNaN(h)||(h==null)){
hh=NaN;
}else{
hh=h;
}
if(_56==-1){
var m=isNum(_50.substring(_55+1,_50.length));
if(m!=null){
mm=m;
}
}else{
m=isNum(_50.substring(_55+1,_56));
if(isNaN(m)||(m==null)){
mm=NaN;
}else{
mm=m;
}
s=isNum(_50.substring(_56+1,_50.length));
if(s!=null){
ss=s;
}
}
}
if(isNaN(hh)||isNaN(mm)||isNaN(ss)){
return false;
}
if(!inRange(hh,0,23)){
return false;
}
if(!inRange(mm,0,59)){
return false;
}
if(!inRange(ss,0,59)){
return false;
}
hh_=hh.toString();
mm_=mm.toString();
ss_=ss.toString();
if(hh_.length==1){
hh_="0"+hh_;
}
if(mm_.length==1){
mm_="0"+mm_;
}
if(ss_.length==1){
ss_="0"+ss_;
}
_52=hh_+":"+mm_;
if(_51==frmt_ToSecs){
_52+=":"+ss_;
}
return _52;
}
function isValidTimeReq(_5d){
if(_5d==null||_5d==""){
return false;
}
if(!isValidTime(_5d)){
return false;
}
return true;
}
function isValidTime(_5e){
if(isEmpty(_5e)){
return true;
}
if(formatTheTime(_5e,frmt_ToSecs)==false){
return false;
}else{
return true;
}
}
function formatTime(obj,_60){
if(!isEmpty(obj.value)){
var tm=formatTheTime(obj.value,_60);
if(tm==false){
writeError(obj,errTimeMsg);
}else{
obj.value=tm;
}
}
}

var W3CDOM=(document.getElementsByTagName&&document.createElement);
var firstError=null;
var validForm=true;
var pv_usePopUps=false;
function pv_showError(ev){
popSRel(ev,3,1,0,99,"Problem",this.errorMsg);
}
function pv_showErrorAt(_2){
var y=getPosTop(_2)+_2.offsetHeight+1;
var x=getPosLeft(_2);
popSAt(x,y,99,"Problem",_2.errorMsg);
}
function pv_hideError(){
popH(99);
}
function writeError(_5,_6){
if(_5.type==undefined){
alert("Error in writeError - 2 params (obj AND message) required");
}
if(_5.hasError){
validForm=false;
if(firstError==null){
firstError=_5;
}
return;
}
if(W3CDOM){
_5.className+=" error";
_5.onkeydown=removeError;
_5.onclick=removeError;
if(pv_usePopUps){
_5.onmouseover=pv_showError;
_5.onmouseout=pv_hideError;
_5.hasError=true;
_5.errorMsg=_6;
if(firstError==null){
pv_showErrorAt(_5);
}
}else{
var sp=document.createElement("span");
sp.className="error";
sp.appendChild(document.createTextNode(_6));
_5.parentNode.appendChild(sp);
_5.hasError=sp;
}
}else{
errorstring+=_5.name+": "+_6+"\n";
_5.hasError=true;
}
if(validForm){
firstError=_5;
}
validForm=false;
}
function doRemoveError(_8){
if(_8&&_8.hasError){
_8.className=_8.className.substring(0,_8.className.lastIndexOf(" "));
if(pv_usePopUps){
_8.onmouseover=null;
_8.onmouseout=null;
_8.errorMsg=null;
pv_hideError();
}else{
_8.parentNode.removeChild(_8.hasError);
}
_8.hasError=null;
_8.onkeydown=null;
}
}
function removeError(){
doRemoveError(this);
}
function clearAllErrors(){
var _9=document.getElementsByTagName("input");
for(var i=0;i<_9.length;i++){
doRemoveError(_9[i]);
}
}
function popValidInit(){
if(!window.PopUpLibExists){
alert("PopUpLib.js is missing");
}else{
PopInit(99,250,"#cc0000","#ffcccc","white","black");
PopInitComplete=true;
pv_usePopUps=true;
}
}

var aus_states=new Array("NSW","QLD","VIC","SA","TAS","NT","WA","ACT");
function formatState(st){
var _2=aus_states;
st=capitalise(allTrim(st),0);
if(st.length==1){
for(var i=0;i<_2.length;i++){
if(_2[i].charAt(0)==st){
st=_2[i];
break;
}
}
}
return st;
}
function getStateFromPostcode(pc,_5){
var _6="";
var _7=aus_states;
if(isEmpty(_5)||allTrim(_5.toLowerCase())=="australia"){
var _8="2435706";
var p=_8.indexOf(pc.charAt(0));
if(p!=-1){
var _6=_7[p];
}
if(pc.substring(0,2)=="26"){
_6="ACT";
}
}
return _6;
}
function isValidState(_a,_b){
if(_a==61){
var _c=aus_states;
_b=allTrim(_b.toUpperCase());
found=false;
for(var i=0;i<_c.length;i++){
if(_c[i]==_b){
found=true;
break;
}
}
return found;
}
return true;
}

function StrList(_1,_2){
function StrList_GetNextItem(){
this.p2=this.list.indexOf(this.delim,this.p1);
if(this.p2==-1){
this.item=null;
}else{
this.item=this.list.substring(this.p1,this.p2);
this.p1=this.p2+1;
}
return this.item;
}
function StrList_ListToArray(){
var _3=new Array();
var i=0;
var _5=null;
do{
_5=this.GetNextItem();
if(_5!=null){
_3[i]=_5;
i++;
}
}while(_5!=null);
return _3;
}
this.list=_1.toString();
this.delim=_2;
if(this.list.charAt(this.list.length-1)!=this.delim){
this.list+=this.delim;
}
this.p1=0;
this.p2=0;
this.item="";
this.GetNextItem=StrList_GetNextItem;
this.ListToArray=StrList_ListToArray;
return this;
}

var doCheckDataHasChanged=false;
var DataHasChanged=false;
var formToCheck=document.forms[0];
function setDefaultValues(_1){
for(var i=0;i<_1.elements.length;i++){
var _3=_1.elements[i];
if((_3.type=="text")||(_3.type=="file")||(_3.type=="textarea")){
_3.defaultValue=_3.value;
}
if((_3.type=="checkbox")||(_3.type=="radio")){
_3.defaultChecked=_3.checked;
}
}
}
function initCheckDataBeforeExit(_4,_5){
if(_4==true){
window.onbeforeunload=confirmExit;
formToCheck=_5;
doCheckDataHasChanged=true;
}
}
function checkIfDataHasChanged(_6,_7){
var _8=false;
for(var i=0;i<_6.elements.length;i++){
var _a=_6.elements[i];
if((_a.type=="text")||(_a.type=="file")||(_a.type=="textarea")){
if(_a.value!=_a.defaultValue){
_8=true;
break;
}
}
if((_a.type=="checkbox")||(_a.type=="radio")){
if(_a.checked!=_a.defaultChecked){
_8=true;
break;
}
}
}
return _8;
}
function confirmExit(){
if(doCheckDataHasChanged==true){
DataHasChanged=checkIfDataHasChanged(formToCheck,false);
if(doCheckDataHasChanged==true){
if(DataHasChanged){
return "You have changed the data for this record. \n\nIf you click OK you WILL LOSE YOUR CHANGES. \n\nTo save your changes click Cancel in this dialog box then click the Save button at the bottom of the page. ";
}
}
}
}

function radioSelectedIndex(_1){
var _2=-1;
for(var i=0;i<_1.length;i++){
if(_1[i].checked){
_2=i;
break;
}
}
return _2;
}
function radioSelectedValue(_4){
var _5=radioSelectedIndex(_4);
var _6=-1;
if(_5!=-1){
_6=_4[_5].value;
}
return _6;
}
function radioSelect(_7,_8){
for(var i=0;i<_7.length;i++){
if(_7[i].value==_8){
_7[i].checked=true;
break;
}
}
}
function radioDeselectAll(_a){
for(var i=0;i<_a.length;i++){
_a[i].checked=false;
}
}
function AnyTicked(_c,_d){
var _e=false;
var _f=false;
for(var i=0;i<_c.elements.length;i++){
if(_c.elements[i].name.substring(0,_d.length)==_d){
_f=true;
if(_c.elements[i].checked){
_e=true;
}
}
}
if(_f==false){
_e=null;
}
return _e;
}
function AllTicked(_11,fld){
var _13=true;
var _14=false;
for(var i=0;i<_11.elements.length;i++){
if(_11.elements[i].name.substring(0,fld.length)==fld){
_14=true;
if(!_11.elements[i].checked){
_13=false;
}
}
}
if(_14==false){
_13=null;
}
return _13;
}
function SetTick(_16,fld,opt){
for(var i=0;i<_16.elements.length;i++){
if(_16.elements[i].name.substring(0,fld.length)==fld){
_16.elements[i].checked=opt;
}
}
}function getCookieVal(_1){
var _2=document.cookie.indexOf(";",_1);
if(_2==-1){
_2=document.cookie.length;
}
return unescape(document.cookie.substring(_1,_2));
}
function GetCookie(_3){
var _4=_3+"=";
var _5=_4.length;
var _6=document.cookie.length;
var i=0;
while(i<_6){
var j=i+_5;
if(document.cookie.substring(i,j)==_4){
return getCookieVal(j);
}
i=document.cookie.indexOf(" ",i)+1;
if(i==0){
break;
}
}
return null;
}

var winObj;
if(document.images){
var CloseItGif=new Image(16,17);
CloseItGif.src="lib/close.gif";
}
function objPostIt(_1,_2,x,y,_5){
function setHead(_6){
this.txtHead=_6;
}
function setHeadOnly(_7){
this.txtHeadOnly=_7;
}
function setNoteStart(_8){
this.txtStart=_8;
}
function setNoteBody(_9){
this.txtNote=_9;
}
function setNoteEnd(_a){
this.txtEnd=_a;
}
function writeAllNote(){
this.win.writeIt(this.txtHead+this.txtStart+this.txtNote+this.txtEnd);
}
function show(){
if(this.headOnly){
this.win.writeIt(this.txtHeadOnly);
this.win.showIt();
}else{
this.writeAllNote();
this.win.showIt();
}
}
function hide(){
this.win.hideIt();
}
function showIfVisible(){
if(this.vis==1){
this.show();
}
}
function moveTo(x,y){
this.win.moveIt(x,y);
this.win.stayAt(x,y);
}
function maximise(){
this.headOnly=false;
this.show();
}
function minimise(){
this.headOnly=true;
this.show();
}
function setDragDrop(){
this.isFixedPos=false;
this.win.dragdrop();
}
function anchorLeftTo(_d,_e){
this.win.anchorObj=_d;
this.win.anchorLeftRel=_e;
}
function anchorTopTo(_f,_10){
this.win.anchorObj=_f;
this.win.anchorTopRel=_10;
}
var _11=document.createElement(_2);
_11.setAttribute("id",_2);
var _12="visibility:hidden; position:absolute";
if(bw.ie){
_11.style.setAttribute("cssText",_12);
}else{
_11.setAttribute("style",_12);
}
document.body.appendChild(_11);
this.win=new lib_obj(_2);
winObj=this.win;
this.win.handle=_1;
this.vis=0;
this.show=show;
this.showIfVisible=showIfVisible;
this.hide=hide;
this.isFixedPos=_5;
this.setDragDrop=setDragDrop;
this.headOnly=false;
this.txtHead="";
this.txtHeadOnly="";
this.txtStart="";
this.txtNote="";
this.txtEnd="";
this.setHead=setHead;
this.setHeadOnly=setHeadOnly;
this.setNoteStart=setNoteStart;
this.setNoteBody=setNoteBody;
this.setNoteEnd=setNoteEnd;
this.writeAllNote=writeAllNote;
this.moveTo=moveTo;
this.maximise=maximise;
this.minimise=minimise;
this.win.moveIt(x,y);
this.win.stayAt(x,y);
this.anchorLeftTo=anchorLeftTo;
this.anchorTopTo=anchorTopTo;
var _13=GetCookie("w"+this.win.handle+"Pos");
if((_13!=null)&&(_13!="")){
var p=_13.indexOf("^");
var xp=parseInt(_13.substring(0,p));
var v=_13.indexOf("v");
var yp=parseInt(_13.substring(p+1,v));
this.vis=parseInt(_13.slice(v+1));
if(!this.isFixedPos){
this.win.moveIt(xp,yp);
this.win.stayAt(xp,yp);
}
}else{
document.cookie="w"+_1+"Pos="+x+"^"+y+"v"+0;
}
this.win.checkPosition();
objPostIt.prototype.stayAtBegin=function(){
if(!this.win.IsCheckingPosition){
this.win.checkPosition();
}
};
objPostIt.prototype.stayAtCancel=function(){
if(this.win.IsCheckingPosition){
this.win.checkPositionCancel();
}
};
objPostIt.prototype.isVisible=function(){
return this.win.isVisible();
};
}

function objPostItMenu(_1,_2,_3){
function clearHideTimer(){
clearTimeout(this.hideTimer);
this.hideTimer=null;
}
function setHideTimer(_4,_5){
this.hideTimer=setTimeout(_4,_5);
}
function setHeadMaximised(_6){
var _7=this.objName+".minimise()";
tmp="<div class=\"postItMenuHead\" onmouseout=\""+_2+".setHideTimer("+"'"+_7+"',10)"+"\">"+_6+"</div>";
this.postItObj.txtHead=tmp;
}
function setHeadMinimised(_8){
tmp="<div class=\"postItMenuHead\" onmouseover=\""+_2+".maximise()\">"+_8+"</div>";
this.postItObj.txtHeadOnly=tmp;
}
function minimise(){
this.postItObj.minimise();
}
function maximise(){
this.postItObj.maximise();
}
function highlightItem(_9,_a){
if(_a==true){
_9.className="postItMenuItemSel";
}else{
_9.className="postItMenuItem";
}
}
function selectItem(_b,_c){
if(_c==true){
this.clearHideTimer();
_b.className="postItMenuItemSel";
}else{
var _d=this.objName+".minimise()";
this.setHideTimer(_d,10);
_b.className="postItMenuItem";
}
}
function handleItemClick(_e){
this.minimise();
_3(_e);
}
function setItems(_f){
with(this){
_1.txtStart="";
_1.txtNote="";
if(_3!=null){
for(var i=0;i<_f.length;i++){
_1.txtNote+="<div class=\"postItMenuItem\"";
_1.txtNote+=" onmouseover=\""+_2+".selectItem(this,true)\"";
_1.txtNote+=" onmouseout=\""+_2+".selectItem(this,false)\"";
_1.txtNote+=" onclick=\""+_2+".handleItemClick("+_f[i][0]+")\">";
_1.txtNote+="<span style=\"padding:2px;\">"+_f[i][1]+"</span>";
_1.txtNote+="</div>";
}
}else{
alert("No item handler specified");
}
_1.txtEnd="";
}
}
this.postItObj=_1;
this.objName=_2;
this.handlerFunc=_3;
this.hideTimer=null;
this.clearHideTimer=clearHideTimer;
this.setHideTimer=setHideTimer;
this.setHeadMaximised=setHeadMaximised;
this.setHeadMinimised=setHeadMinimised;
this.minimise=minimise;
this.maximise=maximise;
this.highlightItem=highlightItem;
this.selectItem=selectItem;
this.handleItemClick=handleItemClick;
this.setItems=setItems;
this.postItObj.win.divElem.className="postItMenuStyle";
}function sortArray(_1,_2){
var _3=0;
function nextLevel(a,b){
if(_3==_2.length-1){
return 0;
}
_3++;
switch(_2[_3][1]){
case "AA":
res=compareAlphaA(a,b);
break;
case "AD":
res=compareAlphaD(a,b);
break;
case "NA":
res=compareNumA(a,b);
break;
case "ND":
res=compareNumD(a,b);
break;
default:
alert("Invalid sort type: "+_2[_3][1]);
break;
}
_3--;
return res;
}
function compareAlphaA(a,b){
a1=a[_2[_3][0]];
b1=b[_2[_3][0]];
a2=a1.toLowerCase();
b2=b1.toLowerCase();
return ((a2<b2)?-1:((a2>b2)?1:nextLevel(a,b)));
}
function compareAlphaD(b,a){
a1=a[_2[_3][0]];
b1=b[_2[_3][0]];
a2=a1.toLowerCase();
b2=b1.toLowerCase();
return ((a2<b2)?-1:((a2>b2)?1:nextLevel(b,a)));
}
function compareNumA(a,b){
a1=a[_2[_3][0]];
b1=b[_2[_3][0]];
return ((a1<b1)?-1:((a1>b1)?1:nextLevel(a,b)));
}
function compareNumD(b,a){
a1=a[_2[_3][0]];
b1=b[_2[_3][0]];
return ((a1<b1)?-1:((a1>b1)?1:nextLevel(b,a)));
}
switch(_2[_3][1]){
case "AA":
_1.sort(compareAlphaA);
break;
case "AD":
_1.sort(compareAlphaD);
break;
case "NA":
_1.sort(compareNumA);
break;
case "ND":
_1.sort(compareNumD);
break;
default:
alert("Invalid sort type: "+_2[_3][1]);
break;
}
return _1;
}

function objDataGrid(_1,n,_3,_4,_5,_6,_7,_8,_9,_a,_b){
var _c=25;
function sortArray(_d,_e){
var _f=0;
function nextLevel(a,b){
if(_f==_e.length-1){
return 0;
}
_f++;
switch(_e[_f][1]){
case "AA":
res=compareAlphaA(a,b);
break;
case "AD":
res=compareAlphaD(a,b);
break;
case "NA":
res=compareNumA(a,b);
break;
case "ND":
res=compareNumD(a,b);
break;
default:
alert("Invalid sort type: "+_e[_f][1]);
break;
}
_f--;
return res;
}
function compareAlphaA(a,b){
a1=a.gridData[_e[_f][0]];
b1=b.gridData[_e[_f][0]];
a2=a1.toLowerCase();
b2=b1.toLowerCase();
return ((a2<b2)?-1:((a2>b2)?1:nextLevel(a,b)));
}
function compareAlphaD(b,a){
a1=a.gridData[_e[_f][0]];
b1=b.gridData[_e[_f][0]];
a2=a1.toLowerCase();
b2=b1.toLowerCase();
return ((a2<b2)?-1:((a2>b2)?1:nextLevel(b,a)));
}
function compareNumA(a,b){
a1=a.gridData[_e[_f][0]];
b1=b.gridData[_e[_f][0]];
return ((a1<b1)?-1:((a1>b1)?1:nextLevel(a,b)));
}
function compareNumD(b,a){
a1=a.gridData[_e[_f][0]];
b1=b.gridData[_e[_f][0]];
return ((a1<b1)?-1:((a1>b1)?1:nextLevel(b,a)));
}
switch(_e[_f][1]){
case "AA":
_d.sort(compareAlphaA);
break;
case "AD":
_d.sort(compareAlphaD);
break;
case "NA":
_d.sort(compareNumA);
break;
case "ND":
_d.sort(compareNumD);
break;
default:
alert("Invalid sort type: "+_e[_f][1]);
break;
}
return _d;
}
function sortby(c,_1b){
with(this){
var _1c="";
var _1d=column[c].sortcolm;
var _1e=false;
if(_1b){
_1e=_1b;
}
if(c==_4&&!_1e){
column[_1d].sortParms[0][1]=(column[_1d].sortParms[0][1].charAt(1)=="A")?column[_1d].sortParms[0][1].charAt(0)+"D":column[_1d].sortParms[0][1].charAt(0)+"A";
}else{
setSortColumn(c);
}
var _1f=column[_1d].sortParms;
sortArray(rowData,_1f);
drawAllRowData();
SetSelectedRow(0);
relatedGridDivUpdate();
}
}
function reSort(){
with(this){
sortby(_4,true);
}
}
function setSortParm(c,_21){
this.column[c].sortParms=_21;
}
function addColumn(n,_23,_24,_25,_26,_27){
function dbColumn(n,_29,_2a,_2b,_2c,_2d){
this.head=_29;
this.width=_2a;
this.show=_2b;
this.format=_2c;
this.sortcolm=n;
this.isSortable=true;
var _2e="A";
if(n==0){
_2e="N";
}
var _2f="A";
this.sortParms=new Array();
this.sortParms[0]=new Array();
this.sortParms[0][0]=this.sortcolm;
this.sortParms[0][1]=_2e+_2f;
if(_2d){
if(_2d!=-1){
_2e=_2d.charAt(0);
_2f=_2d.charAt(1);
if(_2d.length>2){
this.sortcolm=_2d.substring(2);
}
this.sortParms[0]=new Array();
this.sortParms[0][0]=this.sortcolm;
this.sortParms[0][1]=_2e+_2f;
}else{
this.isSortable=false;
this.sortcolm=-1;
}
}
this.onMouseOverFunc=null;
this.onMouseOutFunc=null;
this.onMouseClickFunc=null;
this.isCustom=false;
this.bgcolor=null;
this.bgcolorSel=null;
}
if(n>_c){
alert("dataGrid.js Column max exceeded");
}else{
this.column[n]=new dbColumn(n,_23,_24,_25,_26,_27);
this.columnOrder[n]=n;
}
}
function cellCustomisationRec(_30,_31){
this.bgcolor=_30;
this.bgcolorSel=_31;
}
function rowDataRec(_32,_33,_34){
this.gridData=_32;
this.bgcolor=_33;
this.bgcolorSel=_34;
this.cellOptions=new Array();
}
function addDataArray(n,_36){
with(this){
if(n==-1){
n=rowData.length;
}
rowData[n]=new rowDataRec(_36,_8,_a);
numbRows=rowData.length;
if(numbRows>0){
fromRow=0;
toRow=numbRows;
}
}
}
function addData(n,_38,_39,_3a,_3b,_3c,_3d,_3e,_3f,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_4a,_4b,_4c,_4d,_4e,_4f,_50,_51){
with(this){
var _52=new Array(_38,_39,_3a,_3b,_3c,_3d,_3e,_3f,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_4a,_4b,_4c,_4d,_4e,_4f,_50,_51);
addDataArray(n,_52);
}
}
function changeData(r,_54,_55,_56,_57,_58,_59,_5a,_5b,_5c,_5d,_5e,_5f,_60,_61,_62,_63,_64,_65,_66,_67,_68,_69,_6a,_6b,_6c,_6d){
with(this){
var _6e=null;
if(r!=-1){
var tmp=cellData(r,_4).toString();
_6e=tmp.toUpperCase();
}
addData(r,_54,_55,_56,_57,_58,_59,_5a,_5b,_5c,_5d,_5e,_5f,_60,_61,_62,_63,_64,_65,_66,_67,_68,_69,_6a,_6b,_6c,_6d);
if(r==-1){
var _70=getIDData(rowData.length-1);
sortby(1,true);
SetSelectedRow(find(_3,_70));
}else{
var tds=document.getElementById("gridrow"+objNumb+r).cells;
var str;
var i=-1;
for(var c=0;c<column.length;c++){
if(column[c].show){
str=createCell(r,c);
i++;
tds[i].innerHTML=str;
}
}
var tmp=cellData(r,_4).toString();
if(_6e!=tmp.toUpperCase()){
sortby(1,true);
}else{
SetSelectedRow(r);
}
}
}
}
function changeCell(r,c,_77){
with(this){
rowData[r].gridData[c]=_77;
var i=0;
/*
for(var j=0;j<c;j++){
if(column[j].show){
i++;
}
}
*/

		var p = 0;
		var col = -1;
		var found = false;
		do {
			col = columnOrder[p];
					
			if (col==c){
				found = true;
			} else {			
				p++;
				if (column[col].show) {i++;}
			}
				
		} while (!found && p<columnOrder.length);
//console.log("p="+p+", i="+i);

if(document.getElementById("gridrow"+objNumb+r).cells[i]){
var td=document.getElementById("gridrow"+objNumb+r).cells[i];
td.innerHTML=createCell(r,c);
}
}
}
function deleteData(r){
with(this){
if(r!=-1){
var _7c=rowData.slice(0,r);
rowData=_7c.concat(rowData.slice(r+1));
numbRows=rowData.length;
drawAllRowData();
if(r==numbRows){
r--;
}
selRow=-1;
SetSelectedRow(r);
}
}
}
function deleteAllData(){
with(this){
rowData=new Array();
numbRows=0;
selRow=-1;
fromRow=-1;
toRow=-1;
drawTheData();
SetSelectedRow(selRow);
}
}
function drawHeadRow(){
with(this){
var col=0;
var _7e=dataWidth+2;
var txt="<table id=\"gridHeadTable"+objNumb+"\" style=\""+gridHeadTextStyle+"\" border=0 cellpadding=\""+cellPadding+"\" cellspacing=\""+colSpacing+"\" width=\""+_7e+"\"><tr>";
for(var i=0;i<columnOrder.length;i++){
col=columnOrder[i];
if(column[col].show){
stxt="";
if(allowSortByClick&&column[col].sortcolm!=-1){
stxt=" onClick=\""+_1+".sortby("+col+")\" style=\"cursor:pointer;\" ";
}
_7e=column[col].width;
txt+="<td id=\"grid"+objNumb+"HeadCell"+col+"\""+stxt+"\" width=\""+_7e+"\" align=\"center\" valign=\"top\" bgcolor=\""+_7+"\">"+column[col].head+"</td>";
}
}
txt+="</tr></table>";
document.getElementById("grid_"+objNumb+"_HeadRow").innerHTML=txt;
}
}
function createCell(r,c){
with(this){
var str;
if(onFormatDataFunc!=null&&column[c].format){
str=onFormatDataFunc(r,c,rowData[r].gridData[c]);
}else{
str=rowData[r].gridData[c];
}
if(column[c].isCustom&&(rowData[r].cellOptions[c])){
drawCellBackgroundColour(r,c,rowData[r].cellOptions[c].bgcolor);
}
return str;
}
}
function lpad(n){
var _85=n;
if(_85<10){
_85="0"+_85;
}
return _85;
}
function createRow(r){
with(this){
var str;
var col;
var _89;
txt="<tr id=\"gridrow"+objNumb+r+"\" onclick=\""+_1+".selectRow("+r+")\" ondblclick=\""+_1+".dodblClick("+r+")\" >";
for(var c=0;c<columnOrder.length;c++){
col=columnOrder[c];
if(column[col].show){
str=createCell(r,col);
_89="";
if(column[col].onMouseOverFunc){
_89=" onmouseover=\""+_1+".doMouseOver(event,"+col+","+r+")\" onmouseout=\""+_1+".doMouseOut("+col+")\"";
}
if(column[col].onMouseClickFunc){
_89+=" onclick=\""+_1+".doMouseClick(event,"+col+","+r+")\" ";
}
txt+="<td id=\"gridcell"+objNumb+lpad(col)+r+"\" valign=\"top\" style=\""+gridDataStyle+"\" width=\""+column[col].width+"\" bgcolor=\""+rowData[r].bgcolor+"\""+_89+">"+str+"</td>";
}
}
txt+="</tr>";
return txt;
}
}
function setRowBackgroundColour(r,_8c,_8d){
with(this){
rowData[r].bgcolor=_8c;
rowData[r].bgcolorSel=_8d;
}
}
function drawRowBackgroundColour(r,_8f,_90){
with(this){
if(_8f){
setRowBackgroundColour(r,_8f,_90);
}
for(var c=0;c<column.length;c++){
if(column[c].show){
var bgc=_8f;
if(r==selRow){
bgc=_90;
}
drawCellBackgroundColour(r,c,bgc);
}
}
}
}
function setColumnBackgroundColour(c,_94,_95){
with(this){
column[c].isCustom=true;
column[c].bgcolor=_94;
column[c].bgcolorSel=_95;
}
}
function drawColumnBackgroundColour(c){
with(this){
for(var r=0;r<rowData.length;r++){
drawCellBackgroundColour(r,c,rowData[r].cellOptions[c].bgcolor);
}
}
}
function setCellBackgroundColour(r,c,_9a,_9b){
with(this){
if(document.getElementById("gridcell"+objNumb+lpad(c)+r)&&(rowData[r].cellOptions[c])){
rowData[r].cellOptions[c].bgcolor=_9a;
rowData[r].cellOptions[c].bgcolorSel=_9b;
}
}
}
function drawCellBackgroundColour(r,c,bgc){
with(this){
if(document.getElementById("gridcell"+objNumb+lpad(c)+r)){
document.getElementById("gridcell"+objNumb+lpad(c)+r).style.backgroundColor=bgc;
}
}
}
function setCustomColours(c){
with(this){
for(var r=0;r<rowData.length;r++){
rowData[r].cellOptions[c]=new cellCustomisationRec(column[c].bgcolor,column[c].bgcolorSel);
}
}
}
function reDrawCellsInColumn(c){
with(this){
for(var r=0;r<rowData.length;r++){
createCell(r,c);
}
}
}
function drawCustomColumns(){
with(this){
for(var c=0;c<column.length;c++){
if(column[c].isCustom){
if(!customColumnsSetupDone&&column[c].bgcolor!=null){
setCustomColours(c);
}
reDrawCellsInColumn(c);
}
}
customColumnsSetupDone=true;
}
}
function changeRowColour(r,_a5){
with(this){
if(numbRows>0&&r>=fromRow&&r<=toRow){
for(var c=0;c<column.length;c++){
if(column[c].show&&column[c].bgcolor==null){
document.getElementById("gridcell"+objNumb+lpad(c)+r).style.backgroundColor=_a5;
}
}
}
}
}
function highLight(_a7,_a8){
with(this){
if(!selectRowColourOff){
if(_a7!=-1){
changeRowColour(_a7,rowData[_a7].bgcolor);
}
changeRowColour(_a8,rowData[_a8].bgcolorSel);
}
}
}
function drawAllRowData(){
with(this){
var str;
var txt="<table id=\"grid_rowtable\" width=\""+dataWidth+"\" border=0 cellpadding=\""+cellPadding+"\" cellspacing=\""+colSpacing+"\" style=\""+gridTextStyle+"\" bgcolor=\""+_9+"\">";
if(fromRow<0){
fromRow=0;
}
if(toRow>rowData.length){
toRow=rowData.length;
}
for(var r=fromRow;r<toRow;r++){
txt+=createRow(r);
}
txt+="</table>";
document.getElementById(dataDiv).innerHTML=txt;
drawCustomColumns();
}
}
function whoAmI(){
alert("I am "+this.objName);
}
function drawGrid(){
with(this){
dataWidth=0;
for(var c=0;c<column.length;c++){
if(column[c].show){
dataWidth+=column[c].width+colSpacing;
}
}
if(gridHeight==-1){
var _ad=dataWidth;
}else{
var _ad=dataWidth+17;
}
var _ae=dataWidth+8;
_5=_ae;
var _af=140;
var _b0=dataWidth-_af;
PageCounterTopTxt="";
PageCounterBotTxt="";
if(rowsPerPage>0){
numbPages=parseInt(numbRows/rowsPerPage);
if(numbRows%rowsPerPage>0){
numbPages++;
}
if(allowPageCounterTop){
PageCounterTopTxt="<tr><td id=\"grid"+objNumb+"rppT\" colspan=2></td></tr>";
}
if(allowPageCounterBot){
PageCounterBotTxt="<tr><td id=\"grid"+objNumb+"rppB\" colspan=2></td></tr>";
}
}
var txt="<table bgcolor=\""+_7+"\" style=\"border:1px solid #666666\"  cellpadding=2 cellspacing=1 border=0 >";
if(allowSearch){
txt+="<tr>";
txt+="<td align=\"left\" width=\""+_af+"\"><span style=\""+gridHeadTextStyle+"\">Search for:&nbsp;</span><input type=\"text\" id=\"grid"+objNumb+"Search\" value=\"\" class=\"inputBox\" style=\""+gridTextStyle+" width:50px;\"  onKeyUp=\"return "+_1+".search(event)\"></td>";
txt+="<td align=\"left\" width=\""+_b0+"\"><span  id=\"gridlink"+objNumb+"\" style=\""+gridHeadTextStyle+" width:"+_b0+"px; height:14px; overflow:hidden; display:block\">&nbsp;</span></td>";
txt+="</tr>";
txt+="<tr><td align=\"left\" colspan=2  width=\""+_ae+"\"><hr size=1 noshade></td></tr>";
}
txt+=PageCounterTopTxt;
txt+="<tr><td align=\"left\" colspan=2  width=\""+_ae+"\" id=\"grid_"+objNumb+"_HeadRow\"><div></div></td></tr>";
txt+="<tr><td align=\"left\" colspan=2  width=\""+_ae+"\">";
txt+="<div id=\""+dataDiv+"\" style=\"border: 1px solid #666666; width:"+_ad+"px; background-color:"+_7;
if(gridHeight!=-1){
txt+="; height:"+gridHeight+"px";
}
if(objScrollDiv==null&&gridHeight!=-1){
txt+="; overflow:scroll; \">";
}else{
txt+="; \">";
}
txt+="</div>";
txt+="</td></tr>";
txt+=PageCounterBotTxt;
if(allowLowerStatus){
txt+="<tr><td colspan=2><table border=0 cellspacing=0 cellpadding=0 width=\"100%\">";
txt+="<tr><td align=\"left\"><span id=\"grid"+objNumb+"lowerLink\" style=\""+gridHeadTextStyle+"\">&nbsp;</span></td><td align=\"right\" id=\"grid"+objNumb+"Status\">&nbsp;</td></tr>";
txt+="</table></td></tr>";
}
txt+="</table>";
if(document.getElementById("grid_"+objNumb)){
gridDivObj=document.getElementById("grid_"+objNumb);
gridDivObj.innerHTML=txt;
}else{
alert("ERROR: No container cell (grid_"+objNumb+") on the main page!");
}
drawHeadRow();
numbRows=rowData.length;
setPageNav();
}
}
function setPageNav(pos){
with(this){
if(allowPageCounterTop){
setPageNavPos("T");
}
if(allowPageCounterBot){
setPageNavPos("B");
}
}
}
function setPageNavPos(pos){
with(this){
if(numbRows<1||rowsPerPage<1){
return;
}
numbPages=parseInt(numbRows/rowsPerPage);
if(numbRows%rowsPerPage>0){
numbPages++;
}
if(numbPages>1){
var txt="<div align=\"right\"><span onclick=\""+_1+".nextPage(-1)\" style=\""+gridPageLinkStyle+"\" id=\"grid"+objNumb+"rpprev"+pos+"\" >Prev</span>";
for(var rpp=1;rpp<=numbPages;rpp++){
txt+="&nbsp;<span id=\"grid"+objNumb+"rpp"+rpp+pos+"\" onclick=\""+_1+".showPage("+rpp+")\" style=\""+gridPageLinkStyle+"\">"+rpp+"</span>";
}
txt+="&nbsp;<span onclick=\""+_1+".nextPage(1)\" style=\""+gridPageLinkStyle+"\" id=\"grid"+objNumb+"rpnext"+pos+"\">Next</span>";
txt+="</div>";
document.getElementById("grid"+objNumb+"rpp"+pos).innerHTML=txt;
}
}
}
function setDataDiv(_b6){
this.dataDiv=_b6;
}
function setScrollDivObj(_b7){
this.objScrollDiv=_b7;
}
function drawTheData(fR,tR){
with(this){
if(fR){
fromRow=fR-1;
}
if(tR){
toRow=tR;
}
if(objScrollDiv==null){
if(rowsPerPage>0){
showPage(1);
}else{
drawAllRowData();
}
}else{
objScrollDiv.createDivs();
var _ba=objScrollDiv.getDataDiv();
setDataDiv(_ba);
if(rowsPerPage>0){
showPage(1);
}else{
drawAllRowData();
}
objScrollDiv.setup();
}
if(numbRows>0){
selectRow(0);
}
if(allowSearch){
document.getElementById("grid"+objNumb+"Search").focus();
}
setSortColumn(_4);
relatedGridDivUpdate();
}
}
function dodblClick(r){
this.ondblClick();
}
function SetdblClickFunc(_bc){
this.ondblClickFunc=_bc;
}
function ondblClick(){
if(this.ondblClickFunc!=null){
this.ondblClickFunc();
}
}
function SetMouseOverFuncs(c,_be,_bf,_c0){
with(this){
column[c].onMouseOverFunc=_be;
column[c].onMouseOutFunc=_bf;
if(_c0){
column[c].onMouseOverFunc=column[_c0].onMouseOverFunc;
column[c].onMouseOutFunc=column[_c0].onMouseOutFunc;
}
}
}
function doMouseOver(ev,c,r){
if(this.column[c].onMouseOverFunc){
this.column[c].onMouseOverFunc(ev,r);
}
}
function doMouseOut(c){
if(this.column[c].onMouseOutFunc){
this.column[c].onMouseOutFunc();
}
}
function SetMouseClickFunc(c,_c6,_c7){
with(this){
column[c].onMouseClickFunc=_c6;
if(_c7){
column[c].onMouseClickFunc=column[_c7].onMouseClickFunc;
}
}
}
function doMouseClick(ev,c,r){
if(this.column[c].onMouseClickFunc){
this.column[c].onMouseClickFunc(ev,r,c);
}
}
function selectRow(n){
with(this){
highLight(selRow,n);
selRow=n;
onChange();
}
}
function SetSelectedRow(row){
if(row>=0&&row<=this.numbRows){
this.selectRow(row);
this.scrollToRow(row);
}else{
selRow=-1;
}
}
function setSortColumn(c){
with(this){
if(allowSortByClick&&column[c].isSortable){
if(column[_4].show){
document.getElementById("grid"+objNumb+"HeadCell"+_4).style.backgroundColor=_7;
}
_4=c;
if(column[_4].show){
document.getElementById("grid"+objNumb+"HeadCell"+_4).style.backgroundColor=_b;
}
if(allowSearch){
document.getElementById("grid"+objNumb+"Search").value="";
document.getElementById("grid"+objNumb+"Search").focus();
}
}
}
}
function onChange(){
with(this){
if(allowLowerStatus){
document.getElementById("grid"+objNumb+"Status").innerHTML="<span style=\""+gridStatusStyle+"\">Record "+parseInt(selRow+1)+" of "+numbRows+"</span>";
}
if(onChangeFunc!=null){
onChangeFunc();
}
}
}
function SetChangeFunc(_ce){
this.onChangeFunc=_ce;
}
function SetFormatDataFunc(_cf){
this.onFormatDataFunc=_cf;
}
function SetActionLink(_d0){
if(this.allowSearch){
document.getElementById("gridlink"+this.objNumb).innerHTML=_d0;
}
}
function SetLowerLink(_d1){
document.getElementById("grid"+this.objNumb+"lowerLink").innerHTML=_d1;
}
function scrollToRow(row){
with(this){
if(objScrollDiv!=null){
var _d3=objScrollDiv.getClipTop();
var _d4=document.getElementById("gridrow"+objNumb+row).offsetTop;
objScrollDiv.scrollBy(_d4-_d3);
}
}
}
function search(e){
with(this){
if(numbRows>0){
var _d6=document.getElementById("grid"+objNumb+"Search").value.toLowerCase();
var _d7=_d6.length;
var _d8=selRow;
var gd;
if(_d8==-1){
_d8=0;
}
if(_d7>0){
for(var r=0;r<numbRows;r++){
gd=rowData[r].gridData[_4].toString();
if(gd.substring(0,_d7).toLowerCase()==_d6){
_d8=r;
break;
}
}
}else{
_d8=0;
}
selectRow(_d8);
scrollToRow(_d8);
}
}
}
function cellData(r,c){
if(r<=this.numbRows&&r>=0){
return this.rowData[r].gridData[c];
}else{
return "";
}
}
function getIDData(r){
return this.cellData(r,this.IDColumn);
}
function find(col,_df){
with(this){
var row=-1;
for(var r=0;r<rowData.length;r++){
if(rowData[r].gridData[col]==_df){
row=r;
break;
}
}
return row;
}
}
function count(col,_e3){
with(this){
var cnt=0;
for(var r=0;r<rowData.length;r++){
if(rowData[r].gridData[col]==_e3){
cnt++;
}
}
return cnt;
}
}
function relatedGridDivAdd(win){
with(this){
relatedGridDiv[relatedGridDiv.length]=win;
}
}
function relatedGridDivRemove(win){
with(this){
}
}
function relatedGridDivUpdate(){
with(this){
for(var i=0;i<relatedGridDiv.length;i++){
if(relatedGridDiv[i]!=null&&!relatedGridDiv[i].closed){
relatedGridDiv[i].document.getElementById("grid_9").innerHTML=gridDivObj.innerHTML;
}
}
}
}
function relatedGridDivGetAll(){
with(this){
var arr=new Array();
for(var i=0;i<relatedGridDiv.length;i++){
if(relatedGridDiv[i]!=null&&!relatedGridDiv[i].closed){
arr[arr.length]=relatedGridDiv[i];
}
}
arr[arr.length]=selfWin;
return arr;
}
}
function setgridDataStyle(sty){
this.gridDataStyle=sty;
}
function setgridHeadTextStyle(sty){
this.gridHeadTextStyle=sty;
}
function setgridTextStyle(sty){
this.gridTextStyle=sty;
}
function setgridStatusStyle(sty){
this.gridStatusStyle=sty;
}
function setRowsPerPage(n){
this.rowsPerPage=n;
}
function nextPage(_f0){
with(this){
var tp=currPage+_f0;
if(tp<=numbPages&&tp>0){
currPage+=_f0;
showPage(currPage);
}
}
}
function enablePrevLastLinks(_f2){
with(this){
function en(obj,st){
obj.style.color=(st)?"blue":"gray";
obj.style.textDecoration=(st)?"underline":"none";
obj.style.cursor=(st)?"pointer":"default";
}
var _f5=document.getElementById("grid"+objNumb+"rpprevT");
var _f6=document.getElementById("grid"+objNumb+"rpnextT");
var _f7=document.getElementById("grid"+objNumb+"rpprevB");
var _f8=document.getElementById("grid"+objNumb+"rpnextB");
if(_f2==1){
en(_f5,false);
en(_f6,true);
en(_f7,false);
en(_f8,true);
}else{
if(_f2==numbPages){
en(_f5,true);
en(_f6,false);
en(_f7,true);
en(_f8,false);
}else{
en(_f5,true);
en(_f6,true);
en(_f7,true);
en(_f8,true);
}
}
}
}
function showPage(n){
with(this){
currPage=n;
var fR=0;
var tR=0;
var clr="";
if(rowsPerPage>0){
fR=(rowsPerPage*(currPage-1));
if(fR<=numbRows){
tR=fR+rowsPerPage;
if(tR>numbRows){
tR=numbRows;
}
fromRow=fR;
toRow=tR;
if(currPage==1){
document.getElementById("grid_1").style.display="none";
document.getElementById("grid_1").style.display="block";
}
if(numbPages>1){
enablePrevLastLinks(currPage);
}
drawAllRowData();
if(numbPages>1){
for(var rpp=1;rpp<=numbPages;rpp++){
if(rpp==currPage){
clr="#DADADA";
}else{
clr="#ffffff";
}
if(allowPageCounterTop){
document.getElementById("grid"+objNumb+"rpp"+rpp+"T").style.backgroundColor=clr;
}
if(allowPageCounterBot){
document.getElementById("grid"+objNumb+"rpp"+rpp+"B").style.backgroundColor=clr;
}
}
}
}
}
if(onPageChangeFunc){
onPageChangeFunc(n);
}
}
}
this.objName=_1;
this.selfWin=self;
this.objNumb=n;
this.IDColumn=_3;
this.searchColumn=_4;
this.columnOrder=new Array();
this.gridHeight=_6;
this.colSpacing=1;
this.cellPadding=1;
this.gridColour="E4ECF3";
if(_7){
this.gridColour=_7;
}
this.cellColour="E4ECF3";
if(_8){
this.cellColour=_8;
}
this.lineColour="ffffff";
if(_9){
this.lineColour=_9;
}
this.selRowColour="7daeea";
if(_a){
this.selRowColour=_a;
}
this.SortHeadcolour="7daeea";
if(_b){
this.SortHeadcolour=_b;
}
this.gridDataStyle="cursor:pointer;";
this.gridHeadTextStyle="font-family:verdana; font-size:8pt;font-weight:bold;";
this.gridTextStyle="font-family:verdana; font-size:8pt;";
this.gridStatusStyle="font-family:verdana; font-size:8pt; font-weight:normal;";
this.gridPageLinkStyle="font-family:verdana; color:blue; padding:1px 3px; font-size:8pt;font-weight:bold;cursor:pointer;text-decoration:underline;";
this.setgridDataStyle=setgridDataStyle;
this.setgridHeadTextStyle=setgridHeadTextStyle;
this.setgridTextStyle=setgridTextStyle;
this.setgridStatusStyle=setgridStatusStyle;
this.dataWidth=0;
this.numbRows=0;
this.selRow=-1;
this.fromRow=-1;
this.toRow=-1;
this.allowSearch=true;
this.dataDiv="grid_"+this.objNumb+"_dataContainer";
this.gridDivObj=null;
this.objScrollDiv=null;
this.relatedGridDiv=new Array();
this.relatedGridDivAdd=relatedGridDivAdd;
this.relatedGridDivRemove=relatedGridDivRemove;
this.relatedGridDivUpdate=relatedGridDivUpdate;
this.relatedGridDivGetAll=relatedGridDivGetAll;
this.column=new Array();
this.addColumn=addColumn;
this.rowData=new Array();
this.rowDataRec=rowDataRec;
this.customColumnsSetupDone=false;
this.addDataArray=addDataArray;
this.addData=addData;
this.changeData=changeData;
this.changeCell=changeCell;
this.drawGrid=drawGrid;
this.drawHeadRow=drawHeadRow;
this.drawAllRowData=drawAllRowData;
this.setCustomColours=setCustomColours;
this.drawCustomColumns=drawCustomColumns;
this.reDrawCellsInColumn=reDrawCellsInColumn;
this.createRow=createRow;
this.setRowBackgroundColour=setRowBackgroundColour;
this.drawRowBackgroundColour=drawRowBackgroundColour;
this.setColumnBackgroundColour=setColumnBackgroundColour;
this.drawColumnBackgroundColour=drawColumnBackgroundColour;
this.drawCellBackgroundColour=drawCellBackgroundColour;
this.setCellBackgroundColour=setCellBackgroundColour;
this.createCell=createCell;
this.search=search;
this.selectRow=selectRow;
this.highLight=highLight;
this.changeRowColour=changeRowColour;
this.selectRowColourOff=false;
this.onChange=onChange;
this.onChangeFunc=null;
this.SetChangeFunc=SetChangeFunc;
this.onFormatDataFunc=null;
this.SetFormatDataFunc=SetFormatDataFunc;
this.setDataDiv=setDataDiv;
this.setScrollDivObj=setScrollDivObj;
this.drawTheData=drawTheData;
this.SetSelectedRow=SetSelectedRow;
this.scrollToRow=scrollToRow;
this.find=find;
this.count=count;
this.sortby=sortby;
this.reSort=reSort;
this.setSortParm=setSortParm;
this.cellData=cellData;
this.getIDData=getIDData;
this.deleteData=deleteData;
this.deleteAllData=deleteAllData;
this.dodblClick=dodblClick;
this.ondblClick=ondblClick;
this.ondblClickFunc=null;
this.SetdblClickFunc=SetdblClickFunc;
this.SetMouseOverFuncs=SetMouseOverFuncs;
this.doMouseOver=doMouseOver;
this.doMouseOut=doMouseOut;
this.SetMouseClickFunc=SetMouseClickFunc;
this.doMouseClick=doMouseClick;
this.SetActionLink=SetActionLink;
this.SetLowerLink=SetLowerLink;
this.allowLowerStatus=true;
this.allowSortByClick=false;
this.setSortColumn=setSortColumn;
this.whoAmI=whoAmI;
this.sortArray=sortArray;
this.rowsPerPage=-1;
this.currPage=1;
this.numbPages=1;
this.setRowsPerPage=setRowsPerPage;
this.nextPage=nextPage;
this.showPage=showPage;
this.enablePrevLastLinks=enablePrevLastLinks;
this.setPageNav=setPageNav;
this.setPageNavPos=setPageNavPos;
this.onPageChangeFunc=null;
this.allowPageCounterTop=true;
this.allowPageCounterBot=true;
}

var activeScr=null;
var scrFirstWidth=window.innerWidth;
function getRef(id){
if(this.isDOM){
return document.getElementById(id);
}
if(this.isIE4){
return document.all[id];
}
if(this.isNS4){
return document.layers[id];
}
}
function getSty(id){
return (this.isNS4?this.getRef(id):this.getRef(id).style);
}
function scrFileLoaded(){
with(this){
activeScr=null;
scrollBy(-100000);
for(count=0;count<divs.length;count++){
getSty(divs[count][0]).visibility="visible";
}
}
}
function scrScrollBy(_3){
with(this){
if(!isDyn||!loaded){
return;
}
_3=parseInt(_3);
divHeight=document.all?divRef.clientHeight:(isDOM?divRef.offsetHeight:divRef.document.height);
if(divHeight==0){
divHeight=1;
}
if((cBot+_3)>divHeight){
_3=divHeight-cBot;
}
if((cTop+_3)<0){
_3=0-cTop;
}
cTop+=_3;
cBot+=_3;
if(isDOM||isIE4){
divSty.clip="rect("+cTop+"px "+cWidth+"px "+cBot+"px "+0+"px)";
}else{
if(isNS4){
if(isNaN(cTop)||isNaN(cBot)||isNaN(_3)){
layout();
}
if(cBot<divSty.clip.top){
divSty.clip.top=cTop;
}
divSty.clip.bottom=cBot;
divSty.clip.top=cTop;
}
}
divSty.top=divs[0][2]-cTop;
thmHeight=Math.ceil(barHeight*((cBot-cTop)/divHeight));
if(thmHeight<minThmHeight){
thmHeight=minThmHeight;
}
if(thmHeight>barHeight){
thmHeight=barHeight;
}
if(isDOM||isIE4){
thmSty.height=thmHeight;
}else{
if(isNS4){
thmSty.clip.height=thmHeight;
}
}
if(activeScr){
return;
}
fracDivDown=(cTop/(divHeight-(cBot-cTop)));
thmSty.top=parseInt(barSty.top)+fracDivDown*(barHeight-thmHeight);
if(loop){
setTimeout(myName+".scrollBy("+_3+")",loop);
}
}
}
function scrThumbDown(_4){
activeScr=this;
if(document.all){
scrOffset=event.offsetY;
}else{
scrOffset=_4.layerY;
}
return false;
}
function scrThumbMove(_5){
if(!activeScr){
return true;
}else{
with(activeScr){
if(isNaN(cTop)||isNaN(cBot)){
divLayout();
}
if((cBot>divHeight)||(thmHeight==barHeight)){
return;
}
if(document.all){
newTop=document.body.scrollTop+event.clientY-scrOffset;
}else{
newTop=_5.pageY-scrOffset;
}
var _6=parseInt(barSty.top);
if(newTop<_6){
newTop=_6;
}
if(newTop+thmHeight>(_6+barHeight)){
newTop=(_6+barHeight)-thmHeight;
}
thmSty.top=newTop;
fracDivDown=cTop/(divHeight-(cBot-cTop));
fracBarDown=(newTop-_6)/(barHeight-thmHeight);
scrollBy((fracBarDown-fracDivDown)*(divHeight-(cBot-cTop)));
return false;
}
}
}
function scrThumbUp(_7){
activeScr=null;
}
function scrBarClick(_8){
with(this){
if(document.all){
clickPos=document.body.scrollTop+event.clientY;
}else{
clickPos=_8.pageY;
}
if(clickPos<parseInt(thmSty.top)){
scrollBy(cTop-cBot);
}
if(clickPos>(parseInt(thmSty.top)+thmHeight)){
scrollBy(cBot-cTop);
}
}
}
function UpDownScroll(){
with(this){
if(UpDownPress!=0){
scrollBy(16*UpDownPress);
}
}
}
function UpDownMouseDown(_9,_a){
with(this){
UpDownPress=_a;
timerID=setInterval(myName+".UpDownScroll()",10);
}
}
function UpDownMouseUp(_b){
with(this){
UpDownPress=0;
clearInterval(timerID);
}
}
function scrLayout(){
with(this){
if(!isDyn){
return;
}
winWidth=document.all?document.body.clientWidth:window.innerWidth;
winHeight=document.all?document.body.clientHeight:window.innerHeight;
if(!loaded){
return;
}
if(winWidth<minWinWidth){
winWidth=minWinWidth;
}
if(winHeight<minWinHeight){
winHeight=minWinHeight;
}
for(count=0;count<divs.length;count++){
var _c=getSty(divs[count][0]);
if(divs[count][1]){
_c.left=divs[count][1];
}
if(divs[count][2]){
_c.top=divs[count][2];
}
if(divs[count][3]){
var _d=divs[count][3];
isNS4?_c.clip.width=_d:_c.width=_d;
}
if(divs[count][4]&&count!=0){
var _e=divs[count][4];
isNS4?_c.clip.height=_e:_c.height=_e;
}
}
if((isDOM||isIE4)&&!cTop){
cTop=0;
}
if(isNS4){
cTop=divSty.clip.top;
}
barHeight=divs[1][4];
cBot=cTop+divs[0][4];
cWidth=divs[0][3];
if(isDOM||isIE4){
divSty.width=cWidth;
}
scrollBy(0);
}
}
function scrSetup(){
with(this){
if(!isDyn){
return;
}
divRef=getRef(divs[0][0]);
divSty=getSty(divs[0][0]);
barSty=getSty(divs[1][0]);
thmSty=getSty(divs[2][0]);
barRef=getRef(divs[1][0]);
thmRef=getRef(divs[2][0]);
upRef=getRef(divs[3][0]);
downRef=getRef(divs[4][0]);
barRef.onclick=new Function("evt","return "+myName+".barClick(evt)");
thmRef.onmousedown=new Function("evt","return "+myName+".thumbDown(evt)");
upRef.onmousedown=new Function("evt","return "+myName+".UpDownMouseDown(evt,-1)");
upRef.onmouseup=new Function("evt","return "+myName+".UpDownMouseUp(evt)");
downRef.onmousedown=new Function("evt","return "+myName+".UpDownMouseDown(evt,1)");
downRef.onmouseup=new Function("evt","return "+myName+".UpDownMouseUp(evt)");
document.onmousemove=scrThumbMove;
document.onmouseup=scrThumbUp;
if(document.all){
document.onselectstart=new Function("if (activeScr) return false");
}else{
if(isDOM){
document.onselect=new Function("if (activeScr) return false");
}
}
loaded=true;
layout();
fileName="";
fileLoaded();
}
}
function createDivs(){
with(this){
var _f="";
_f+="<div id=\"scrollDiv"+objNumb+"\" class=\"scrollDiv\" style=\" background-color:"+backColour+";\"></div>";
_f+="<div id=\"scrollBar"+objNumb+"\" class=\"scrollDiv\" style=\"background-color: #666666; cursor: pointer\"></div>";
_f+="<div id=\"scrollThumb"+objNumb+"\" class=\"scrollDiv\" style=\"background-color: #CCCCCC; cursor: pointer\" ondragstart=\"return false\"></div>";
_f+="<div id=\"scrollUp"+objNumb+"\" class=\"scrollDiv\" style=\"cursor: pointer\"><img src=\"lib/scrollDivUp.jpg\"></div>";
_f+="<div id=\"scrollDown"+objNumb+"\" class=\"scrollDiv\" style=\"cursor: pointer\"><img src=\"lib/scrollDivDown.jpg\"></div>";
document.getElementById(myContainer).innerHTML=_f;
var _10=parseInt(document.getElementById(myContainer).style.height);
var _11=parseInt(document.getElementById(myContainer).style.width);
var _12=document.getElementById("scrollDiv"+objNumb).offsetTop;
var _13=document.getElementById("scrollDiv"+objNumb).offsetLeft;
divs[0]=new Array("scrollDiv"+objNumb,_13,_12,_11,_10);
divs[1]=new Array("scrollBar"+objNumb,_11-15+_13,_12+16,15,_10-32);
divs[2]=new Array("scrollThumb"+objNumb,_11-15+_13+1,"",13,"");
divs[3]=new Array("scrollUp"+objNumb,_11-15+_13,_12,15,16);
divs[4]=new Array("scrollDown"+objNumb,_11-15+_13,_12+_10-16,15,16);
}
}
function getDataDiv(){
return "scrollDiv"+this.objNumb;
}
function getClipTop(){
return this.cTop;
}
function ScrollDiv(n,_15,_16){
this.scrOffset=0;
this.winWidth;
this.winHeight;
this.minWinWidth=500;
this.minWinHeight=300;
this.isDOM=(document.getElementById?true:false);
this.isIE4=((document.all&&!this.isDOM)?true:false);
this.isNS4=(document.layers?true:false);
this.isDyn=(this.isDOM||this.isIE4||this.isNS4);
this.divRef=null;
this.divSty=null;
this.barSty=null;
this.thmSty=null;
this.divs=new Array();
this.objNumb=n;
this.myName=_15;
this.myContainer=_16;
this.loaded=false;
this.loop=0;
this.minThmHeight=20;
this.divHeight=0;
this.barHeight=0;
this.thmHeight=0;
this.cTop=0;
this.cBot=0;
this.cWidth=0;
this.UpDownPress=0;
this.timerID=null;
this.getRef=getRef;
this.getSty=getSty;
this.fileLoaded=scrFileLoaded;
this.scrollBy=scrScrollBy;
this.thumbDown=scrThumbDown;
this.barClick=scrBarClick;
this.UpDownScroll=UpDownScroll;
this.UpDownMouseDown=UpDownMouseDown;
this.UpDownMouseUp=UpDownMouseUp;
this.setup=scrSetup;
this.layout=scrLayout;
this.getDataDiv=getDataDiv;
this.getClipTop=getClipTop;
this.createDivs=createDivs;
this.backColour="#ffffff";
}function radioButtonChange(_1){
var _2=_1.parentNode.me;
with(_2){
selnumb=_1.index;
for(var i=0;i<options.length;i++){
options[i].className=(i==selnumb)?selStyle:normalStyle;
}
if(contig==true){
RadioObj.value=values[selnumb];
}else{
RadioObjArr[selnumb].checked=true;
}
if(afterClickFunc){
afterClickFunc(selnumb);
}
}
}
function MyRadioButton(_4,_5,_6,_7,_8,_9,_a,_b){
function selectOpt(i){
radioButtonChange(this.options[i]);
}
function replace(){
with(this){
if(this.contig){
container=document.createElement("span");
container.me=me;
for(var i=0;i<labels.length;i++){
options[i]=document.createElement("span");
options[i].className=(i==_9)?_6:_5;
options[i].index=i;
options[i].onclick=new Function("radioButtonChange(this)");
var _e=document.createTextNode(labels[i]);
options[i].appendChild(_e);
container.appendChild(options[i]);
}
RadioObj.parentNode.insertBefore(container,RadioObj);
RadioObj.style.display="none";
}else{
for(var i=0;i<labels.length;i++){
container=document.createElement("span");
container.me=me;
options[i]=document.createElement("span");
options[i].className=(i==_9)?_6:_5;
options[i].index=i;
options[i].onclick=new Function("radioButtonChange(this)");
var _e=document.createTextNode(labels[i]);
options[i].appendChild(_e);
container.appendChild(options[i]);
RadioObjArr[i].parentNode.insertBefore(container,RadioObjArr[i]);
RadioObjArr[i].style.display="none";
}
}
}
}
this.me=this;
this.rad_id=_4;
this.rad_name=_b;
this.contig=true;
if(_a){
this.contig=(_a=="true")?true:false;
}
this.selnumb=_9;
this.labels=_7;
this.values=_8;
this.RadioObj=null;
this.RadioObjArr=null;
if(this.rad_id!=""){
this.RadioObj=document.getElementById(this.rad_id);
this.RadioObj.value=this.values[this.selnumb];
}
if(this.rad_name!=""){
this.RadioObjArr=document.getElementsByName(this.rad_name);
}
this.normalStyle=_5;
this.selStyle=_6;
this.container=null;
this.options=new Array;
this.replace=replace;
this.selectOpt=selectOpt;
this.radioButtonChange=radioButtonChange;
this.afterClickFunc=null;
}
var MyRadioButton_array=new Array;
var MyRadioButton_arrayCount=-1;
function MyRadioButton_init(_f,_10,_11,_12,_13,_14,_15){
MyRadioButton_arrayCount++;
MyRadioButton_array[MyRadioButton_arrayCount]=new MyRadioButton(_f,_10,_11,_12,_13,_14,_15,"");
MyRadioButton_array[MyRadioButton_arrayCount].replace();
}
function MyRadioButton_initName(_16,_17,_18,_19,_1a,_1b,_1c){
MyRadioButton_arrayCount++;
MyRadioButton_array[MyRadioButton_arrayCount]=new MyRadioButton("",_17,_18,_19,_1a,_1b,_1c,_16);
MyRadioButton_array[MyRadioButton_arrayCount].replace();
}

var cbi_inputs;
var cbi_imgFalse="";
var cbi_imgTrue="";
var cbi_imgTrueEx="";
var cbi_prefix="";
var cbi_imgArray=new Array();
var cbi_imgArrayTri=new Array();
var cbi_Type="";
function checkBoxImages_Init(_1,_2,_3,_4,_5,_6){
cbi_Type=_1;
cbi_prefix=_2;
if(cbi_Type=="cb"){
cbi_imgArray[0]=_4;
cbi_imgArray[1]=_5;
}
if(cbi_Type=="tri"){
cbi_imgArrayTri[0]=_4;
cbi_imgArrayTri[1]=_5;
cbi_imgArrayTri[2]=_6;
}
checkBoxImages_replaceChecks(_3);
}
function checkBoxImages_replaceChecks(_7){
cbi_inputs=document.getElementsByTagName("input");
var _8=null;
for(var i=0;i<cbi_inputs.length;i++){
if(cbi_inputs[i].getAttribute("type")=="checkbox"){
if(_7=="name"){
_8=cbi_inputs[i].name;
}else{
_8=cbi_inputs[i].id;
}
if(cbi_prefix==""||(cbi_prefix!=""&&_8.substring(0,cbi_prefix.length)==cbi_prefix)){
var _a=document.createElement("img");
if(cbi_inputs[i].checked){
_a.src=cbi_imgArray[1];
}else{
_a.src=cbi_imgArray[0];
}
_a.id="checkImage"+i;
_a.onclick=new Function("checkBoxImages_checkChange("+i+")");
cbi_inputs[i].parentNode.insertBefore(_a,cbi_inputs[i]);
cbi_inputs[i].style.display="none";
}
}
if(cbi_inputs[i].getAttribute("type")=="text"){
if(_7=="name"){
_8=cbi_inputs[i].name;
}else{
_8=cbi_inputs[i].id;
}
if(cbi_prefix==""||(cbi_prefix!=""&&_8.substring(0,cbi_prefix.length)==cbi_prefix)){
var _a=document.createElement("img");
var _b=parseInt(cbi_inputs[i].value);
_a.src=cbi_imgArrayTri[_b];
_a.id="checkImage"+i;
_a.onclick=new Function("checkBoxImages_checkTriState("+i+")");
cbi_inputs[i].parentNode.insertBefore(_a,cbi_inputs[i]);
cbi_inputs[i].style.display="none";
}
}
}
}
function checkBoxImages_checkChange(i){
if(cbi_inputs[i].checked){
cbi_inputs[i].checked="";
document.getElementById("checkImage"+i).src=cbi_imgArray[0];
}else{
cbi_inputs[i].checked="checked";
document.getElementById("checkImage"+i).src=cbi_imgArray[1];
}
}
function checkBoxImages_Set(_d){
if(!_d.checked){
_d.previousSibling.src=cbi_imgArray[0];
}else{
_d.previousSibling.src=cbi_imgArray[1];
}
}
function checkBoxImages_checkTriState(i){
var _f=parseInt(cbi_inputs[i].value);
_f++;
if(_f==3){
_f=0;
}
cbi_inputs[i].value=_f;
document.getElementById("checkImage"+i).src=cbi_imgArrayTri[_f];
}

var currTab=0;
function tabFocus(n){
currTab=n;
for(var i=0;i<Tabs.length;i++){
if(i==n){
document.getElementById("tab"+i).style.backgroundColor=tabSelBackColor;
document.getElementById("tab"+i).className="tab_sel";
document.getElementById("page"+i).style.display="block";
if(document.getElementById("currTab")){
document.getElementById("currTab").value=n;
}
}else{
document.getElementById("tab"+i).style.backgroundColor=tabNormalBackColor;
document.getElementById("tab"+i).className="tab_unsel";
document.getElementById("page"+i).style.display="none";
}
}
}
function initTabs(){
for(var i=0;i<Tabs.length;i++){
document.getElementById("tab"+i).innerHTML=Tabs[i];
document.getElementById("pagesdiv").style.height=pageHeight-20;
if(document.getElementById("pageNav")){
document.getElementById("pageNav").style.width=pageWidth;
}
document.getElementById("page"+i).style.width=pageWidth;
document.getElementById("page"+i).style.height=pageHeight;
document.getElementById("page"+i).style.backgroundColor=tabSelBackColor;
}
}

Date.prototype.formatDate=function(_1,_2){
var _3=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
var _4=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
var _5=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
var _6=["January","February","March","April","May","June","July","August","September","October","November","December"];
var _7={a:function(){
return dat.getHours()>11?"pm":"am";
},A:function(){
return (this.a().toUpperCase());
},B:function(){
var _8=(dat.getTimezoneOffset()+60)*60;
var _9=(dat.getHours()*3600)+(dat.getMinutes()*60)+dat.getSeconds()+_8;
var _a=Math.floor(_9/86.4);
if(_a>1000){
_a-=1000;
}
if(_a<0){
_a+=1000;
}
if((String(_a)).length==1){
_a="00"+_a;
}
if((String(_a)).length==2){
_a="0"+_a;
}
return _a;
},c:function(){
return (this.Y()+"-"+this.m()+"-"+this.d()+"T"+this.h()+":"+this.i()+":"+this.s()+this.P());
},d:function(){
var j=String(this.j());
return (j.length==1?"0"+j:j);
},D:function(){
return _4[dat.getDay()];
},F:function(){
return _6[dat.getMonth()];
},g:function(){
return dat.getHours()>12?dat.getHours()-12:dat.getHours();
},G:function(){
return dat.getHours();
},h:function(){
var g=String(this.g());
return (g.length==1?"0"+g:g);
},H:function(){
var G=String(this.G());
return (G.length==1?"0"+G:G);
},i:function(){
var _e=String(dat.getMinutes());
return (_e.length==1?"0"+_e:_e);
},I:function(){
var _f=new Date("January 1 "+this.Y()+" 00:00:00");
return (_f.getTimezoneOffset()==dat.getTimezoneOffset()?0:1);
},j:function(){
return dat.getDate();
},l:function(){
return _3[dat.getDay()];
},L:function(){
var Y=this.Y();
if((Y%4==0&&Y%100!=0)||(Y%4==0&&Y%100==0&&Y%400==0)){
return 1;
}else{
return 0;
}
},m:function(){
var n=String(this.n());
return (n.length==1?"0"+n:n);
},M:function(){
return _5[dat.getMonth()];
},n:function(){
return dat.getMonth()+1;
},N:function(){
var w=this.w();
return (w==0?7:w);
},O:function(){
var os=Math.abs(dat.getTimezoneOffset());
var h=String(Math.floor(os/60));
var m=String(os%60);
h.length==1?h="0"+h:1;
m.length==1?m="0"+m:1;
return dat.getTimezoneOffset()<0?"+"+h+m:"-"+h+m;
},P:function(){
var O=this.O();
return (O.substr(0,3)+":"+O.substr(3,2));
},r:function(){
var r;
r=this.D()+", "+this.d()+" "+this.M()+" "+this.Y()+" "+this.H()+":"+this.i()+":"+this.s()+" "+this.O();
return r;
},s:function(){
var sec=String(dat.getSeconds());
return (sec.length==1?"0"+sec:sec);
},S:function(){
switch(dat.getDate()){
case 1:
return ("st");
case 2:
return ("nd");
case 3:
return ("rd");
case 21:
return ("st");
case 22:
return ("nd");
case 23:
return ("rd");
case 31:
return ("st");
default:
return ("th");
}
},t:function(){
var _19=[null,31,28,31,30,31,30,31,31,30,31,30,31];
if(this.L()==1&&this.n()==2){
return 29;
}
return _19[this.n()];
},U:function(){
return Math.round(dat.getTime()/1000);
},w:function(){
return dat.getDay();
},W:function(){
var DoW=this.N();
var DoY=this.z();
var _1c=364+this.L()-DoY;
if(_1c<=2&&DoW<=(3-_1c)){
return 1;
}
if(DoY<=2&&DoW>=5){
return new dat(this.Y()-1,11,31).formatDate("W");
}
var _1d=new Date(this.Y(),0,1).getDay();
_1d=_1d!=0?_1d-1:6;
if(_1d<=3){
return (1+Math.floor((DoY+_1d)/7));
}else{
return (1+Math.floor((DoY-(7-_1d))/7));
}
},y:function(){
var y=String(this.Y());
return y.substring(y.length-2,y.length);
},Y:function(){
if(dat.getFullYear){
var _1f=new Date("January 1 2001 00:00:00 +0000");
var x=_1f.getFullYear();
if(x==2001){
return dat.getFullYear();
}
}
var x=dat.getYear();
var y=x%100;
y+=(y<38)?2000:1900;
return y;
},z:function(){
var t=new Date("January 1 "+this.Y()+" 00:00:00");
var _23=dat.getTime()-t.getTime();
return Math.floor(_23/1000/60/60/24);
},Z:function(){
return (dat.getTimezoneOffset()*-60);
}};
function getSwitch(str){
if(_7[str]!=undefined){
return _7[str]();
}else{
return str;
}
}
var dat;
if(_2){
var dat=new Date(_2);
}else{
var dat=this;
}
var _26=_1.split("");
var i=0;
while(i<_26.length){
if(_26[i]=="\\"){
_26.splice(i,1);
}else{
_26[i]=getSwitch(_26[i]);
}
i++;
}
return _26.join("");
};
Date.DATE_ATOM="Y-m-d\\TH:i:sP";
Date.DATE_ISO8601="Y-m-d\\TH:i:sO";
Date.DATE_RFC2822="D, d M Y H:i:s O";
Date.DATE_W3C="Y-m-d\\TH:i:sP";
