		//Check if mandatory fields are completed (not blanck)
		function BlankCase()
		{
			var name=document.forms[0].openCaseName.value;
			var blank="";
			if(name.length!=0)
			{
				for(i=0; i<name.length; i++)
					blank=blank.concat(" ");
			}
			if(name==blank)
			{
				
				document.forms[0].openCaseName.focus();
				alert("Case Name must not be blank.");
				return 1;
			}
			return 0;
		}
		
		//check if state a part of file number has been selected
		function BlankFileState()
		{
			var name=document.forms[0].ddlFileState.value;
			var blank=" ";
			if(name.length!=0)
			{
				for(i=0; i<name.length; i++)
					blank=blank.concat(" ");
			}
			if(name==blank)
			{
				
				document.forms[0].ddlFileState.focus();
				alert("File number must not be blank.");
				return 1;
			}
			return 0;
		}
		
		// check if FileNumber has been entered as a part of file number
		function BlankFileNumber()
		{
			var name=document.forms[0].fileNumber.value;
			var blank="";
			if(name.length!=0)
			{
				for(i=0; i<name.length; i++)
					blank=blank.concat(" ");
			}
			if(name==blank)
			{
				
				document.forms[0].fileNumber.focus();
				alert("File number must not be blank.");
				return 1;
			}
			return 0;
		}
		
		// check if OfYear has been entered as a part of file number
		function BlankOfYear()
		{
			var name=document.forms[0].ofyear.value;
			var blank="";
			if(name.length!=0)
			{
				for(i=0; i<name.length; i++)
					blank=blank.concat(" ");
			}
			if(name==blank)
			{
				
				document.forms[0].ofyear.focus();
				alert("File number must not be blank.");
				return 1;
			}
			return 0;
		}
		
		// check if Family Name/Company has been entered as a part of file number
		function BlankFamilyName()
		{
			var name=document.forms[0].familyName.value;
			var blank="";
			if(name.length!=0)
			{
				for(i=0; i<name.length; i++)
					blank=blank.concat(" ");
			}
			if(name==blank)
			{
				
				document.forms[0].familyName.focus();
				alert("Family Name/Company must not be blank.");
				return 1;
			}
			return 0;
		}
		
		function BlankSolicitorName()
		{
			var name=document.forms[0].relationship.value;
			var blank="";
			if(name.length!=0)
			{
				for(i=0; i<name.length; i++)
					blank=blank.concat(" ");
			}
			if(name==blank)
			{
				document.forms[0].relationship.focus();
				alert("Relationship with proceeding must not be blank.");
				return 1;
			}
			return 0;
		}
		
		function BlankSenderProceed()
		{
			var name=document.forms[0].senderproceed.value;
			var blank="";
			if(name.length!=0)
			{
				for(i=0; i<name.length; i++)
					blank=blank.concat(" ");
			}
			if(name==blank)
			{
				
				document.forms[0].senderproceed.focus();
				alert("Relationship with proceeding must not be blank.");
				return 1;
			}
			return 0;
		}
			
			// check if Contact Name has been entered as a part of file number
		function BlankContactName()
		{
			var name=document.forms[0].contactName.value;
			var blank="";
			if(name.length!=0)
			{
				for(i=0; i<name.length; i++)
					blank=blank.concat(" ");
			}
			if(name==blank)
			{
				document.forms[0].contactName.focus();
				alert("Contact Name must not be blank.");
				return 1;
			}
			return 0;
		}

		// check if Country Code has been entered as a part of file number
		function BlankCcodeNumber()
		{
			var name=document.forms[0].ccode.value;
			var blank="";
			if(name.length!=0)
			{
				for(i=0; i<name.length; i++)
					blank=blank.concat(" ");
			}
			if(name==blank)
			{
				
				document.forms[0].ccode.focus();
				alert("Country code must not be blank.");
				return 1;
			}
			return 0;
		}

		
		// check if area code of phone number has been entered as a part of file number
		function BlankStdNumber()
		{
			var name=document.forms[0].std.value;
			var blank=" ";
			if(name.length!=0)
			{
				for(i=0; i<name.length; i++)
					blank=blank.concat(" ");
			}
			if(name==blank)
			{
				
				document.forms[0].std.focus();
				alert("Area code must not be blank.");
				return 1;
			}
			return 0;
		}
		
		// check if Phone Number has been entered as a part of file number
		function BlankPhoneNumber()
		{
			var name=document.forms[0].phoneNumber.value;
			var blank="";
			if(name.length!=0)
			{
				for(i=0; i<name.length; i++)
					blank=blank.concat(" ");
			}
			if(name==blank)
			{
				
				document.forms[0].phoneNumber.focus();
				alert("Phone Number must not be blank.");
				return 1;
			}
			return 0;
		}
		
		function BlankPhoneNo()
		{
			var name=document.forms[0].PhoneNo.value;
			var blank="";
			if(name.length!=0)
			{
				for(i=0; i<name.length; i++)
					blank=blank.concat(" ");
			}
			if(name==blank)
			{
				
				document.forms[0].PhoneNo.focus();
				alert("Phone Number must not be blank.");
				return 1;
			}
			return 0;
		}
		
		// check if Street has been entered as a part of file number
		function BlankStreet()
		{
			var name=document.forms[0].street.value;
			var blank="";
			if(name.length!=0)
			{
				for(i=0; i<name.length; i++)
					blank=blank.concat(" ");
			}
			if(name==blank)
			{
				
				document.forms[0].street.focus();
				alert("Street address must not be blank.");
				return 1;
			}
			return 0;
		}
		
		// check if Suburb has been entered as a part of file number
		function BlankSuburb()
		{
			var name=document.forms[0].suburb.value;
			var blank="";
			if(name.length!=0)
			{
				for(i=0; i<name.length; i++)
					blank=blank.concat(" ");
			}
			if(name==blank)
			{
				
				document.forms[0].suburb.focus();
				alert("Suburb must not be blank.");
				return 1;
			}
			return 0;
		}
			
			// check if Post Code has been entered as a part of file number
		function BlankPostCode()
		{
			var name=document.forms[0].PostCode.value;
			var blank="";
			if(name.length!=0)
			{
				for(i=0; i<name.length; i++)
					blank=blank.concat(" ");
			}
			if(name==blank)
			{
				
				document.forms[0].PostCode.focus();
				alert("Post Code must not be blank.");
				return 1;
			}
			return 0;
		}
		
		// check if State has been entered as a part of file number
		function BlankState()
		{
			var name=document.forms[0].State.value;
			var blank="";
			if(name.length!=0)
			{
				for(i=0; i<name.length; i++)
					blank=blank.concat(" ");
			}
			if(name==blank)
			{
				
				document.forms[0].State.focus();
				alert("State must not be blank.");
				return 1;
			}
			return 0;
		}
		
		// check if Registry has been entered as a part of file number
		function BlankRegistry()
		{
			var name=document.forms[0].Registry.value;
			var blank="";
			if(name.length!=0)
			{
				alert("Registry length is:" +name.length);
				for(i=0; i<name.length; i++)
					blank=blank.concat(" ");
			}
			if(name==blank)
			{
				
				document.forms[0].Registry.focus();
				alert("Registry must not be blank."+name.length);
				return 1;
			}
			return 0;
		}
		
		function BlankStatetofile()
		{
			var name=document.forms[0].stateToFile.value;
			var blank="";
			if(name.length!=0)
			{
				alert("Registry length is:" +name.length);
				for(i=0; i<name.length; i++)
					blank=blank.concat(" ");
			}
			if(name==blank)
			{
				
				document.forms[0].stateToFile.focus();
				alert("Registry must not be blank."+name.length);
				return 1;
			}
			return 0;
		}
		
		function BlankEmail()
		{
			var emailaddr=document.forms[0].email.value;
			var blank="";
            var x=document.getElementsByName('radio1');
            if (x[1].checked)                  
		  	{
				if (emailaddr==blank)
				{
					document.forms[0].email.focus();
					alert("Email address must not be blank.");
					return 1;
				}				
			}
			return 0;
		}
		
	//Check if the value is number
	function ValueIsNumber(obj)
	{
		temp=obj.value;
		if(obj.value==0)
		{	alert("'" +temp+ "' is not valid number"); return 1;}
		if(obj.value.length!=0)
		{
			for(i=0; i<obj.value.length; i++)
			{
				if((obj.value.charAt(i)>'9' || obj.value.charAt(i)<'0'))
				{
					alert("'" +obj.value+ "' is not valid number");
					obj.value='';
					obj.focus();
					return 1;
				}
			}
		}
		return 0;
	}
	
	
	
	//Check if the value is number and the legth is not greater than 4 char
	function IsNumberPostCode(obj)
	{
		
		if(obj.value==0)
			alert("'" +temp+ "' is not valid number");
		//if(obj.value.length>4)
			

		if(obj.value.length!=0 && obj.value.length<=4)
		{
			for(i=0; i<obj.value.length; i++)
			{
				if((obj.value.charAt(i)>'9' || obj.value.charAt(i)<'0'))
				{
					alert("'" +obj.value+ "' is not valid number");
					obj.value='';
					obj.focus();
					return 1;
				}
			}
		}
		else {
			alert("Post code can not be longer than four digits" );
			obj.value='';
			return 1;
		}
		return 0;		
		
	}
		
		

