function doSimpleSearch()
{
    theForm = document.Main_Search;
    theForm.CheckInDate.value ="";
    theForm.CheckOutDate.value="";
    submitForm(theForm);
}
function submitForm(theForm)
{
    if(getRadioButtonValue(theForm.CityName_temp)!= null)
    {
        var city_state_country = getRadioButtonValue(theForm.CityName_temp);
        
         city = city_state_country.split("_")[0]
	 state = city_state_country.split("_")[1]
         country = city_state_country.split("_")[2]

        theForm.CityName.value = city
		if (state!="#")
		{
		    if(theForm.StateCode)
			{
				theForm.StateCode.value = state
			}

		}
        if(country!= null)
        {
			if(theForm.CountryCode)
			{
				theForm.CountryCode.value = country
			}
        }
    }
    if(theForm.UserSpecified.checked ==true)
    {
        theForm.CityName.value = theForm.SpecifiedCity.value;	
	theForm.StateCode.value = "";
        theForm.CountryCode.value="";
    }
    else if(theForm.UserSpecified2 && theForm.UserSpecified2.checked ==true)
    {
        theForm.CityName.value = theForm.SpecifiedCity2.value;
	theForm.StateCode.value = "";
    }
    else if(theForm.UserSpecified3 && theForm.UserSpecified3.checked ==true)
    {
        theForm.CityName.value = theForm.SpecifiedCity3.value;
		if(theForm.StateCode_temp)
		{
		    theForm.StateCode.value = theForm.StateCode_temp.value;
		}
	        else{
		    theForm.StateCode.value = "";
		}
        //theForm.CountryCode.value="";
    }
    if(validateSearchForm(theForm))
    {
       //theForm.submit();
	   return true;
    }
	else{
		return false;
	}
}
function clearSpecifiedCity()
{
    theForm = document.Main_Search
    theForm.UserSpecified.checked = false;
    theForm.SpecifiedCity.value = "";
	if(theForm.StateCode)
	{
		theForm.StateCode.value="";
	}
	if(theForm.CountryCode)
	{
		theForm.CountryCode.value="";
	}
	
}

function clearSpecifiedCity2()
{
    theForm = document.Main_Search
    theForm.UserSpecified2.checked = false;
    theForm.SpecifiedCity2.value = "";
	if(theForm.StateCode)
	{
		theForm.StateCode.value="";
	}
	if(theForm.CountryCode)
	{
		theForm.CountryCode.value="";
	}
	
}
function clearSpecifiedCity3()
{
    theForm = document.Main_Search
    theForm.UserSpecified3.checked = false;
    theForm.SpecifiedCity3.value = "";
	if(theForm.StateCode)
	{
		theForm.StateCode.value="";
	}
	if(theForm.CountryCode)
	{
		theForm.CountryCode.value="";
	}
	
}

