function alphanumeric(alphane)
{
	var numaric = alphane;
	for(var j=0; j<numaric.length; j++)
	{
		  var alphaa = numaric.charAt(j);
		  var hh = alphaa.charCodeAt(0);
		  if((hh > 47 && hh<59) || (hh > 64 && hh<91) || (hh > 96 && hh<123))
		  {
		  }
		  else
		  {
			 return false;
		  }
	}
 return true;
}

function validateEmail(objVal)
{
    try
    {
        objVal = Trim(objVal);
        var myReg = /\w+([-+.\']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
        
        if(! myReg.test(objVal))
        {
            alert("email is not valid!!");
            return false;
        }
        else
        {
            if(objVal.indexOf("@")!= objVal.lastIndexOf("@"))
			{
				alert("email is not valid!!");                    
				return false;
			}  
			else
				return true;
        }
        
    }
    catch(e){alert(e.message); return false;}
}

function Trim(TRIM_VALUE)
{
	if(TRIM_VALUE.length < 1)
	{
		return "";
	}
	TRIM_VALUE = RTrim(TRIM_VALUE);
	TRIM_VALUE = LTrim(TRIM_VALUE);
	if(TRIM_VALUE=="")
	{
		return "";
	}
	else
	{
		return TRIM_VALUE;
	}
} //End Function

function RTrim(VALUE)
{
	var w_space = String.fromCharCode(32);
	var v_length = VALUE.length;
	var strTemp = "";
	if(v_length < 0)
	{
		return "";
	}
	var iTemp = v_length -1;
	while(iTemp > -1)
	{
		if(VALUE.charAt(iTemp) == w_space)
		{
		}
		else
		{
			strTemp = VALUE.substring(0,iTemp +1);
			break;
		}
		iTemp = iTemp-1;
	} //End While
	return strTemp;
} //End Function

function LTrim(VALUE)
{
	var w_space = String.fromCharCode(32);
	if(v_length < 1)
	{
		return "";
	}
	var v_length = VALUE.length;
	var strTemp = "";
	var iTemp = 0;
	while(iTemp < v_length)
	{
		if(VALUE.charAt(iTemp) == w_space)
		{
		}
		else
		{
			strTemp = VALUE.substring(iTemp,v_length);
			break;
		}
		iTemp = iTemp + 1;
	} //End While
	return strTemp;
} //End Function
