function IsNumber(sText,Label)
	{
	   var ValidChars = "0123456789";
	   var IsNumber=true;
	   var Char;
	   if(sText=="") {alert(Label+ " Should not be Empty");return false}
	   for (i = 0; i < sText.length && IsNumber == true; i++) 
	   { 
		  Char = sText.charAt(i); 
		  if(ValidChars.indexOf(Char) == -1) 
		  {
			 IsNumber = false;
		  }
	   }
	   if(!IsNumber)
		alert(Label+ " Must Be numeric")
	   return IsNumber;
	}
	function ValidateEmail( Email )
	{
		var atCharPresent = false;
		var dotPresent = false;

		for ( var Idx = 0; Idx < Email.length; Idx++ )
		{
			if ( Email.charAt ( Idx ) == '@' )
				atCharPresent = true;
			if ( Email.charAt ( Idx ) == '.' )
				dotPresent = true;
		}
		
		for ( var Idx = 0; Idx < Email.length; Idx++ )
			{
				if ( Email.charAt(Idx) == '	'
					|| Email.charAt(Idx) == ' '
					|| Email.charAt(Idx) == ','
					|| Email.charAt(Idx) == ';' )
				{
					//alert( "No spaces or other invalid characters are not allowed in the email. Please enter only one main email address" );
					document.contact_form.email.focus( );
					return false;
				}
			}
		
		if ( !atCharPresent || !dotPresent )
			return false;
			
			var last_ar=Email.split(".");
			if (last_ar[last_ar.length-1].length<2)
				return false;

		return true;
	}
           
	function IsAllStrOnlySpace(txtstr) {
		var scnt=0;
		for(i=0; i < txtstr.length;i++) {
			if(txtstr.charAt(i) == " ") {
				scnt = scnt +1;
			}
		}
		if(scnt == txtstr.length) 
			return true;
		else
			return false;
	}

		function validate()
		{
		
		if ( document.contact_form.name.value == "" )
    {
        alert ( "Please enter your Name" );
        document.contact_form.name.focus();
		return false;
    }

		if (document.contact_form.email.value == "")
		{
			alert ("Please enter your E-mail id.");
			document.contact_form.email.focus();
			return false;
		}

		if ( !ValidateEmail( document.contact_form.email.value ) )
		{
				alert( "Please enter a valid E-mail id." );
				document.contact_form.email.focus( );
				return false;
		}	
		if ( document.contact_form.city.value == "")
    {
        alert ( "Please enter your City" );
        document.contact_form.city.focus();
		return false;
    }
if ( document.contact_form.country.value == "")
    {
        alert ( "Please enter your Country" );
        document.contact_form.country.focus();
		return false;
    }
if ( document.contact_form.subject.value == "")
    {
        alert ( "Please type Subject" );
        document.contact_form.subject.focus();
		return false;
    }
var textarea=tinyMCE.get('details').getContent(); 
	if ((textarea=="") || (textarea==null)) 
	{
			alert("Please enter details");
			tinyMCE.get('details').focus();
			return false; 
	}
		

}
		function IsNumeric(obj)
	{
		//alert(obj.value);
		mystring = obj.value;
		if (mystring.match(/^\d+$/ ) ) {
		
			//alert("Valid number");
		}
		else
		{
			obj.value='';
			//alert("Only numeric values are allowed");
		}
	}
