// JavaScript Document
var browserName=navigator.appName;
if (browserName=="Netscape")
{
document.write("");
}

function cleary()
{
document.cookie = 'school' +'=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/';


document.getElementById('school_input').value = "";
document.getElementById('school_change').style.display='block';
document.getElementById('school_input').disabled=false;
document.getElementById('school_input').focus();
}


      var count = 0;
      function doDropDown()
        {
		  if (document.getElementById('school_input').value.length >= 3)
		  {
                document.getElementById('out').innerHTML = "";
                count = count+1;
        setTimeout("dropDownGo("+count+")",1000);
		  }
        }

      function dropDownGo(currCount)
        {
         if(currCount == count)
           {
              count = 0;
              school();
           }
        }


function school(){
document.getElementById('loader').style.display="block";
        var ajaxRequest;  // The variable that makes Ajax possible!
                try{
                // Opera 8.0+, Firefox, Safari
                ajaxRequest = new XMLHttpRequest();
        } catch (e){
                // Internet Explorer Browsers
                try{
                        ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
                } catch (e) {
                        try{
                                ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
                        } catch (e){
                                // Something went wrong
                                //alert("Your browser broke!");
                                return false;
                        }
                }
        }
        // Create a function that will receive data sent from the server
        ajaxRequest.onreadystatechange = function(){
                if(ajaxRequest.readyState == 4){
                //alert("set");
                document.getElementById('out').style.display="block";
                document.getElementById('loader').style.display="none";
                document.getElementById('out').innerHTML = ajaxRequest.responseText;


                }
        }
        var result = document.getElementById('school_input').value;
        var queryString = "?school=" + result;
        ajaxRequest.open("GET", "school.php" + queryString, true);
        ajaxRequest.send(null);
}

function clicker(that) {
var pick = that.options[that.selectedIndex].value;
 document.getElementById('school_input').value = pick;
 document.getElementById('out').style.display = 'none';
 document.getElementById('school_input').disabled=true;
 document.getElementById('school_input').style.color = '#999999';
 val= document.getElementById('school_input').value;
 document.cookie = 'school='+val+'; expires=Thu, 2 Aug 2010 20:47:11 UTC; path=/';
 document.getElementById('school_change').style.display = 'block';


 }

function cl()
{
document.getElementById('school_input').value = '';
document.getElementById('school_input').style.color = 'black';
}

function bl()
{
document.getElementById('school_input').value = 'Choose your College or University';
document.getElementById('school_input').style.color = '#999999';
}

