function Validate_Form(frm)
{
	with(frm)
    {	
		if(!IsEmpty(full_name, 'Please Enter Full Name.'))
		{
			return false;
		}
		if(!IsEmpty(school_name, 'Please Enter School Name.'))
		{
			return false;
		}
		if(!IsEmail(email_address, 'Please Enter Email Address.'))
		{
			return false;
		}
		if(!IsEmpty(phone, 'Please Enter Phone.'))
		{
			return false;
		}
		else
		{
			var checkOK = "0123456789- ";
			var checkStr = frm.phone.value;
			var allValid = true;
			for (i = 0;  i < checkStr.length;  i++)
			{
				ch = checkStr.charAt(i);
				for (j = 0;  j < checkOK.length;  j++)
				  if (ch == checkOK.charAt(j))
					break;
				if (j == checkOK.length)
				{
				  allValid = false;
				  break;
				}
			}   
			if (!allValid)
			{
				alert ("Please Enter valid Phone no.");
				frm.phone.focus();
				return false;
			}   
		}
		if(frm.college_desired.value == 0)
		{
			alert ("Please Select Colleges Desired.");
			return false;
		}
		if(frm.desired_field.value == 0)
		{
			alert ("Please Select Desired Field.");
			return false;
		}
		if(frm.budget_range.value == 0)
		{
			alert ("Please Select Desired Budget Range.");
			return false;
		}
		if(!IsEmpty(students_marks, 'Please Enter Students Marks.'))
		{
			return false;
		}
		//alert('Hi');
		return true;
	}
}
var xmlHttp = createXmlHttpRequestObject(); 

// retrieves the XMLHttpRequest object
function createXmlHttpRequestObject() 
{	
  // will store the reference to the XMLHttpRequest object
  var xmlHttp;
  // if running Internet Explorer
  if(window.ActiveXObject)
  {
    try
    {
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch (e) 
    {
      xmlHttp = false;
    }
  }
  // if running Mozilla or other browsers
  else
  {
    try 
    {
      xmlHttp = new XMLHttpRequest();
    }
    catch (e) 
    {
      xmlHttp = false;
    }
  }
  // return the created object or display an error message
  if (!xmlHttp)
 
    alert("Error creating the XMLHttpRequest object.");
  else 
    return xmlHttp;
}
function CategoryProcess(col_cat_id)
{
 	
 // proceed only if the xmlHttp object isn't busy
  //alert(college_name);
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
    // retrieve the name typed by the user on the form
    //name = encodeURIComponent(document.getElementById("myName").value);
    // execute the quickstart.php page from the server
	//event_id=
	xmlHttp.open("GET", "brochures1.php?col_cat_id=" +col_cat_id, true);  
    // define the method to handle server responses
    xmlHttp.onreadystatechange = handleCategoryResponse;
    // make the server request
    xmlHttp.send(null);
  }
  else
    // if the connection is busy, try again after one second  
    setTimeout('Eventprocess()', 1000);
}
function handleCategoryResponse() 
{
 	//alert(xmlHttp.responseText);
 // move forward only if the transaction has completed
  if (xmlHttp.readyState == 4) 
  {
    // status of 200 indicates the transaction completed successfully
    if (xmlHttp.status == 200) 
    {
      // extract the XML retrieved from the server
      xmlResponse = xmlHttp.responseText;
      // obtain the document element (the root element) of the XML structure
      //xmlDocumentElement = xmlResponse.documentElement;
      // get the text message, which is in the first child of
      // the the document element
      //helloMessage = xmlDocumentElement.firstChild.data;
      // update the client display using the data received from the server
	  out = xmlResponse.split("|");
	  //document.write(out[1]);
	  document.getElementById("college_desired").innerHTML = out[0];
	  //document.getElementById("subcat_content").innerHTML = out[1];
      //document.getElementById("college_desired").innerHTML;
     
	  // restart sequence
      //setTimeout('Eventprocess()', 1000);
    } 
    // a HTTP status different than 200 signals an error
    else 
    {
      alert("There was a problem accessing the server: " + xmlHttp.statusText);
    }
  }
}
