function nullCheck(str,ctrltxt)
{
	if(eval("document."+str+".value")=="")
	{
		alert("Enter "+ctrltxt);
		eval("document."+str+".focus()");
		return false;
	}
	else
	{
		return true;
	}
}


function isNull(value)
{
/*Function Null Value checking
  Parameter : String
  Return type : boolean
*/

  value=spaceTrimmer(value);

  if(value=="") 
  {
    alert("Missing Required Field");
    return true;
  }
  return false;
}




function spaceTrimmer(value)
{
/*Function Space Trimmer
  Parameter : String
  Return type : String without Space
*/
  var val;
  for(var i=0;i<value.length;i++)
	{
		if (value.charAt(i)!=" ")
			break;
	}
  val=value.substring(i,value.length);

  return val;
}


function urlvalidate(strUrl)
	{
		var urlchk,urlsubstr,urlsubstr1,leng;	
		urlchk=strUrl;
		leng=urlchk.length;
		urlsubstr=urlchk.substring(0,11);
		//alert(leng);
		//alert(urlchk.charAt(leng));
		urlsubstr1=urlchk.substring(11,urlchk.length);
			
		if(urlchk.charAt(leng-1)==".")
		{
			return false;
		}			
		else if(urlsubstr!="http://www.")
		{
			return false;
		}
		else if(urlsubstr1.indexOf(".")==-1)
		{
			return false;
		}
		
		else
		return true;
	}	




function numcheck(num)
	{
		var num=num;
		if(num!="")
		{
			if(isNaN(num))
			{
				return false;
			}
			else
			{
				return true;
			}
		}
		else
		{
			return true;
		}
	}


function isNumber(intValue)
{
/*
Function Number validation
parameter : Number
return type : boolean
*/
var posi;
var strNumber="012345678 9"

   /*if(intValue.charAt(0)=="0")
    {
    alert("0 is not allowed at the beginning");
    return false;
    }*/

  posi= intValue.indexOf("+")
	
	
	for(var i=0;i<intValue.length;i++)
	{
	 
	 
		if (strNumber.indexOf(intValue.charAt(i))=="-1")
			{
              if(i==0 && posi==0)
                 {
					
                 }
               else
                 {   			
					alert('Enter Digit Only');
					return false;
				 }
			
			}
	
	}
	
	
	return true;

}
	
	
	function emailvalidate(email)
	{
		var mail,count,mailsubstr;
		var wildchar="~`!#$%^&*()-+=}]{[':;|\?/><";
		var i;
		count=0;
		
		mail=email;
		
	//Checking For the occurance of "." at the end of string
		if((mail.charAt(mail.length-1))==".")
		{
			emailerrormessage();
			return false;
		}
		//Checking the occurance of space,.,@ in the first position of mail-id
		else if(mail.charAt(0)==" "||mail.charAt(0)=="."||mail.charAt(0)=="@")
		{
			emailerrormessage();
			return false;
		}
		
		//Checking the occurance of  space,.,@ in the last position of mail-id
		else if((mail.charAt(mail.length)=="@")||(mail.charAt(mail.length)==" ") || (mail.charAt(mail.length)==".") || (mail.indexOf(" ")!=-1))
		{
			emailerrormessage();
			return false;
		}
		
		//indexOf() returns '-1' if no such occurance of character is found
		else if(mail.indexOf("@")==-1)
		{
			emailerrormessage();
			return false;
		}
		
		//indexOf() returns '-1' if no such occurance of character is found
		else if(mail.indexOf(".")==-1)
		{
			emailerrormessage();
			return false;
		}
		
		else 
		{
			//Checking For Atleast One "@" in the mail id
			if(mail.indexOf("@")==-1)
			{
				emailerrormessage();
				return false;
			}
			else
			{	
				for(i=0;i<mail.length;i++)
				{
					if(mail.charAt(i)=="@")
					{
						count++;//If there is more than one occurance of "@" count is >1
					}
				}
				if(count>1)
				{
					emailerrormessage();//If there is more than one "@"			
					return false;
				}	
				else 
				{
					if(count==1)
					{
						mailsubstr=mail.substring(mail.indexOf("@")+1,mail.length);//Getting the substring after "@"
						//Checking for atleast one "." after the "@" character
						if(mailsubstr.indexOf(".")==-1)
						{
							emailerrormessage();
							return false;
						}
						else
						{	
							//Checking for atleast three characters after the "@" symbol(and before the ".")
							for(i=0;i<1;i++)
							{
								if(mailsubstr.charAt(i)==".")
								{
									emailerrormessage();	
									return false;
								}
							}
							return true;
						}
					}
				}
			}	
		}
	}	
function emailerrormessage()
{
	//Function displaying the email error message
		alert("Invalid Mail Id");
}