function switchGroup () {
 var myGroup = document.searchform.group.selectedIndex;
 var myValue = document.searchform.group.options[myGroup].value;
 if (myValue > 100) {
 myURL = "c=" + document.searchform.group.options[myGroup].text}
 else {
 myURL = "p=" + document.searchform.group.options[myGroup].text};
 document.location = document.location.pathname + "?" + myURL};

function checkCity () {
	var myCity = document.searchform.area.selectedIndex;
	var myValue = document.searchform.area.options[myCity].value;
	if (myValue.substr (0,1) == "!") {
		myURL = "c=" + myValue.substr(1);
		document.location = document.location.pathname + "?" +  myURL}};

		function switchGroup () {
			var myGroup = document.searchform.group.selectedIndex;
			var myValue = document.searchform.group.options[myGroup].value;
			if (myValue > 100) {
				myURL = "c=" + document.searchform.group.options[myGroup].text}
			else {
				myURL = "p=" + document.searchform.group.options[myGroup].text};
			document.location = document.location.pathname + "?" +  myURL};

function toggle(layerID) {
	var myDiv = document.getElementById (layerID);
	if (myDiv.style.display == 'none') {
		myDiv.style.display = 'block';
		editform.red_cross.checked = true}
	else {
		myDiv.style.display = 'none';
		editform.red_cross.checked = false}};


function showDiv(divName) {
	var objDivStyle = document.getElementById(divName).style;
	objDivStyle.display = 'block';
	objDivStyle.visibility = 'visible'};
function hideDiv(divName) {
	var objDivStyle = document.getElementById(divName).style;
	objDivStyle.display = 'none';
	objDivStyle.visibility = 'hidden'};
function toggleGMapiens() {
	var objDivStyle = document.getElementById('restaurant').style;
	if (objDivStyle.visibility == 'visible') {
		showDiv('XgoogleMap');
		GLoad();
		hideDiv('restaurant')}
	else {
		GUnload();
		hideDiv('XgoogleMap');
		showDiv('restaurant')}}

    function updateCitySearch(search,input,div,select,e) {

      var keycode;

      if (window.event) 
        keycode = window.event.keyCode;
      else if (e) 
        keycode = e.which;

      if(keycode==40) {
        document.getElementById(select).focus();
      } else if(keycode==13) {
        toCityPage();
      } else {
        ajaxCall('/ajax.php?data=citycomplete&input='+input+'&select='+select+'&search='+search,div);
      }

    }
    
    function toCityPage() {
      document.forms['cityfind'].action='/restaurant/'+document.getElementById(select).value;
    }