
    function setKeywordType(type)
    {
         document.getElementById("keywordType").name = type;
    }
    function showSpotSearchBox()
    {
           document.getElementById("potSearchBox").style.display = "block";
           document.getElementById("viewAllSpots").src= "/track/view_all_spots";
    }
    function hideLoading()
    {
          document.getElementById("boxLoading").style.display = "none";
    }
    function hideBox(boxId)
    {
          document.getElementById(boxId).style.display = "none";
    }
    function advancedSearch()
    {
          document.getElementById("searchBox").style.display = "block";
    }

    function setCity(province_id, city_id)
    {           
                var provinceSelect = $("province_id");
                var provinceOptions = provinceSelect.options;
                var provinceLength = provinceOptions.length;
                for(var k=0; k<provinceLength; k++)
                {
                    if(provinceOptions[k].value == province_id)
                    {
                        provinceOptions[k].selected = true;
                    }
                }
                var url = "/user/getcities";
                if(province_id == "") return;
                var params = {"province_id" : province_id};
                var myAjax = new Ajax.Request(
                          url,
                          {
                            method: 'get', 
                            parameters: params, 
                            onSuccess: function(request){
                                  var result = eval("(" + request.responseText + ")");
                                  var cities = result.cities;
                                  var citySelect = $("city_id");
                                    while(citySelect.options.length > 1)
                                    {
                                         citySelect.removeChild(citySelect.options[citySelect.options.length-1]);
                                    }
                                    
                                    for(var i=1; i< cities.length; i++)
                                    {
                                        var option = new Option(cities[i].name, cities[i].id);
                                        if(city_id != null && option.value == city_id)
                                            option.selected = true;
                                        citySelect.options[citySelect.options.length] = option;    
                                    }  
                                    
                                                                      
                            },
                            onFailure: function(){}
                          }
                    );
    }