
function showSubmenu(id){
    if(document.getElementById('submenu_'+id)){
        document.getElementById('mainMenuImg_'+id).src=mainMenuOverImg[id];
        document.getElementById('submenu_'+id).style.display='block';
    }
}
function hideSubmenu(id){
    if(document.getElementById('submenu_'+id)){
        document.getElementById('mainMenuImg_'+id).src=mainMenuImg[id];
        document.getElementById('submenu_'+id).style.display='none';
        
    }
}

function highlightSubmenu(id){

    if(document.getElementById('submenu_li_'+id)){
    
        document.getElementById('submenu_li_'+id).className='menu_li_ul_li_hover';
    }
}
function fadeSubmenu(id){
    if(document.getElementById('submenu_li_'+id)){
    
        document.getElementById('submenu_li_'+id).className='';
        
    }
}




function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

// set the radio button with the given value as being checked
// do nothing if there are no radio buttons
// if the given value does not exist, all the radio buttons
// are reset to unchecked
function setCheckedValue(radioObj, newValue) {
	if(!radioObj)
		return;
	var radioLength = radioObj.length;
	if(radioLength == undefined) {
		radioObj.checked = (radioObj.value == newValue.toString());
		return;
	}
	for(var i = 0; i < radioLength; i++) {
		radioObj[i].checked = false;
		if(radioObj[i].value == newValue.toString()) {
			radioObj[i].checked = true;
		}
	}
}

function setUserStatus(t){
setCheckedValue($('user_status_'+t), t);
}
function checkdate(id) {
    var alert=false;
    var chDate=$F(id);
    var temp=chDate.split("/")
    var start_year=temp[2];
    var start_month=temp[1];
    var start_day=temp[0];
    startDate=new Date();
    nowDate=new Date();
    yearEgo=new Date();
    yearEgo.setYear(yearEgo.getYear()-1);
    if(start_month<1)start_month=1;
    if(start_month>12)start_month=12;

    if(start_month>0){
      if((start_day*1)<1){start_day=1;alert=true;}
      if((start_day*1)>daysInMonth(start_month,start_year)){start_day=daysInMonth(start_month,start_year);alert=true;}
      if(start_year>nowDate.getYear()){start_year=nowDate.getYear();alert=true;}
    }
    if(!startDate.setFullYear( start_year, (start_month - 1), start_day ))alert=true;
    if(startDate>nowDate)alert=true;
    if(startDate<yearEgo)alert=true;
    if(alert)showCalAlert();


}


function changeAuPage(id,page,lang){
  var url='/index.php';
  
  var pars='id='+id+'&au_page='+page+'&L='+lang+'&isajax=au&no_cache=1';

  var myAjax=new Ajax.Request(url,{ method: 'get', parameters: pars, onSuccess: function(t)  {
    document.getElementById('au').innerHTML=t.responseText;
   
  }
  });

}

