function validate_form(theForm)
{

  if (theForm.Title.value == "")
  {
    alert("Please Enter Title");
    theForm.Title.focus();
    return (false);  
  }


  if (theForm.Status.value == "")
  {
    alert("Please Enter Status");
    theForm.Status.focus();
    return (false);  
  }

if (theForm.Categories.value == "")
  {
    alert("Please Enter Categories" );
    theForm.Categories.focus();
    return (false);  
  }


if (theForm.Author.value == "")  
  {   
   
         alert("Please Enter Author Name");
         theForm.Author.focus();
         return (false);  
  }

if (theForm.Summary.value == "")  
  {   
   
         alert("Please Enter Summary of the Articel");
         theForm.Summary.focus();
         return (false);  
  }

if (theForm.Content.value == "")  
  {   
   
         alert("Please Enter Content");
         theForm.Content.focus();
         return (false);  
  }



return (true);
}



//#############################################################################################


function checkValidate_form(theForm)
{

  if (theForm.FirstName.value == "")
  {
    alert("Please Enter Your First Name");
    theForm.FirstName.focus();
    return (false);  
  }


  if (theForm.LastName.value == "")
  {
    alert("Please Enter Your Last Name");
    theForm.LastName.focus();
    return (false);  
  }


 if (theForm.EmailAddress.value == "")
  {
    alert("Please Enter Your Email Id");
    theForm.EmailAddress.focus();
    return (false);  
  }

 if (theForm.EmailAddress.value != "")
   {
	var your_Id=theForm.EmailAddress.value;
	var is_site_ok=your_Id.indexOf('@');
	var is_dot_ok=your_Id.indexOf('.');

	if ((is_site_ok==-1) || (is_dot_ok==-1))
 	{ 
 	 alert("Please Enter Correct Email Id");
	theForm.EmailAddress.focus();
    	return (false);
	}
  
  }

 if (theForm.CotnactNo.value == "")  
  {   
   
         alert("Please Enter Your Contact Number");
         theForm.CotnactNo.focus();
         return (false);  
  }

if (theForm.Address.value == "")  
  {   
   
         alert("Please Enter Your Address");
         theForm.Address.focus();
         return (false);  
  }

if (theForm.City.value == "")  
  {   
   
         alert("Please Enter Your City");
         theForm.City.focus();
         return (false);  
  }
 
if (theForm.State.value == "")  
  {   
   
         alert("Please Enter Your State / Province");
         theForm.State.focus();
         return (false);  
  }

if (theForm.ZIP.value == "")  
  {   
   
         alert("Please Enter ZIP Code");
         theForm.ZIP.focus();
         return (false);  
  }


if (theForm.Ad_in_Country.value == "United States")  
  {   

	if (theForm.State_only_usa.value == "")  
	  {   
   
         alert("Please Enter The State of USA");
         theForm.State_only_usa.focus();
         return (false);  
  	}

    }

if (theForm.Comments.value == "")  
  {   
   
         alert("Please Enter Any Comments/Questions");
         theForm.Comments.focus();
         return (false);  
  }

if (validateRadioButton(thisform) == -1) 
   {
	return (false);
    }
 return (true);
}


function validateRadioButton(thisform) {
// validate Package Radiobuttons

myOption = -1;
	for (i=thisform.Package.length-1; i > -1; i--)
	{
	 if (thisform.Package[i].checked) 
	 {
	 myOption = i; i = -1;
	 }
	}
		if (myOption == -1)
 		{
		alert("You Must Select A One Package");
		return false;
		}
		else
		return true;
}


