	/******* Code by Zaheer Hussain **********/

	function isAlphabet(myString)
	{		
		myString = myString.toUpperCase();
		var MyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
		for (i=0; i<myString.length; i++) 
		{
			var MyChar = myString.substring(i,i+1);
			if (MyStr.indexOf(MyChar) == -1) 
			{
				return false;
			}
		}
		return true;
	} // end 

	
	function isAllSpaces(myStr){
		while (myStr.substring(0, 1) == " ") {
			myStr = myStr.substring(1, myStr.length);
		}
	
		if(myStr == ""){
			return true;
		}
		return false;
	} // end fn isAllSpaces
	
	function isValidDate(year, month, day){
		myDate = new Date(month + "/" + day + "/" + year);
		if(parseInt(myDate.getDate()) != parseInt(day)){
		return false;
		}
		else
			return true;
	} // end fn isValidDate



	
	function isValidTime(sy, sm, sd, shh, smm, sampm, ey, em, ed, ehh, emm, eampm){
		if(sampm == "pm")
			shh = shh + 12;
			
		if(eampm == "pm")
			ehh = ehh + 12;
			
		myStartTime = new Date(sy, sm, sd, shh, smm, 00);
		myEndTime =   new Date(ey, em, ed, shh, smm, 00);
		
		if(Date.parse(myStartTime) < Date.parse(myEndTime)){
			return false;
		}
		
		return true;
		
	}//end fn isValidTime
		
/*	function isValidTime(myTimeField) {
		timeValue = myTimeField.value.toUpperCase();
		timeValue = ReplaceText(timeValue," ","");
		if(timeValue.indexOf("PM") != -1 || timeValue.indexOf("AM") != -1){
			//mTime = timeValue.substring(0,timeValue.length-2);
			//ampm = timeValue.substring(timeValue.length -2, timeValue.length);
			//timeValue = mTime + " " + ampm
			timeValue=ReplaceText(timeValue,"PM"," PM")
			timeValue=ReplaceText(timeValue,"AM"," AM")
		}
		myTime = new Date("12/12/2000 " + timeValue)
		if (myTime == "NaN" || myTime == "Invalid Date"){
			alert("Not a valid time. (Use hh:mm AM)");
			myTimeField.focus();
			return false;
		}
		return timeValue;
	} // end fn isValidTime	
*/

function isSpecialChar(myString){
		var MyStr = '<>;/\\*&^%$#!"~+=:;,?';
		for (i=0; i<myString.length; i++) {
			var MyChar = myString.substring(i,i+1);
			if (MyStr.indexOf(MyChar) != -1) {
				return true;
			}
		}
		return false;
	} // end fn isSpecialChar

function isEmail(s){
	if(s.length == 0)
		return false;
	if	(	(s.indexOf("@") <= 0) || 
			(s.indexOf("@") == s.length -1) || 
			(s.indexOf("@") != s.lastIndexOf("@")) || 
			(s.indexOf(".") <= 0) || 
			(s.indexOf(" ") > -1) || 
			(s.lastIndexOf(".") == s.length -1) ||
			(s.lastIndexOf(".") < s.indexOf("@")) ||
			(s.indexOf("..") != -1) ||
			(isSpecialChar(s)) ||
			(s.charAt(s.indexOf("@") + 1) == ".") ||
			(s.charAt(s.indexOf("@") - 1) == ".")			
		) return false;
	else return true;
} //end fn isEmail
function checkForNums(theForm)
	{
		var nfound = 0;
		var alphas = " .ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()-+`~,";
		var myValue = theForm.value.toUpperCase();
		for(count=0;count<= myValue.length-1;count++)
			{
			if (alphas.indexOf(myValue.substring(count, count+1)) == -1)
				{
				//alert(alphas.indexOf(myValue.substring(count, count+1));
				nfound++;
				}
			}
		return nfound;
	}
	
function CheckAlphas(mValue)
	{
		var notFound=0;
		var n="0123456789";
		for (c=0; c<=mValue.length-1; c++)
			{
			if (n.indexOf(mValue.substring(c,c+1)) == -1)
				notFound++;
			}
		return notFound;
		}

function isInt(myString){		
	var MyStr = "0123456789";
	for (i=0; i<myString.length; i++){
		var MyChar = myString.substring(i,i+1);
		if (MyStr.indexOf(MyChar) == -1){
			return false;
		}
	}
	return true;
}

function isFloat(myString){		
	var MyStr = "0123456789.";
	decimal = false;
	for (i=0; i<myString.length; i++){
		var MyChar = myString.substring(i,i+1);
		if (MyStr.indexOf(MyChar) == -1 || (MyChar == "." && decimal == true)){
			return false;
		}
		if(MyChar == ".")
			decimal = true;
	}
	return true;
}
function checkWordLen(val,limit)
{
	if(val.length > 0)
	{
		arrString = val.split(" ");
		for(var i=0; i<arrString.length; i++)
		{
			if (arrString[i].length >limit)
			{
				return true;
				break;
			}
			else
			{
				return false;	
			}
		}
	}
	else
	{
		return false;
	}
}	
			
