/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

<!--
var isIEBrowser=false;
var isW3CcompatbleBrowser=false; //netscape, firefox, safari

function clicked(field) //xmlString
{
    alert(field.value);
   }

function mapviewLoad(xmlString){
    load(xmlString);
    populateListBox(xmlString);
}

function load(xmlString) //xmlString
{
  //isIEBrowser=(document.all) ? true:false;
  //var xmlString= document.getElementById("gymXml");

   // if (!isIEBrowser)
  
   getClientBrowserType();
   showAdvanceSearch();
   loadGoogleMap(xmlString);
   

    // alert("ie: " + isIEBrowser + " firefox: " + isW3CcompatbleBrowser);


}

function disableMultipleSubmits(){
   var submitButton = document.getElementById("advanceSearchSubmitButton")
   submitButton.disabled = true;
   document.getElementById("advancedSearchForm").submit();
}

function getClientBrowserType(){
  var browser=navigator.appName;
  var b_verAsion=navigator.appVersion;
    if (browser=="Microsoft Internet Explorer"){
        isIEBrowser=true;
        isW3CcompatbleBrowser=false
    }else{
        isIEBrowser=false;
        isW3CcompatbleBrowser=true;
    }
}

function populateListBox(xmlString){
    var listBox=document.getElementById("gymList");
    if (listBox==null) return;
    rootElement=convertStringToDom(xmlString);

    var gyms = GetElementsByTagName(rootElement,'gym');
    for (var index = 0; index < gyms.length; index++) {
        var gym = gyms[index];

        var optn = document.createElement("OPTION");
        optn.text = GetElementTextByTagName(gym,'name');
        optn.value = SerializeToString(gym) ;//converst to string;
        listBox.options.add(optn);
    }
}
 function showGym(){
    var listBox=document.getElementById("gymList");
    if (listBox==null) return;
    var xmlString=listBox.value;
    gymRootElement=convertStringToDom(xmlString);
    var name=GetElementTextByTagName(gymRootElement,'name');
    var longitude=GetElementTextByTagName(gymRootElement,'longitude');
    var latitude=GetElementTextByTagName(gymRootElement,'latitude');
    var url=GetElementTextByTagName(gymRootElement,'url');
    HighLightOnMap(longitude,latitude,name,url);

 }



function SubmitForm (formName) {
    document.getElementById(formName).submit();
    return true;
  }

