﻿// JScript File

if(navigator.appName == "Microsoft Internet Explorer")
        { 
                document.attachEvent("onkeypress",checkPNDkey);           
        } 
        else if(navigator.appName == "Netscape") 
        {                               
                document.addEventListener("keypress",checkPNDkey,false); 
        } 

        function ClkSearch(form) 
        { 
            var queryTerm = form.txtPNDSearch.value;
            getPNDSearch(queryTerm);
        }
      
        function checkPNDkey(e,form) 
        {  
                    
        if(navigator.appName == "Microsoft Internet Explorer") 
                { 
                        if(event.keyCode==13) 
                        {                                       
                                event.returnValue=false; 
                                event.cancelBubble=true; 
                                var queryTerm = form.txtPNDSearch.value;
                                getPNDSearch(queryTerm);
                        }                       
                } 
        else if(navigator.appName == "Netscape") 
                {                       
                        if(e.which==13) 
                        { 
                                e.preventDefault(); 
                                var queryTerm = form.txtPNDSearch.value;
                                getPNDSearch(queryTerm);
                        }                                       
                } 
        } 
		
         function getPNDSearch(myVal) 
        { 
       
           GoogleCollection = 'Planning_And_Development';
           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);
        } 
