            
            
            var qID;
            var firstnameID;
            var lastnameID;
            var exactnessName;
            var statusID;
            var departmentID;
            var profileGridUrl;

            function trim(sString) 
            { 
                sTrimmedString = ""; 
                if (sString != "") 
                { 
                    var iStart = 0; 
                    var iEnd = sString.length - 1; 
                    var sWhitespace = " \t\f\n\r\v"; 
      
                    while (sWhitespace.indexOf(sString.charAt(iStart)) != -1) 
                    { 
                        iStart++; 
                        if (iStart > iEnd) 
                            break; 
                    } 
       
                    if (iStart <= iEnd) 
                    { 
                        while (sWhitespace.indexOf(sString.charAt(iEnd)) != -1) 
                            iEnd--; 
                            sTrimmedString = sString.substring(iStart,++iEnd); 
                    } 
                } 
                return sTrimmedString; 
            } 
            
            function SearchEducation()
            {                                
				var query = null;
				query = document.getElementById(qID).value;
				
				if (query != null && trim(query) != "")
				{
				    window.location= "http://search5.iu.edu/search?site=education&client=education&proxystylesheet=education&output=xml_no_dtd&q=" + escape(query);
				    return false;
                }
                else
                {
                    //will always return false, so postback does not happen
                    return false;
                }
            }
            
            function checkEnterSearchEducation(e)
            {
                //if the return key is pressed, then send to the search page via SearchEducation(), otherwise accept the key entry 
                
				var characterCode;

				if(e && e.which)
				{
					e = e;
					characterCode = e.which;
				}
				else{
					e = event;
					characterCode = e.keyCode;
				}

				if(characterCode == 13)
				{					    								
					return SearchEducation();
				}
				else
				{
					return true;
				}

			}

            function checkEnter(e)
            { 
                //if the return key is pressed, then send to the search page via GetSearchResult(), otherwise accept the key entry 
                
				var characterCode;

				if(e && e.which)
				{
					e = e;
					characterCode = e.which;
				}
				else
				{
					e = event;
					characterCode = e.keyCode;
				}

				if(characterCode == 13)
				{
				
					GetSearchResult();
					
					//to avoid postback
					return false; 
				}
				else
				{
					return true;
				}
			}

			function GetSearchResult()
			{				    
				var radioList = document.getElementsByName(exactnessName);				
				var firstname = document.getElementById(firstnameID).value;
				var lastname = document.getElementById(lastnameID).value;
				var status = document.getElementById(statusID).value;
				var departmentname = document.getElementById(departmentID).value;
				var exactness;
				
				for (var x = 0; x < radioList.length; x++) 
				{
					if (radioList[x].checked) 
					{
						exactness = radioList[x].value;
					}  	
				}
				
				var redirectURL = profileGridUrl + "?exactness=" + exactness + "&firstname=" + escape(firstname) +  "&lastname=" + escape(lastname) + "&status=" + status + "&departmentname=" + escape(departmentname)
				
				window.location = redirectURL;
				
				return false;
			}
			
			function ResetSearchQ()
			{
			    document.getElementById(qID).value = "";
			    return false;
			}
			
			function ResetSearch()
			{
				var radioList = document.getElementsByName(exactnessName);
				radioList[0].checked = true;				
                document.getElementById(firstnameID).value = "";
			    document.getElementById(lastnameID).value = "";
				document.getElementById(statusID).selectedIndex = 0;
				document.getElementById(departmentID).selectedIndex = 0;
				return false;
			}
			

			
			
