 // you must define those vars: FORM_NAME, ROLL_UP_BTN_URL, ROLL_DOWN_BTN_URL
 function showWarning(_name){
    document.getElementById(_name).style.display='';
 }
 function doMainSubmit(){
    document.forms[FORM_NAME].elements['submit_main'].click();
 }
 function doMethod(_method){
    document.forms[FORM_NAME].method.value=_method; doMainSubmit();
 }
 var defaultWinProp='directories=no,location=no,menubar=no,scrollbars=yes,status=yes,toolbar=no,width=1024,height=750,resizable=yes';
 function doMethodNewWin(_method, _winName, _winProp){
    var url = document.forms[FORM_NAME].action+'?method='+_method;
    if (typeof _winProp=='undefined')
      window.open(url, _winName, defaultWinProp);
    else
      window.open(url, _winName, _winProp);
 }
 function rollUpDown(_name){
    var elem = document.getElementById('rolluppanelbody'+_name);
    if (elem.style.display!='none'){
      elem.style.display='none';
      document.images['rollUpBtn'+_name].src=ROLL_UP_BTN_URL;
      document.forms[FORM_NAME].elements[_name+'.panelRolledUp'].value='true';
    } 
    else{
      elem.style.display='';
      document.images['rollUpBtn'+_name].src=ROLL_DOWN_BTN_URL;      
      document.forms[FORM_NAME].elements[_name+'.panelRolledUp'].value='false';
    } 
 }
 function checkRollUp(_name){
    if (document.forms[FORM_NAME].elements[_name+'.panelRolledUp'].value=='true'){  
      document.getElementById('rolluppanelbody'+_name).style.display='none';
      if (typeof document.getElementById('rollUpBtn'+_name)!='undefined')
        document.getElementById('rollUpBtn'+_name).src=ROLL_UP_BTN_URL;
    }    
 }
 function errorShow(_name){
    var elem = document.getElementById('errors'+_name);
    if (elem.style.display!='none'){
      elem.style.display='none';
      elem.style.zIndex=document.getElementById('rolluppanelbody'+_name).style.zIndex-1;
      document.forms[FORM_NAME].elements[_name+'.formErrorsShown'].value='false';
    } 
    else{
      elem.style.display='';
      elem.style.zIndex=document.getElementById('rolluppanelbody'+_name).style.zIndex+1;
      document.forms[FORM_NAME].elements[_name+'.formErrorsShown'].value='true';
    } 
 }