function elementVisibility(element) {
	visible = document.getElementById(element).style.display;
	
	if(visible == "none") document.getElementById(element).style.display="block";
	else document.getElementById(element).style.display="none";
}

function flashBanner() {
	var banner = "<object width='968' height='212' data='./design/header.swf' type='application/x-shockwave-flash'><param value='./design/header.swf' name='movie' /><param name='wmode' value='transparent' /></object>";
							
	document.getElementById("header").innerHTML = banner;
}

function emptyInp(element) {
	document.getElementById(element).value = "";
}

function submitForm(element) {
	document.getElementById(element).submit();
}

function showAddress(address, title, zoom, id, icon_ext, width, height) {
  var map = new GMap2(document.getElementById("map_canvas"));
  var geocoder = new GClientGeocoder();
  var WINDOW_HTML = '<div style="font-size:11px;"><strong>'+title+'</strong><br />'+address+'<\/div>';
  
  map.addControl(new GSmallMapControl());
  
  geocoder.getLatLng(
    address,
    function(point) {
      if (!point) {
        //alert(address + " not found");
      } else {
        map.setCenter(point, zoom);
        
        if(icon_ext != "") {
          var myIcon = new GIcon(G_DEFAULT_ICON);
          myIcon.image = "/images/articles/icons/"+id+"."+icon_ext;
  		    myIcon.iconSize = new GSize(width, height);
  		    myIcon.iconAnchor = new GPoint(width/2, height);
  		    myIcon.shadow = "";
  		    
      		// Set up our GMarkerOptions object
      		markerOptions = { icon:myIcon };
      		
      		var marker = new GMarker(point, markerOptions);
        
        } else {
          var marker = new GMarker(point);
        }
        
        map.addOverlay(marker);
        GEvent.addListener(marker, "click", function() {
        	marker.openInfoWindowHtml(WINDOW_HTML);
	      });
      }
    }
  );
}

function showAddress2(address, title, zoom, id, icon_ext, width, height) {
	  var map = new GMap2(document.getElementById("map_canvas2"));
	  var geocoder = new GClientGeocoder();
	  var WINDOW_HTML = '<div style="font-size:11px;"><strong>'+title+'</strong><br />'+address+'<\/div>';
	  
	  map.addControl(new GSmallMapControl());
	  
	  geocoder.getLatLng(
	    address,
	    function(point) {
	      if (!point) {
	        //alert(address + " not found");
	      } else {
	        map.setCenter(point, zoom);
	        
	        if(icon_ext != "") {
	          var myIcon = new GIcon(G_DEFAULT_ICON);
	          myIcon.image = "/images/articles/icons/"+id+"."+icon_ext;
	  		    myIcon.iconSize = new GSize(width, height);
	  		    myIcon.iconAnchor = new GPoint(width/2, height);
	  		    myIcon.shadow = "";
	  		    
	      		// Set up our GMarkerOptions object
	      		markerOptions = { icon:myIcon };
	      		
	      		var marker = new GMarker(point, markerOptions);
	        
	        } else {
	          var marker = new GMarker(point);
	        }
	        
	        map.addOverlay(marker);
	        GEvent.addListener(marker, "click", function() {
	        	marker.openInfoWindowHtml(WINDOW_HTML);
		      });
	      }
	    }
	  );
	}