function isNotDate(inStr)
{
	if (inStr != "")
	{
	var yr_value, mth_value, dy_value;

	if (inStr.length > 10 || inStr.length < 8)
	{
		//alert("Invalid Date Format!");
		return true;
	}
	
	yr_value = inStr.substring(0, 4);
	temp1 = inStr.substring(4, 5);
	temp2 = inStr.indexOf("/", 5);
	mth_value = inStr.substring(5, temp2);
	temp2 = temp2 + 1;
	dy_value = inStr.substring(temp2, inStr.length);

	if (temp1 != "/" || temp2 == -1 || temp2 == 6 || temp2 > 8)
	{
		//alert("Invalid Date Format!");
		return true;
	}

	if (isNaN(yr_value))
	{
		//alert("Year must be Numeric!");
		return true;
	}
	if (isNaN(mth_value))
	{
		//alert("Month must be Numeric!");
		return true;
	}
	if (isNaN(dy_value))
	{
		//alert("Day must be Numeric!");
		return true;
	}

	if (yr_value < 1900)
	{
		//alert("Invalid Year!");
  		return true;
	}	
	if (mth_value < 1 || mth_value > 12)
	{
		//alert("Invalid Month!");
  		return true;
	}
	if (dy_value < 1 || dy_value > 31)
	{
		//alert("Invalid Day!");
  		return true;
	}
	
	if ((mth_value == 4 || mth_value == 6 || mth_value == 9 || mth_value == 11) && (dy_value > 30))
	{
		//alert("Invalid Date!");
  		return true;
	}
	if (((mth_value == 2) && leapYear(yr_value)) && (dy_value > 29))
	{
		//alert("Invalid Date!");
  		return true;
	}
	if (((mth_value == 2) && !(leapYear(yr_value))) && (dy_value>28))
	{
		//alert("Invalid Date!");
  		return true;
	}
	}
}

function leapYear(yr)
{
 	if (((yr % 4 == 0) && yr % 100 != 0) || yr % 400 == 0)
  		return true;
 	else
  		return false;
}

function StripSpaces(newstr)
{
	while (newstr.substring(0,1) == " ")
		newstr = newstr.substring(1);
	
	while (newstr.substring(newstr.length-1,newstr.length) == " ")
		newstr = newstr.substring(0,newstr.length-1);

	return newstr;
}

function CheckEmail(pObj)
{
	var invalidaddress=new Array()
	//invalidaddress[0]="hotmail"
	//invalidaddress[1]="rocketmail"
	//invalidaddress[2]="yahoo"
	//invalidaddress[3]="zdnetmail"
	//extend or shorten this list if neccessary
	var testresults
	var invalidcheck = 0;
	var str = pObj
	var filter = /^.+@.+\..{2,3}$/
	if (filter.test(str)) {
		var tempstring = str.split("@")
		tempstring = tempstring[1].split(".")
		for (i=0; i<invalidaddress.length; i++) {
			if (tempstring[0] == invalidaddress[i])
				invalidcheck = 1
		}
		if (invalidcheck != 1) {
			testresults = true
		} else {
			testresults = false
		}
	} else {
		testresults = false
	}
	return (testresults)
}
