function show(elem_id)
{
  document.getElementById(elem_id).style.visibility = 'visible';
}

function hide(elem_id)
{
  document.getElementById(elem_id).style.visibility = 'hidden';
}


function js_confirm (msg, txt)
{
  return confirm(msg+"\n"+txt);
}

function ValidateUserName(theinput)
{
	s=theinput.value
	if(s.length<5)
		return false
	else
		return true
}


function ValidatePassword(theinput)
{
	s=theinput.value
	if(s.length<6)
		return false
	else
		return true
}

function ValidateDate(strDay, strMonth, strYear) {
var monthDay = new Array(12);
var leapYear=false;

monthDay[0] = 31;
monthDay[1] = 28;
monthDay[2] = 31;
monthDay[3] = 30;
monthDay[4] = 31;
monthDay[5] = 30;
monthDay[6] = 31;
monthDay[7] = 31;
monthDay[8] = 30;
monthDay[9] = 31;
monthDay[10] = 30;
monthDay[11] = 31;


if (strYear.length == 2)
    strYear = '20' + strYear;

intDay = parseInt(strDay, 10);
intMonth = parseInt(strMonth, 10);
intYear = parseInt(strYear, 10);

if (isNaN(intDay) || isNaN(intMonth) || isNaN(intYear)) 
   return false;

if (intYear % 100 == 0) {
if (intYear % 400 == 0) { leadYear=true; }
}
else {
if ((intYear % 4) == 0) { leapYear=true; }
}

if (leapYear==true) monthDay[1]++;

if ((intMonth < 1) || (intMonth > 12)) return false;
if ((intDay < 1) || (intDay > monthDay[intMonth-1])) return false;
if ((intYear < 1900) || (intYear > 2100)) return false;

return true;

}
