


function checkList(listObj)
{ 
	document.getElementById('tempSubmit').click();
}




//remove the preceeding and ending spaces from a string.
function trimStr(str)
{
	var i, pBegin, pEnd, strTemp
 	//find the preceeding spaces
 	for (i = 0 ; i < String(str).length; i++)
 	{
		if (String(str).charAt(i) != " ")
		{
			pBegin = i;
	 		break;
		}
 	}
 
 	//find ending spaces
 	for (i = String(str).length -1; i >= 0; i--)
 	{
		if (String(str).charAt(i) != " ")
		{
			pEnd = i;
	 		break;
		} 
	}
 
 	//the new string.
 	strTemp = String(str).substr(pBegin, pEnd - pBegin +1 );
 	return (strTemp);
}

//FUNCTION TO VALIDATE EMAIL
function validateEmail(email)
{
//a valid email would have only one @ and one . after the @ in the string and a value before and after @ and .
	var iAtF = 0;
 	var iDotF = 0;
 	var iDotL = 0;
 	var iSpace = 0;
 	var iStrLength = 0; //for length of string

 	iAtF = String(email).indexOf("@");
 	iAtL = String(email).lastIndexOf("@");
 	if (iAtF < 1 )
		return (false);
 	if (iAtF != iAtL)
		return(false);
	
 	iDotL = String(email).lastIndexOf(".");
 	if (iDotL < iAtF + 2)
		return(false);

 	iSpace = String(email).indexOf(" ");
	 if (iSpace > 0 )
		return(false);

 	iStrLength = String(email).length;
 	if(iDotL==iStrLength-1 ||iDotL==iStrLength-2) 
		return(false);
		
	 return(true);
}

