function IsEmpty(obj, obj_type)
{
	if (obj_type == "text" || obj_type == "password" || obj_type == "textarea" || obj_type == "file")	
	{
		var objValue;
		objValue = obj.value.replace(/\s+$/,"");
		if (objValue.length == 0) 
		{
			return true;
		} 
		else 
		{
			return false;
		}
	}
	else if (obj_type == "select" || obj_type == "select-one") 
	{
		for (i=0; i < obj.length; i++) 
		{
			if (obj.options[i].selected) 
				{
					if(obj.options[i].value==" ") 
					{
						return true;obj.focus();} else {return false;
					}
					
					if(obj.options[i].value == "0") 
					{
						if(obj.options[i].seletedIndex == "0") 
						{return true;obj.focus();}
					} else {return false;}
				}
			
		}
		return true;	
	}
	else if (obj_type == "radio" || obj_type == "checkbox")
	{
		if (!obj[0] && obj)
		{
			if (obj.checked)
			{
				return false;
			} 
			else 
			{
				return true;	
			}
		}
		else 
		{
			for (i=0; i < obj.length; i++) 
			{
				if (obj[i].checked)
				{
					return false;
				}
			}
			return true;
		}
	} 
	else
	{
		return false;
	}
}

function CompareValue( NumStr, pattern )
{
	for( var Idx = 0; Idx < NumStr.length; Idx ++ )
	{
		 var Char = NumStr.charAt( Idx );
		 var Match = false;

		for( var Idx1 = 0; Idx1 < pattern.length; Idx1 ++)
		{
		 if( Char == pattern.charAt( Idx1 ) )
		 Match = true;
		}
		if ( !Match )
		return false;
 	}
   	return true;
}

function ValidateEmail(Email)
{
	var funRegExp	      = new RegExp("^[A-Za-z0-9][A-Za-z0-9_\\.\-]*\\@[a-zA-Z0-9\-]+\\.[a-zA-Z]+[\\.]?[a-zA-Z]*$");
	if (!Email.match(funRegExp)) { return false; }//if
	return true;
}

function enterfiled(rowid)
{
	document.getElementById(rowid).className="rowcolor";
}

function onexit(rowid)
{
	document.getElementById(rowid).className="normalrow";
}

