function strTrim(tmpStr)
{
	var i;
	for (i=0; i < tmpStr.length; ++i)
		if (tmpStr.charAt(i) != " ") break;
	tmpStr = tmpStr.substring(i);
	for (i=tmpStr.length - 1; i >= 0; --i)
		if (tmpStr.charAt(i) != " ") break;
	tmpStr = tmpStr.substring(0, i + 1);
	return tmpStr;
}

function chkEmail(tmpStr)
{
	var i;
	var posAt = 0;
	var posDot = 0
	var count = 0;
	for(i=0;i<tmpStr.length;++i)
	{
		if(tmpStr.charAt(i) == "@")
		{
			posAt = i;
			count++;
		}
		if(tmpStr.charAt(i) == ".")
		{
			posDot = i;
		}
		if (!((tmpStr.charAt(i) >= "0" && tmpStr.charAt(i) <= "9")
				||(tmpStr.charAt(i) >= "a" && tmpStr.charAt(i) <= "z")
				|| (tmpStr.charAt(i)>= "A" && tmpStr.charAt(i) <= "Z")
				|| (tmpStr.charAt(i) == "-")
				|| (tmpStr.charAt(i) == "_")
				|| (tmpStr.charAt(i) == "@")
				|| (tmpStr.charAt(i) == ".")
			)) return false;
	}
	if(count>1) return false;
	if(eval(posAt) > 1 && posAt != tmpStr.length-1 && posDot > posAt && posDot != tmpStr.length-1) return true;
	return false;
}
function signup()
{
	if(chkEmail(obj.signEmail.value)==false)
	{
		alert("Please Enter valid Email. ");
		obj.signEmail.focus();
		return false;
	}
	obj.action = "orissa_news.php?opt=add";
	obj.submit();
}
