function Elmnt(id){return document.all?document.all[id]:document.getElementById(id);}function IsIE(){return navigator.userAgent.indexOf('MSIE')>-1;}function NewWindow(mypage,myname,w,h,scroll,f_menubar){var winl=(screen.width-w)/2;
var wint=(screen.height-h)/2;winprops='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=1';if(f_menubar){winprops+=',menubar=1';}win=window.open(mypage,myname,winprops);try{if(win&&win.window&&win.window.focus){
win.window.focus();}}catch(err){}try{if(win&&win.focus){win.focus();}}catch(err){}}function TrimStr(s){var m=s.match(/^\s*(\S+(\s+\S+)*)\s*$/);return(m==null)?"":m[1];}function empty(s){if(s==null){return true;}var m=s.match(/^\s*(\S+(\s+\S+)*)\s*$/);
return m==null;}function strHeadEqu(s,t){if(t==null){return false;}if(s==null){return false;}s=''+s;t=''+t;var len_t=t.length;if(len_t==0){return true;}if(len_t>s.length){return false;}var i=0;for(i=0;i<len_t;i=i+1){if(t.charAt(i)!=s.charAt(i)){
return false;}}return true;}function strContains(s,t){if(t==null){return false;}if(s==null){return false;}s=''+s;t=''+t;var len_t=t.length;if(len_t==0){return true;}if(len_t>s.length){return false;}var i=s.indexOf(t);return i>=0;}function NA_Fill(field){
if(!Elmnt(field))return;var value=Elmnt(field).value;if(empty(value)){Elmnt(field).value='N/A';}}function NA_UnFill(field){if(!Elmnt(field))return;var value=Elmnt(field).value;if(TrimStr(value)=='N/A'){Elmnt(field).value='';}}
function ShowElmnt(field,fShow){if(!Elmnt(field))return;if(!Elmnt(field).style)return;Elmnt(field).style.display=(fShow?'':'none');}function ElmntShown(field){var elt=Elmnt(field);if(!elt)return false;if(!elt.style)return false;
return elt.style.display=='';}function SetElmntChecked(field,fChecked){if(!Elmnt(field))return;Elmnt(field).checked=fChecked;}function ElmntIsChecked(field){if(!Elmnt(field))return false;return Elmnt(field).checked;}function SetElmntInnerHTML(field,val){
if(!Elmnt(field))return false;Elmnt(field).innerHTML=val;}function SetElmntZeroSelected(field){if(!Elmnt(field))return;if(Elmnt(field).options&&Elmnt(field).options.length){Elmnt(field)[0].selected=true;}}function unCheckRadio(oRadio){var or=null;
if(document.getElementsByName){or=document.getElementsByName(oRadio);}if(!or&&document.app&&document.app.oRadio){or=document.app.oRadio;}if(!or&&document.the_form&&document.the_form.oRadio){or=document.the_form.oRadio;}if(!or)return;
for(var i=0;i<or.length;i++){or[i].checked=false;}}function checkRadio(oRadio,index){var or=null;if(document.getElementsByName){or=document.getElementsByName(oRadio);}if(!or&&document.app&&document.app.oRadio){or=document.app.oRadio;}
if(!or&&document.the_form&&document.the_form.oRadio){or=document.the_form.oRadio;}if(!or)return;for(var i=0;i<or.length;i++){or[i].checked=(i==index);}}function ShowDiv(div_name,fShow){if(Elmnt(div_name)&&Elmnt(div_name).style
&&Elmnt(div_name).style.visibility){var zIndex=Elmnt(div_name).style.zIndex;zIndex=parseInt(zIndex);if(fShow&&zIndex<0||!fShow&&zIndex>0){Elmnt(div_name).style.zIndex=0-zIndex;}Elmnt(div_name).style.visibility=(fShow?"visible":"hidden");}
else if(!fShow&&Elmnt(div_name)&&Elmnt(div_name).style){var zIndex=Elmnt(div_name).style.zIndex;zIndex=parseInt(zIndex);if(zIndex>0){Elmnt(div_name).style.zIndex=0-zIndex;}Elmnt(div_name).style.visibility="hidden";}}function DivIsVisible(div_name){
if(!Elmnt(div_name)){return false;}if(Elmnt(div_name)&&Elmnt(div_name).style&&Elmnt(div_name).style.visibility){return Elmnt(div_name).style.visibility !="hidden";}return true;}function ElmntVal(id){var elmt=Elmnt(id);
return(elmt&&elmt.value)?elmt.value:null;}function SetElmntVal(id,val){var elmt=Elmnt(id);if(elmt){elmt.value=val;}}function ParseDate(strFormat,strDate){var arrRet=new Array();arrRet['day']=null;arrRet['month']=null;arrRet['year']=null;
if(strDate==null||empty(strDate)){return arrRet;}if(strFormat==null||empty(strFormat)){return arrRet;}switch(strFormat){case"MM/DD/YYYY":var m=strDate.match(/^(\d\d)\/(\d\d)\/(\d\d\d\d)$/);if(m !=null){arrRet['month']=m[1];arrRet['day']=m[2];
arrRet['year']=m[3];}break;case"MM/DD/YY":var m=strDate.match(/^(\d\d)\/(\d\d)\/(\d\d)$/);if(m !=null){arrRet['month']=m[1];arrRet['day']=m[2];arrRet['year']=m[3];}break;case"MM-DD-YYYY":var m=strDate.match(/^(\d\d)-(\d\d)-(\d\d\d\d)$/);if(m !=null){
arrRet['month']=m[1];arrRet['day']=m[2];arrRet['year']=m[3];}break;case"YYYY-MM-DD":var m=strDate.match(/^(\d\d\d\d)-(\d\d)-(\d\d)$/);if(m !=null){arrRet['year']=m[1];arrRet['month']=m[2];arrRet['day']=m[3];}break;case"MM-DD-YY":
var m=strDate.match(/^(\d\d)-(\d\d)-(\d\d)$/);if(m !=null){arrRet['month']=m[1];arrRet['day']=m[2];arrRet['year']=m[3];}break;case"DD/MM/YYYY":var m=strDate.match(/^(\d\d)\/(\d\d)\/(\d\d\d\d)$/);if(m !=null){arrRet['day']=m[1];arrRet['month']=m[2];
arrRet['year']=m[3];}break;case"DD/MM/YY":var m=strDate.match(/^(\d\d)\/(\d\d)\/(\d\d)$/);if(m !=null){arrRet['day']=m[1];arrRet['month']=m[2];arrRet['year']=m[3];}break;case"DD-MM-YYYY":var m=strDate.match(/^(\d\d)-(\d\d)-(\d\d\d\d)$/);if(m !=null){
arrRet['day']=m[1];arrRet['month']=m[2];arrRet['year']=m[3];}break;case"DD-MM-YY":var m=strDate.match(/^(\d\d)-(\d\d)-(\d\d)$/);if(m !=null){arrRet['day']=m[1];arrRet['month']=m[2];arrRet['year']=m[3];}break;default:break;}return arrRet;}
function getY_again(obj){if(obj){return(obj.offsetParent==null?obj.offsetTop:obj.offsetTop+getY_again(obj.offsetParent));}}function getX_again(obj){if(obj){return(obj.offsetParent==null?obj.offsetLeft:obj.offsetLeft+getX_again(obj.offsetParent));}}
function moveElmnt(id,Xpos,Ypos){if(!Elmnt(id)){return;}if(isNaN(Xpos)){Xpos=parseInt(Xpos);}if(isNaN(Ypos)){Ypos=parseInt(Ypos);}var moveX=!isNaN(Xpos)&&!empty(''+Xpos);var moveY=!isNaN(Ypos)&&!empty(''+Ypos);if(Elmnt(id).top){
if(moveX){Elmnt(id).left=Xpos+"px";}if(moveY){Elmnt(id).top=Ypos+"px";}}else if(Elmnt(id).style&&Elmnt(id).style.top){if(moveX){Elmnt(id).style.left=Xpos+"px";}if(moveY){Elmnt(id).style.top=Ypos+"px";}}}function var_dump(obj){if(typeof obj=="object"){
return"Type: "+typeof(obj)+((obj.constructor)?"\nConstructor: "+obj.constructor:"")+"\nValue: "+obj;}else{return"Type: "+typeof(obj)+"\nValue: "+obj;}}function getObject(objName){if(window.document[objName]){return window.document[objName];}
if(navigator.appName.indexOf("Microsoft Internet")==-1){if(document.embeds&&document.embeds[objName]){return document.embeds[objName];}}return Elmnt(objName);}function Focus(id){var elt=Elmnt(id);if(elt&&elt.focus){elt.focus();}}function currTime(){
var d=new Date();return d.getTime();}function SafePWOC(){if(PleaseWaitWaiting()){return false;}if(haveProcessingRequestSetUp()){ShowPleaseWait();}return true;}function haveProcessingRequestSetUp(){if('function'==typeof window.ShowPleaseWait
&&'function'==typeof window.Waiting){return true;}return false;}function PleaseWaitWaiting(){if(!haveProcessingRequestSetUp()){return false;}if('function'==typeof window.Waiting){return window.Waiting();}return false;}var g_button_just_pressed=false;
var g_reset_button_just_pressed_timeout_id=-1;var g_last_reset_button_just_pressed_delay=0;function resetButtonJustPressed(){g_button_just_pressed=false;if(g_reset_button_just_pressed_timeout_id !=-1){clearTimeout(g_reset_button_just_pressed_timeout_id);}
g_reset_button_just_pressed_timeout_id=-1;}function resetButtonJustPressedAfterDelay(){var millisecs_delay=null;if(arguments.length>1){alert('arguments.callee.toString():'+arguments.length);}if(arguments.length==1){millisecs_delay=arguments[0];}
if(isNaN(millisecs_delay)||millisecs_delay<0||millisecs_delay==null){millisecs_delay=500;}if(millisecs_delay==0){resetButtonJustPressed();g_last_reset_button_just_pressed_delay=0;return;}if(g_reset_button_just_pressed_timeout_id !=-1){
if(millisecs_delay>=g_last_reset_button_just_pressed_delay){g_last_reset_button_just_pressed_delay=millisecs_delay;return;}clearTimeout(g_reset_button_just_pressed_timeout_id);}g_reset_button_just_pressed_timeout_id=
setTimeout('resetButtonJustPressed();',millisecs_delay);g_last_reset_button_just_pressed_delay=millisecs_delay;}function allowButtonPress(){var millisecs_delay=null;if(arguments.length>1){alert('allowButtonPress:'+arguments.length);}
if(arguments.length==1){millisecs_delay=arguments[0];}if(isNaN(millisecs_delay)||millisecs_delay<0||millisecs_delay==null){millisecs_delay=500;}if(g_button_just_pressed){return false;}g_button_just_pressed=true;
resetButtonJustPressedAfterDelay(millisecs_delay);return true;}function allowSubmitBtnPress(){if(haveProcessingRequestSetUp()){if(PleaseWaitWaiting()){return false;}ShowPleaseWait();return true;}if(!allowButtonPress(1000*5)){return false;}return true;}