
function validate()
{
var emailID=document.logon.username
		if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}


if (document.logon.username.value.length == 0)
  {
  alert("Please enter your E-mail Address");
  document.logon.username.focus();
		return false;
 	}
else
	{
	if (document.logon.passwd.value.length == 0)
	  {
	  alert("Please enter your Contact ID");
	  document.logon.passwd.focus();
			return false;
 	}
 	else
	 	{
		if (isNaN (document.logon.passwd.value))
	    {
	     alert("Your Contact ID must be Numeric.");
	     document.logon.passwd.focus();
		    	return false;
 	     }
		else
		{
	 	 document.logon.action="SynLoginSum.asp"
		 document.logon.submit();
	     }
}
}
}

function validatee()
{
if (document.emailme.username.value.length == 0)
  {
  alert("Please enter your username");
  document.emailme.username.focus();
		return false;
 	}
else
		return true;
}

function email()
{
  if (validatee())
  {
		    document.emailme.action="SynMailID.asp"
		    document.emailme.submit();
  }
}
// Calendar

n = new Date();
d = new Date();
i = new Date();
year = new Date();
n = n.getDate();
d = d.getDay();
i = i.getMonth();
year = year.getYear();

var mydate = Date();
var length = mydate.length;
var myYear = mydate.substring(length-4, length);

month = new Array();
month[0] = "January";
month[1] = "February";
month[2] = "March";
month[3] = "April";
month[4] = "May";
month[5] = "June";
month[6] = "July";
month[7] = "August";
month[8] = "September";
month[9] = "October";
month[10] = "November";
month[11] = "December";

day = new Array();
day[0] = "Sunday";
day[1] = "Monday";
day[2] = "Tuesday";
day[3] = "Wednesday";
day[4] = "Thursday";
day[5] = "Friday";
day[6] = "Saturday";
// Calendar over


function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true
	}
