function isEmpty(s)
{
	var i;
	if((s == null) || (s.length == 0))
	return true;
	for (i = 0; i < s.length; i++)
	{
	var c = s.charAt(i);
	if (whitespace.indexOf(c) == -1)
	return false;
	}
	return true;
}

function isEmail(field)
{
	var s = field.value;
	if (isEmpty(s))
	{
	alert("Please specify Your E-mail");
	field.focus();
	return false;
	}
	return true;
}

function validEmail(field)
{
	var positionOfAt;
	var s = field.value;
	positionOfAt = s.indexOf('@',1);
	if ( ( positionOfAt == -1) || (positionOfAt == (s.length-1)) )
	{
	alert("Invalid E-mail Format");
	field.focus();
	return false;
	}
	return true;
}


function isSelected(field)
{
	var s = field.value;
	if (s == '' || s == null || isNaN(s))
	{
	alert("Please select the Batch / Branch");
	field.focus();
	return false;
	}
	return true;
}

function TestFileType( fileName, fileTypes ) 
{
	if (!fileName) return;

	dots = fileName.split(".")
	//get the part AFTER the LAST period.
	fileType = "." + dots[dots.length-1];

	if (fileTypes.join(".").indexOf(fileType.toLowerCase()) != -1)
	{
		return true;
	}
	return false;
}