function checkemail(str, notify) {
		var at="@";
		var dot=".";
		var lstr=str.length;
		var lat=str.indexOf(at);
		var ldot=str.indexOf(dot);
		if (lat==-1 || lat==0 || lat==lstr-1){
			if (notify!=null && notify=='Y'){
			 alert("Invalid email address, please enter a valid email address to proceed");
			}
		   return false;
		}

		if (ldot==-1 || ldot==0 || ldot==lstr-1){
			if (notify!=null && notify=='Y'){
			 alert("Invalid email address, please enter a valid email address to proceed");
			}
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){
			if (notify!=null && notify=='Y'){
			 alert("Invalid email address, please enter a valid email address to proceed");
			}
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
			if (notify!=null && notify=='Y'){
			 alert("Invalid email address, please enter a valid email address to proceed");
			}
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
			if (notify!=null && notify=='Y'){
			 alert("Invalid email address, please enter a valid email address to proceed");
			}
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1){
			if (notify!=null && notify=='Y'){
			 alert("Invalid email address, please enter a valid email address to proceed");
			}
		    return false;
		 }

 		 return true;					
	}


function checkPwd(str, notify)
{
	var result = true;
	var charset = ".,<>;:'/?[]{}|\=+-+`~!@#$%^&*()<>_";
	for (var i=0;i<str.length;i++)
		if (charset.indexOf(str.substr(i,1))>=0)
		{
			result = false;
			break;
		}
	if (result==false && notify!=null && notify=='Y'){
		 alert("Invalid password, valid characters are numbers and letters only.");
	}
	
	return result;
}
