/* js cached2: /opt/inet6/inet6es-6.2/base/global/www/skins/default/javascript/max_form.js:/opt/inet6/inet6es-6.2/base/global/www/skins/default/javascript/lib/jquery/selectboxes/selectboxes.js:/opt/inet6/inet6es-6.2/base/global/inet6se/features/net.newwater.common.standard/skins/default/javascript/base.default.js:/opt/inet6/inet6es-6.2/base/global/inet6se/features/net.newwater.common.standard/skins/default/javascript/base.default.js*/
var delrec; var disfld; var frm0; var frm1; var frm2; var multi_selector; function formObj(_1,_2,_3,_4,_5,_6){ this.form=_1; this.action=_2; this.check=false; if(isNaN(_4)){ this.hform=_4; this.page=_5; this.maxpage=_6; }else{ this.hform=false; this.page=_4; this.maxpage=_5; } this.imssg=""; this.draftoption=0; this.curl=_3; this.saved=true; this.bgerr="#ACDAB4"; this.bg="#FFFFFFF"; this.fg="#000000"; this.debug=false; this.paging=1; if(!this.form.onsubmit){ this.form.onsubmit=function(){ }; } this.addErrorMessage=function(_7){ this.imssg+=_7+"\n\n"; }; this.set_debug=function(_8){ if(_8){ this.debug=true; } }; this.get_debug=function(){ return this.debug; }; this.set_paging=function(_9){ if(!_9){ this.paging=1; }else{ this.paging=_9; } }; this.get_paging=function(){ return this.paging; }; this.set_colors=function(bg,_b,fg){ this.bgerr=_b; this.bg=bg; this.fg=fg; }; this.populate_field_checks=function(){ var _d=this.form; var _e=new Array(); var _f=new Array(); var _10=new Array(); var alt; var _12; for(var i=0;i<_d.elements.length;i++){ elmnt=_d.elements[i]; typ=elmnt.type; _12=new String(elmnt.alt); alt=_12.split("||"); if(typ!="button"&&typ!="submit"&&typ!="reset"&&typ!="image"&&alt[1]){ _e[i]=elmnt.name; _f[i]=alt[0]; _10[i]=alt[1]; } } this.set_field_names(_e); this.set_field_labels(_f); this.set_field_types(_10); }; this.set_field_names=function(_14){ this.fieldnames=_14; this.set_check_true(); }; this.set_field_labels=function(_15){ this.fieldlabels=_15; this.set_check_true(); }; this.set_field_types=function(_16){ this.checktype=_16; this.set_check_true(); }; this.set_check_false=function(){ this.check=false; }; this.set_check_true=function(){ this.check=true; }; this.reset=function(){ this.reset_form(); }; this.cancel=function(){ if(this.hform&&!isNaN(this.page)){ this.process_form(); this.hform.pg.value=this.page; this.cancel_changes(); }else{ this.cancel_changes(); } }; this.back=function(){ if(!isNaN(this.page)){ this.form.pg.value=this.page-this.get_paging(); this.form.form_button_action.value="back"; if(this.form.pg.value<=0){ this.cancel_changes(); }else{ this.submit_form(this.form); } } }; this.finish=function(_17,_18){ this.form.form_button_action.value="finish"; this.submit(); }; this.submit=function(_19,_1a,_1b){ this.form.onsubmit(); this.form.onsubmit(); if(_19){ this.form.actn.value=_19; } if((this.check&&this.check_form())||!this.check){ if(this.hform&&!isNaN(this.page)){ this.process_form(); if(!isNaN(_1b)){ this.hform.pg.value=_1b; }else{ if(_1b!=true){ this.hform.pg.value=this.page+this.get_paging(); } } this.submit_form(this.hform); }else{ if(!isNaN(this.page)){ if(!isNaN(_1b)){ this.form.pg.value=_1b; }else{ if(_1b!=true){ this.form.pg.value=this.page+this.get_paging(); } } this.submit_form(this.form); }else{ this.submit_form(this.form); } } } }; this.onsubmit=function(){ if((this.check&&this.check_form())||!this.check){ if(this.hform&&!isNaN(this.page)){ this.process_form(); this.hform.pg.value=this.page+this.get_paging(); this.submit_form(this.hform); return false; }else{ if(!isNaN(this.page)){ this.form.pg.value=this.page+this.get_paging(); if(this.action){ this.form.action=this.action; } return true; }else{ if(this.action){ this.form.action=this.action; } return true; } } } }; this.process_form=function(){ var frm=this.form; var _1d=this.hform; var tmp; var _1f; var typ; var nm; var val; var nam; var _24; _24=""; for(var i=0;i<frm.elements.length;i++){ _1f=frm.elements[i]; typ=_1f.type; nm=_1f.name; val=_1f.value; nam=eval("hdnfrm."+nm); if(this.debug&&!nam){ alert("The hidden form is missing the field: '"+nm+"'."); } if(typ=="text"||typ=="textarea"||typ=="hidden"){ rExp=/\"/gi; myStr=new String(val); nam.value=myStr.replace(rExp,"\""); }else{ if(typ=="checkbox"){ if(_24.indexOf(","+nm)<0){ nam.value=""; if(_1f.checked){ nam.value=val; _24+=","+nm; } }else{ if(_1f.checked){ nam.value+=","+val; } } }else{ if(typ=="radio"){ if(_1f.checked){ nam.value=_1f.value; } }else{ if(typ=="select-one"){ nam.value=_1f.options[_1f.selectedIndex].value; }else{ if(typ=="select-multiple"){ var _26=new Array(); var y=0; for(var x=0;x<_1f.length;x++){ if(_1f.options[x].selected){ _26[y]=_1f.options[x].value; y++; } } nam.value=_26.join(","); } } } } } } return false; }; this.check_saved=function(){ var _29; if(!this.saved){ _29=confirm("You have made changes to this page. Click OK to save them, CANCEL to exit without saving the changes."); if(_29){ return 1; }else{ return; } }else{ return; } }; this.modified=function(){ this.saved=false; }; this.submit_form=function(frm,_2b){ try{ var _2c=document.getElementsByTagName("select"); for(var i=0;i<_2c.length;i++){ var _2e=false; try{ _2e=eval("myfilter"+_2c[i].name.toString().replace("[]","")); } catch(e){ } if(_2e){ _2e.reset(); } if(_2c[i].getAttribute("picklist")!=null&&_2c[i].getAttribute("picklist")=="post"){ picklistSelectAll(_2c[i]); } } } catch(e){ } if(!_2b){ _2b=this.action; } if(_2b){ frm.action=_2b; } frm.submit(); }; this.reset_form=function(){ this.saved=true; this.form.reset(); }; this.cancel_changes=function(){ var sv=this.check_saved(); var str=new String(this.curl); rExp=/inet=/gi; nresults=str.search(rExp); if(nresults>=0){ var s=str.split("="); str=new String(Base64.decode(s[1])); } rExp=/cancel-form=1/gi; results=str.search(rExp); if(sv){ if((this.check&&this.check_form())||!this.check){ if(this.hform){ this.submit_form(this.hform); }else{ this.submit_form(this.form); } } }else{ if(results>=0){ this.submit_form(this.form,this.curl); }else{ if(isNaN(this.curl)){ var rf=jQuery.query.get("rf"); if(rf){ str=new String(Base64.decode(rf)); document.location.href=str; }else{ document.location.href=this.curl; } }else{ history.go(this.curl); } } } }; this.format_phone=function(phn){ var _34=""; var _35; var _36; var i=0; while(i<phn.length){ _35=phn.charAt(i); if(!isNaN(_35)&&_35!=" "){ _34+=_35; } i++; } if(_34.length<10){ return false; }else{ i=10; _36=" ext. "; while(i<_34.length){ _36+=_34.charAt(i); i++; } if(_36==" ext. "){ _36=""; } return "("+_34.substring(0,3)+") "+_34.substring(3,6)+"-"+_34.substring(6,10)+_36; } }; this.format_phone10=function(phn){ var _39=""; var _3a; var _3b; var i=0; while(i<phn.length){ _3a=phn.charAt(i); if(!isNaN(_3a)&&_3a!=" "){ _39+=_3a; } i++; } if(_39.length!=10){ return false; }else{ return "("+_39.substring(0,3)+") "+_39.substring(3,6)+"-"+_39.substring(6,10); } }; this.check_form=function(){ var _3d,_3e,tmp,_40,_41,_42,_43,i; var _45,_46,_47,_48; _45=this.form; _46=this.fieldnames; _47=this.checktype; _48=this.fieldlabels; _3d=""; _3e=this.imssg; _41=this.bgerr; _42=this.bg; _43=this.fg; i=1; for(tmp in _46){ if(_46[tmp]!="!"){ if(isNaN(_47[tmp])&&(_47[tmp].toString().charAt(0)=="R"||_47[tmp].toString().charAt(0)=="C")){ _40=_45.elements[_46[tmp]][0]; }else{ _40=_45.elements[_46[tmp]]; } if(_40&&(_40.type=="select-one"||_40.type=="select-multiple")){ if(_40.selectedIndex==_47[tmp]){ _49=1; _3e+="Please select another value in the "+_48[tmp]+" field.\n"; } }else{ if(_40&&(_40.type=="checkbox")){ var _4a=0; var y; var _4c=_47[tmp].toString().substr(0,1); var _4d=_47[tmp].toString().split("-"); var _4e=_4d[0].toString().substr(1); var _4f; if(_4d.length>1){ _4f=_4d[1].toString(); } var _50=_45.elements[_46[tmp]]; for(y=0;y<_50.length;y++){ if(_50[y].checked){ _4a++; } } if(_4c!="!"&&_4a<_4e){ _49=1; _3e+="Please select at least "+_4e+" of the options for "+_48[tmp]+".\n"; } if(_4c!="!"&&_4f>0&&_4a>_4f){ _49=1; _3e+="Please select "+_4f+" or less options for "+_48[tmp]+".\n"; } }else{ if(_40&&(_40.type=="radio")){ var _51=0; var y; var _50=_45.elements[_46[tmp]]; for(y=0;y<_50.length;y++){ if(_50[y].checked){ _51=1; } } if(_47[tmp]!="!"&&_51!=1){ _49=1; _3e+="Please select one of the options for "+_48[tmp]+".\n"; } }else{ if(_40&&!this.trim_whitespace(_40.value)&&((!isNaN(_47[tmp]))||(isNaN(_47[tmp])&&_47[tmp].charAt(0)!="!"))){ _3d+=_48[tmp]+"\n"; _40.style.backgroundColor=_41; if(i==1){ _40.focus(); } i++; }else{ if(_40){ var _49=0; if(!isNaN(_47[tmp])&&_47[tmp]>0){ var _52=this.trim_whitespace(_40.value); if(_52.length<_47[tmp]){ _49=1; _3e+=_48[tmp]+" must be at least "+_47[tmp]+" characters.\n"; } }else{ if(_47[tmp].toString()=="zip"||_47[tmp].toString()=="!zip"){ var _53; var zip=this.trim_whitespace(_40.value); var _55=zip.substring(0,5); var _56=zip.substring(5,6); var _57=zip.substring(6,10); if(zip.length>0){ if(zip.length<6){ if(isNaN(_55)||zip.length<5){ _53=true; } }else{ if(zip.length==7){ if(!isNaN(zip.substring(0,1))||isNaN(zip.substring(1,2))||!isNaN(zip.substring(2,3))||zip.substring(3,4)!=" "||isNaN(zip.substring(4,5))||!isNaN(zip.substring(5,6))||isNaN(zip.substring(6,7))){ _53=true; } }else{ if(zip&&zip.length>5){ if(isNaN(_55)||_56!="-"||isNaN(_57)||zip.length<10){ _53=true; } } } } if(_53){ _49=1; _3e+="Please use the correct syntax in the "+_48[tmp]+" field: 12345 or 12345-3456.\n"; } } }else{ if(_47[tmp].toString()=="zip4"||_47[tmp].toString()=="!zip4"){ var _53; var zip=this.trim_whitespace(_40.value); if(zip.length>0){ if(isNaN(zip)||zip.length!=4){ _53=true; } if(_53){ _49=1; _3e+="Please use the correct syntax in the "+_48[tmp]+" field: 1234.\n"; } } }else{ if(_47[tmp].toString()=="email"||_47[tmp].toString()=="!email"){ var _58=this.trim_whitespace(_40.value); if(_58.length>0&&((_58.indexOf("@")<2)||(_58.indexOf(".",_58.indexOf("@"))>(_58.length-2))||(_58.indexOf(".",_58.indexOf("@"))<(_58.indexOf("@")+3)))){ _3e+=_48[tmp]+" does not seem to be filled in correctly.\n"; _49=1; } }else{ if(_47[tmp].toString()=="phone"||_47[tmp].toString()=="!phone"){ var phn=this.trim_whitespace(_40.value); var _5a=this.format_phone(phn); if(phn.length>0){ if(!_5a){ _49=1; _3e+="Please fill out the "+_48[tmp]+" field completely. (ex: 970-353-6227)\n"; }else{ _40.value=_5a; } } }else{ if(_47[tmp].toString()=="phone10"||_47[tmp].toString()=="!phone10"){ var phn=this.trim_whitespace(_40.value); var _5a=this.format_phone10(phn); if(phn.length>0){ if(!_5a){ _49=1; _3e+="Please enter phone number as follows: (XXX) XXX-XXXX\n"; }else{ _40.value=_5a; } } }else{ if(_47[tmp].toString()=="date"||_47[tmp].toString()=="!date"){ var d=_40.value; if(d.length>0){ myString=new String(d); if(myString.indexOf("-")>0){ rExp=/-/gi; newString=new String("/"); d=myString.replace(rExp,newString); } var dt=new Date(d); if(isNaN(dt)){ _49=1; _3e+="Please enter a valid date in the "+_48[tmp]+" field. 1/2/2000\n"; }else{ _40.value=(dt.getMonth()+1)+"/"+dt.getDate()+"/"+dt.getFullYear(); } } }else{ if(_47[tmp].toString()=="ndate"||_47[tmp].toString()=="!ndate"){ var d=_40.value; if(d.length>0){ myString=new String(d); if(myString.indexOf("-")>0){ rExp=/-/gi; newString=new String("/"); d=myString.replace(rExp,newString); } var tdt=new Date(); var ndt=new Date(tdt.getFullYear(),tdt.getMonth(),tdt.getDate()); var dt=new Date(d); if(dt.getFullYear()<1970){ dt.setFullYear(dt.getFullYear()+100); } if(isNaN(dt)||dt<ndt){ _49=1; _3e+="Please enter a date equal to or later than today in the "+_48[tmp]+" field. 1/2/2000\n"; }else{ _40.value=(dt.getMonth()+1)+"/"+dt.getDate()+"/"+dt.getFullYear(); } } }else{ if(_47[tmp].toString()=="time"||_47[tmp].toString()=="!time"){ var tm=this.trim_whitespace(_40.value); if(tm.length>0){ var _60,_61,_62; _62=0; _61=tm.split(" "); if(_61[0].indexOf(":")>0){ _60=_61[0].split(":"); }else{ if(_61[0].indexOf(".")>0){ _60=_61[0].split("."); }else{ if(!isNaN(_61[0])){ _60=new Array(2); _60[0]=_61[0]; _60[1]="00"; }else{ _60=new Array(2); var tmp=_61[0].toString(); var _63=tmp.substring(0,2); var _64=tmp.substring((tmp.length-2),(tmp.length)); if(_64.toString().toLowerCase()=="am"||_64.toString().toLowerCase()=="pm"){ var _65=_63.toString().substring((_63.toString().length-1),_63.toString().length); if(_65.toString().toLowerCase()=="p"||_65.toString().toLowerCase()=="a"){ _63=_63.toString().substring(0,1); } _60[0]=_63; _60[1]="00"; _61[1]=_64; }else{ _62=1; } } } } if((_62==0)){ if(_60[1].toString().length>=4){ var tmp=_60[1].toString(); _60[1]=tmp.substring(0,2); _61[1]=tmp.substring((tmp.length-2),(tmp.length)); } if(_61[1]){ _61[1]=this.trim_whitespace(_61[1].toString().toUpperCase()); } if((_60[0]>12&&_60[0]<=24)){ if(_60[0]==24){ _61[1]="AM"; }else{ _61[1]="PM"; } _60[0]=_60[0]-12; } if((_60[0]>0&&_60[0]<=12&&_60[1]>=0&&_60[1]<=59)){ if(_61[1].toString().toUpperCase()!="AM"&&_61[1].toString().toUpperCase()!="PM"){ if(_60[0]==12){ _61[1]="PM"; }else{ _61[1]="AM"; } } if(isNaN(_60[0])||_60[0]==""){ _60[0]=12; } if(isNaN(_60[1])||_60[1]==""){ _60[1]="00"; } _40.value=(_60[0]+":"+_60[1]+" "+_61[1]); }else{ _62=1; } } if(_62){ _49=1; _3e+="Please enter a valid time in the "+_48[tmp]+" field.  8:30 AM\n"; } } }else{ if(_47[tmp].toString()=="num"||_47[tmp].toString()=="!num"){ var num=this.trim_whitespace(_40.value); if(num.length>0){ if(isNaN(num)){ _49=1; _3e+="Please enter a valid number in the "+_48[tmp]+" field.\n"; } } }else{ if(_47[tmp].toString()=="mny"||_47[tmp].toString()=="!mny"){ var mny=this.trim_whitespace(_40.value); var _68=1; if(mny.length>0){ for(var i=0;i<mny.length;i++){ var _69=mny.charAt(i); if(_69!=" "&&_69!="$"&&_69!=","&&_69!="."&&_69!="0"&&!parseFloat(_69)){ _49=1; _3e+="Please enter a non-zero numeric value in the "+_48[tmp]+" field\n"; _68=0; break; } } if(_68==1){ } } } } } } } } } } } } } if(_49==1){ _40.style.backgroundColor=_41; }else{ _40.style.backgroundColor="white"; } } } } } } } } if(_3d||_3e){ var _6a,_6b; _6a=""; _6b=""; if(_3d){ _6a="Please make sure the following fields are filled out completely.\n\n"; } if(_3d&&_3e){ _6b="______________________\n\n"; } alert(_6a+_3d+_6b+_3e); return false; }else{ return true; } }; this.scrub_data=function(_6c){ var _6d=""; for(var i=0;i<_6c.length;i++){ var _6f=_6c.charAt(i); if(parseFloat(_6f)||_6f=="."||_6f=="0"){ _6d+=_6f; }else{ if(_6f!=" "&&_6f!="$"&&_6f!=","){ alert("Please enter a non-zero numeric value."); break; } } } return _6d; }; this.trim_whitespace=function(val){ if(val){ while(""+val.charAt(0)==" "){ val=val.substring(1,val.length); } while(""+val.charAt(val.length-1)==" "){ val=val.substring(0,val.length-1); } }else{ val=""; } return val; }; this.clear_field=function(obj){ var frm=this.form; nam=eval("frm."+obj); nam.value=""; }; } function delObj(sky,_74,obj,q){ if(!q){ q=""; } this.sky=sky; this.action=_74; this.obj=obj; this.process="&qrystr_delete=1&process=d&actn=d"+q; this.mssg="\nAll records associated with this record will be deleted."; this.mssg_sky="You are not allowed to delete this record."; this.delete_record=function(ky,nm,q){ var _7a; var qry=""; var _7c=""; var url=""; if(this.sky>0&&this.sky==ky){ alert(this.mssg_sky); }else{ if(!nm){ nm="This record"; } cnfrm=confirm(nm+" will be deleted from the database."+this.mssg+"\nTo continue press OK. To abort press cancel."); if(cnfrm){ url=new String(this.action); urls=url.split("?"); _7a=new parseSearchString("?"+urls[1]); for(o in _7a){ qry=qry+"&"+o+"="+_7a[o]; } qry=this.obj+"="+ky+qry+this.process+q; document.location.href=urls[0]+"?"+qry; } } }; this.set_message=function(_7e){ this.mssg="\n"+_7e; }; this.set_message_ipermission=function(_7f){ this.mssg_sky=_7f; }; this.set_process=function(_80){ this.process="&"+_80; }; } function disableObj(fld,_82){ this.dfld=fld; this.cnt=0; if(_82){ this.disable=true; }else{ this.disable=false; } this.dfld.disabled=this.disable; this.check_field=function(val){ if(val){ this.cnt++; }else{ this.cnt--; } if(this.cnt>0){ this.disable=false; }else{ this.disable=true; } this.dfld.disabled=this.disable; }; } function disableField(fld,val,_86){ var _87; _87=new disableObj(fld,_86); _87.check_field(val); } function getFormGroup(_88){ return document.getElementsByName(_88); } function getRadio(_89){ elements=getFormGroup(_89); if(elements){ for(i=0;i<elements.length;i++){ if(elements[i].checked){ return elements[i]; } } } return null; } function getRadioValue(_8a){ element=getRadio(_8a); if(element){ return element.value; } return ""; } function isChecked(_8b){ elements=getFormGroup(_8b); if(elements){ for(i=0;i<elements.length;i++){ if(elements[i].checked){ return true; } } } return false; } function getCheck(_8c){ elements=getFormGroup(_8c); checked=new Array(); if(elements){ for(i=0;i<elements.length;i++){ if(elements[i].checked){ checked.append(elements[i]); } } } return checked; } function getCheckValue(_8d){ elements=getCheck(_8d); values=new Array(); if(elements){ for(i=0;i<elements.length;i++){ values.append(elements[i].value); } } return values; } function getSelect(id){ element=document.getElementById(id); selected=new Array(); if(element){ for(i=0;i<element.options.length;i++){ if(element.options[i].selected){ selected[selected.length]=element.options[i]; } } } return selected; } function getSelectValue(id){ options=getSelect(id); values=new Array(); for(i=0;i<options.length;i++){ values[values.length]=options[i].value; } return values; } function compareText(_90,_91){ return _90.text<_91.text?-1:_90.text>_91.text?1:0; } function compareValue(_92,_93){ return _92.value<_93.value?-1:_92.value>_93.value?1:0; } function compareTextAsFloat(_94,_95){ var _96=parseFloat(_94.text); var _97=parseFloat(_95.text); return _96<_97?-1:_96>_97?1:0; } function compareValueAsFloat(_98,_99){ var _9a=parseFloat(_98.value); var _9b=parseFloat(_99.value); return _9a<_9b?-1:_9a>_9b?1:0; } function sortSelect(_9c,_9d){ if(!_9d){ _9d=compareText; } var _9e=new Array(_9c.options.length); for(var i=0;i<_9e.length;i++){ _9e[i]=new Option(_9c.options[i].text,_9c.options[i].value,_9c.options[i].defaultSelected,_9c.options[i].selected); } _9e.sort(_9d); _9c.options.length=0; for(var i=0;i<_9e.length;i++){ _9c.options[i]=_9e[i]; } } function textCounter(_a0,_a1,_a2,_a3,_a4){ var _a5=parseInt(_a0.offsetWidth)-5; var _a6=_a0.value.length; if(_a6>_a2){ _a0.value=_a0.value.substring(0,_a2); }else{ if(_a5<0){ _a5=0; } var _a7=parseInt(100-((_a2-_a6)*100)/_a2); document.getElementById(_a1).style.width=parseInt((_a5*_a7)/100)+"px"; if(_a4){ document.getElementById(_a1).innerHTML="Limit: "+_a7+"%"; } setcolor(document.getElementById(_a1),_a7,"background-color"); } } function setcolor(obj,_a9,_aa){ obj.style[_aa]="rgb(80%,"+(100-_a9)+"%,"+(100-_a9)+"%)"; } function nextFocusWithMaxLength(_ab,_ac,_ad,_ae){ var _af=(navigator.appName=="Netscape")?_ad.which:_ad.keyCode; txtVal=_ac.value; txtName=_ac.name; frmName=_ab.name; tLength=parseInt(_ac.value.length); frmLength=parseInt(document.forms.length); for(p=0;p<frmLength;p++){ if(document.forms[p].name==frmName){ elemntLength=parseInt(document.forms[p].elements.length); for(i=0;i<elemntLength;i++){ if(document.forms[p].elements[i].name==txtName){ for(k=0;k<tLength;k++){ j=i+1; if((_af!=8)&&(_af!=46)){ nxtElmnt=document.forms[p].elements[j].name; if((_ac.value.length==_ae)||(_af==9)||(_af==13)){ document.forms[p][nxtElmnt].focus(); break; } } } } } } } } function syncSelectList(pid,_b1,_b2){ var _b3=document.getElementById(_b1); var _b4=document.getElementById(pid); var _b5=false; if(_b4.selectedIndex>=0){ _b5=_b4.options[_b4.selectedIndex]; } var i; _b4.length=0; for(i=0;i<_b3.options.length;i++){ var no=new Option(); no.value=_b3.options[i].value; no.text=_b3.options[i].text; _b4[i]=no; if(_b2){ if(no.value==_b2){ _b4.selectedIndex=i; } } } } function copyValues(_b8,_b9){ var _ba=document.getElementById(_b8); var _bb=document.getElementById(_b9); _bb.value=_ba.value; } function checkAll(_bc){ for(i=0;i<_bc.length;i++){ _bc[i].checked=true; } } function uncheckAll(_bd){ for(i=0;i<_bd.length;i++){ _bd[i].checked=false; } } function toggleDraftValue(id,_bf){ var obj=jQuery("#"+id); if(_bf=="text"||_bf=="password"||_bf=="spinedit"){ var _c1=obj.val(); var _c2=obj.attr("draft-value"); if(_c2==undefined){ obj.val(""); }else{ obj.val(_c2); } if(_c1==undefined){ obj.attr("draft-value",""); }else{ obj.attr("draft-value",_c1); } var _c3=jQuery("#progressbar"+id); if(_c3.attr("class")=="progress_small"){ _c3.attr("class","progress_small_draft"); }else{ if(_c3.attr("class")=="progress_small_draft"){ _c3.attr("class","progress_small"); }else{ if(_c3.attr("class")=="progress"){ _c3.attr("class","progress_draft"); }else{ if(_c3.attr("class")=="progress_draft"){ _c3.attr("class","progress"); } } } } }else{ if(_bf=="editor"){ var _c4=jQuery("#"+id+"_draft_value"); var _c5=eval("xinha_editors."+id); var _c1=_c5.getHTML(); var _c2=_c4.html(); if(_c2==undefined){ _c5.setHTML(_c5.inwardHtml("")); }else{ _c5.setHTML(_c5.inwardHtml(_c2)); } if(_c1==undefined){ _c4.html(""); }else{ _c4.html(_c1); } }else{ if(_bf=="textarea"){ var _c4=jQuery("#"+id+"_draft_value"); var _c1=obj.html(); var _c2=_c4.html(); if(_c2==undefined){ obj.html(""); }else{ obj.html(_c2); } if(_c1==undefined){ _c4.html(""); }else{ _c4.html(_c1); } var _c3=jQuery("#progressbar"+id); if(_c3.attr("class")=="progress_small"){ _c3.attr("class","progress_small_draft"); }else{ if(_c3.attr("class")=="progress_small_draft"){ _c3.attr("class","progress_small"); }else{ if(_c3.attr("class")=="progress"){ _c3.attr("class","progress_draft"); }else{ if(_c3.attr("class")=="progress_draft"){ _c3.attr("class","progress"); } } } } }else{ if(_bf=="checkbox"||_bf=="radio"){ if(obj.attr("checked")==true){ obj.attr("checked",false); }else{ obj.attr("checked",true); } var _c3=jQuery("#"+id+"_label"); if(_c3.attr("class")=="checkbox-label"){ _c3.attr("class","checkbox-label-draft"); }else{ if(_c3.attr("class")=="checkbox-label-draft"){ _c3.attr("class","checkbox-label"); }else{ if(_c3.attr("class")=="radio-label"){ _c3.attr("class","radio-label-draft"); }else{ if(_c3.attr("class")=="radio-label-draft"){ _c3.attr("class","radio-label"); } } } } }else{ if(_bf=="select"||_bf=="filterlist"||_bf=="picklist"){ var _c6=false; if(obj.attr("multiple")=="true"||obj.attr("multiple")=="multiple"){ _c6=true; } if(_c6){ var _c1=obj.val().join(","); }else{ var _c1=obj.val(); } var _c2=obj.attr("draft-value"); if(_c2==undefined){ obj.val(""); }else{ if(_c6||_c2.indexOf(",")>-1){ obj.val([_c2]); }else{ obj.val(_c2); } } if(_c1==undefined){ obj.attr("draft-value",""); }else{ obj.attr("draft-value",_c1); } var _c3=jQuery("#progressbar"+id); if(_c3.attr("class")=="progress_small"){ _c3.attr("class","progress_small_draft"); }else{ if(_c3.attr("class")=="progress_small_draft"){ _c3.attr("class","progress_small"); }else{ if(_c3.attr("class")=="progress"){ _c3.attr("class","progress_draft"); }else{ if(_c3.attr("class")=="progress_draft"){ _c3.attr("class","progress"); } } } } }else{ if(_bf=="checkbox-group"||_bf=="radio-group"){ var _c6=false; var _c7="radio"; if(_bf=="checkbox-group"){ _c7="checkbox"; } var _c8=obj.find(":"+_c7+":checked"); valar=new Array(); for(var i=0;i<_c8.length;i++){ valar[i]=_c8[i].getAttribute("value"); } var _c2=obj.attr("draft-value"); if(_c2==undefined){ var _c8=obj.find(":"+_c7+":checked"); for(var i=0;i<_c8.length;i++){ valar[i]=_c8[i].setAttribute("checked",false); } }else{ var _ca=_c2.split(","); var _c8=obj.find(":"+_c7); for(var i=0;i<_c8.length;i++){ if(_ca.indexOf(_c8[i].getAttribute("value"))>=0){ _c8[i].setAttribute("checked",true); }else{ _c8[i].removeAttribute("checked"); } } } if(valar.lenth<=0){ obj.attr("draft-value",""); }else{ obj.attr("draft-value",valar.join(",")); } var _c3=jQuery("#"+id+"_label"); if(_c3.attr("class")=="label"){ _c3.attr("class","label-draft"); }else{ if(_c3.attr("class")=="label-draft"){ _c3.attr("class","label"); } } } } } } } } }  ;(function($){ $.fn.addOption=function(){ var _2=function(el,v,t,sO){ var _7=document.createElement("option"); _7.value=v,_7.text=t; var o=el.options; var oL=o.length; if(!el.cache){ el.cache={}; for(var i=0;i<oL;i++){ el.cache[o[i].value]=i; } } if(typeof el.cache[v]=="undefined"){ el.cache[v]=oL; } el.options[el.cache[v]]=_7; if(sO){ _7.selected=true; } }; var a=arguments; if(a.length==0){ return this; } var sO=true; var m=false; var _e,v,t; if(typeof (a[0])=="object"){ m=true; _e=a[0]; } if(a.length>=2){ if(typeof (a[1])=="boolean"){ sO=a[1]; }else{ if(typeof (a[2])=="boolean"){ sO=a[2]; } } if(!m){ v=a[0]; t=a[1]; } } this.each(function(){ if(this.nodeName.toLowerCase()!="select"){ return; } if(m){ for(var _11 in _e){ _2(this,_11,_e[_11],sO); } }else{ _2(this,v,t,sO); } }); return this; }; $.fn.ajaxAddOption=function(url,_13,_14,fn,_16){ if(typeof (url)!="string"){ return this; } if(typeof (_13)!="object"){ _13={}; } if(typeof (_14)!="boolean"){ _14=true; } this.each(function(){ var el=this; $.getJSON(url,_13,function(r){ $(el).addOption(r,_14); if(typeof fn=="function"){ if(typeof _16=="object"){ fn.apply(el,_16); }else{ fn.call(el); } } }); }); return this; }; $.fn.removeOption=function(){ var a=arguments; if(a.length==0){ return this; } var ta=typeof (a[0]); var v,i; if(ta=="string"||ta=="object"||ta=="function"){ v=a[0]; }else{ if(ta=="number"){ i=a[0]; }else{ return this; } } this.each(function(){ if(this.nodeName.toLowerCase()!="select"){ return; } if(this.cache){ this.cache=null; } var _1d=false; var o=this.options; if(!!v){ var oL=o.length; for(var i=oL-1;i>=0;i--){ if(v.constructor==RegExp){ if(o[i].value.match(v)){ _1d=true; } }else{ if(o[i].value==v){ _1d=true; } } if(_1d&&a[1]===true){ _1d=o[i].selected; } if(_1d){ o[i]=null; } _1d=false; } }else{ if(_1d&&a[1]===true){ _1d=o[i].selected; } if(_1d){ this.remove(i); } } }); return this; }; $.fn.sortOptions=function(_21){ var a=typeof (_21)=="undefined"?true:!!_21; this.each(function(){ if(this.nodeName.toLowerCase()!="select"){ return; } var o=this.options; var oL=o.length; var sA=[]; for(var i=0;i<oL;i++){ sA[i]={v:o[i].value,t:o[i].text}; } sA.sort(function(o1,o2){ o1t=o1.t.toLowerCase(),o2t=o2.t.toLowerCase(); if(o1t==o2t){ return 0; } if(a){ return o1t<o2t?-1:1; }else{ return o1t>o2t?-1:1; } }); for(var i=0;i<oL;i++){ o[i].text=sA[i].t; o[i].value=sA[i].v; } }); return this; }; $.fn.selectOptions=function(_29,_2a){ var v=_29; var vT=typeof (_29); var c=_2a||false; if(vT!="string"&&vT!="function"&&vT!="object"){ return this; } this.each(function(){ if(this.nodeName.toLowerCase()!="select"){ return this; } var o=this.options; var oL=o.length; for(var i=0;i<oL;i++){ if(v.constructor==RegExp){ if(o[i].value.match(v)){ o[i].selected=true; }else{ if(c){ o[i].selected=false; } } }else{ if(o[i].value==v){ o[i].selected=true; }else{ if(c){ o[i].selected=false; } } } } }); return this; }; $.fn.copyOptions=function(to,_32){ var w=_32||"selected"; if($(to).size()==0){ return this; } this.each(function(){ if(this.nodeName.toLowerCase()!="select"){ return this; } var o=this.options; var oL=o.length; for(var i=0;i<oL;i++){ if(w=="all"||(w=="selected"&&o[i].selected)){ $(to).addOption(o[i].value,o[i].text); } } }); return this; }; $.fn.containsOption=function(_37,fn){ var _39=false; var v=_37; var vT=typeof (v); var fT=typeof (fn); if(vT!="string"&&vT!="function"&&vT!="object"){ return fT=="function"?this:_39; } this.each(function(){ if(this.nodeName.toLowerCase()!="select"){ return this; } if(_39&&fT!="function"){ return false; } var o=this.options; var oL=o.length; for(var i=0;i<oL;i++){ if(v.constructor==RegExp){ if(o[i].value.match(v)){ _39=true; if(fT=="function"){ fn.call(o[i]); } } }else{ if(o[i].value==v){ _39=true; if(fT=="function"){ fn.call(o[i]); } } } } }); return fT=="function"?this:_39; }; $.fn.selectedValues=function(){ var v=[]; this.find("option:selected").each(function(){ v[v.length]=this.value; }); return v; }; })(jQuery);  ;function displayImageCollection(_1,id,_3,_4){ if(GB_SETS[_1]!=undefined){ return GB_showImageSet(GB_SETS[_1],1); }else{ return GB_showImage(_3,document.getElementById(id).href,_4); } }  function displayImageCollection(_1,id,_3,_4){ if(GB_SETS[_1]!=undefined){ return GB_showImageSet(GB_SETS[_1],1); }else{ return GB_showImage(_3,document.getElementById(id).href,_4); } }  