function isDateValid(datein)
{
	var indate=datein;
	
	if (indate.length != 10) return false;
	else{
	
        if (indate.indexOf('-')!=-1)
			var sdate = indate.split('-')
		else
			var sdate = indate.split('/')

		if(Math.abs(sdate[2])<20)
			sdate[2] = Math.abs(sdate[2]) + 2000;
		if(Math.abs(sdate[2])>20 && Math.abs(sdate[2])<100 )
			sdate[2] = Math.abs(sdate[2]) + 1900;
			
        var chkDate=new Date();
		chkDate.setDate(Math.abs(sdate[0]));
		chkDate.setMonth(Math.abs(sdate[1])-1);
		chkDate.setYear(Math.abs(sdate[2]));

		if (Math.abs(sdate[2]) <= 1900) return false;
		
		var checkedYear = chkDate.getYear();
		if (chkDate.getYear() < 200)
			checkedYear = chkDate.getYear() + 1900;
		
        var cmpDate=(chkDate.getMonth()+1)+'/'+(chkDate.getDate())+'/'+(checkedYear)
        var indate2=(Math.abs(sdate[1]))+'/'+(Math.abs(sdate[0]))+'/'+(Math.abs(sdate[2]))
		if (indate2!=cmpDate)
			return false;
        else 
		{
			if (cmpDate=='NaN/NaN/NaN')
				return false;
			else 
				return true;
        }
		return false;
	}
}

function checkmail(mail)
{
      st = mail;
	  if(st.length < 7) return false;
      if(st.indexOf("@") <= 0) return false;
      if(st.indexOf(".") <= 0) return false;
      if(st.indexOf(" ") > 0)return false;
      if(st.indexOf("@.") >= 0) return false;
     return true;
}
