var xmlHttp;
function GetXmlHttpObject(){
    var xmlHttp=null;
    try{
        // Firefox, Opera 8.0+, Safari
        xmlHttp=new XMLHttpRequest();
    }
    catch (e){
        // Internet Explorer
        try{
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e){
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    return xmlHttp;
}

function search_location(){
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null){
        alert ("Tu browser no soporta AJAX !!");
        return;
    }
	
    tag=document.getElementById("nav_menu_form_industry");
    tag=tag.options[tag.selectedIndex].value;
    
    var url;
    url="search_location.php?tag="+tag+"&ie_ajax_fix="+Number(new Date());
    xmlHttp.open("GET",url,true);
    xmlHttp.onreadystatechange=function(){
        if (xmlHttp.readyState==4){ 
            document.getElementById("nav_menu_form_divlocation").innerHTML=xmlHttp.responseText;
            $(function() {
                $( "#nav_menu_form_submit" ).button();
            });
        }
    };
    xmlHttp.send(null);
    document.getElementById("nav_menu_form_divlocation").innerHTML="Cargando...";
}
