function changeClass(arg, clsName) {
	document.getElementById(arg).className = clsName;
}
function changeImg(arg, imgSrc) {
	document.getElementById(arg).src = imgSrc;
}  

// ======================  DATES    ======================
function numeralsOnly(evt) {
    evt = (evt) ? evt : event;
    var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode :
        ((evt.which) ? evt.which : 0));
    if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        return false;
    }
    return true;
}
function isEmpty( fld ) {
  myRe=/^\s+|\s+$/g;
  if(fld.value.replace( myRe, '') == ''){
  	return true;
  }
  return false;
}
function checkDay(day) {
  if(!isEmpty( day )) {
   if(day.value < 1) day.value = '01';
   if(day.value > 31) day.value = '31';
   if((day.value >0) && (day.value<10) && (day.value.length == 1)) day.value = '0' + day.value;   
  }
}
function checkMonth(month){
  if(!isEmpty( month )){
   if(month.value < 1) month.value = 1;
   if(month.value > 12) month.value = 12;
   if((month.value >0) && (month.value<10) && (month.value.length == 1)) month.value = '0' + month.value;
  }
}
function checkYear(year){
  var now = new Date();
  if(!isEmpty( year )){
   if(year.value < 1900) year.value = now.getFullYear();
   if(year.value > 2050) year.value = now.getFullYear();
  }
}
// ==============================================================

function showhide(arg)
{
if (document.getElementById(arg).style.display == "none")
	{document.getElementById(arg).style.display = "block";}
else
	{document.getElementById(arg).style.display = "none";}
}

