/**
 * K Hackenberg (Gould) - 11-14-2006
 * Google Search Javscript
 * example of use:
 <span style="font-size: 7pt; font-family: Arial"><strong>Search Air Quality<br /></strong></span>
   <input type=text name="txtAQSearch" id="txtAQSearch" onKeyPress="return checkAQkey(event, this.form);" style="border-right: #0099cc 1px solid; border-top: #0099cc 1px solid; font-size: 8pt; border-left: #0099cc 1px solid; color: #003399; border-bottom: #0099cc 1px solid; background-color: white; font-family: Arial;"  />
<input type=button name="btnSearchAQ"  value="GO" onClick="return ClkSearch(this.form);"  style="font-size: 8pt"  />
 */
 
 if(navigator.appName == "Microsoft Internet Explorer")
        { 
                document.attachEvent("onkeypress",checkAQkey);           
        } 
        else if(navigator.appName == "Netscape") 
        {                               
                document.addEventListener("keypress",checkAQkey,false); 
        } 

        function ClkSearch(form) 
        { 
            var queryTerm = form.txtAQSearch.value;
            getAQSearch(queryTerm);
        }
      
        function checkAQkey(e,form) 
        {               
        if(navigator.appName == "Microsoft Internet Explorer") 
                { 
                        if(event.keyCode==13) 
                        {                                       
                                event.returnValue=false; 
                                event.cancelBubble=true; 
                                var queryTerm = form.txtAQSearch.value;
                                getAQSearch(queryTerm);
                        }                       
                } 
        else if(navigator.appName == "Netscape") 
                {                       
                        if(e.which==13) 
                        { 
                                e.preventDefault(); 
                                var queryTerm = form.txtAQSearch.value;
                                getAQSearch(queryTerm);
                        }                                       
                } 
        } 
		
         function getAQSearch(myVal) 
        { 
           GoogleCollection = 'Air_Quality';
           GoogleFrontEnd = 'default_frontend';

window.location.href = ("http://search.maricopa.gov/search?entqr=0&ud=1&sort=date%3AD%3AL%3Ad1&output=xml_no_dtd&oe=UTF-8&ie=UTF-8&client=" + GoogleFrontEnd + "&proxystylesheet=" + GoogleFrontEnd + "&site=" + GoogleCollection + "&q=" + myVal);
        } 
