//funcion contra el spam
function antispam(cuenta,clase)
{
var dominio = "podemar.com"
document.write("<a class='"+ clase +"' href=\"mailto:" + cuenta + "@" + dominio + "\">" + cuenta + "@" + dominio + "</a>");
}


//funcion para google maps
var map;
function onLoad() {
	if (GBrowserIsCompatible()){
		map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());
		map.setCenter(new GLatLng(36.77202135586331, -2.810976505279541), 16);
		map.addControl(new GMapTypeControl());
		
		var icon = new GIcon();
		icon.image = "./imagenes/log.png";
		
		icon.iconSize = new GSize(40, 40);
		icon.shadowSize = new GSize(40, 40);
		
		icon.iconAnchor = new GPoint(15, 35);
		icon.infoWindowAnchor = new GPoint(20, 25);
		
		
		function createMarker(point,html,icono) {
			html = "<div >" + html + "<\/div>";
			var marker = new GMarker(point,icono);
		
			GEvent.addListener(marker, "click", function() {
				if (map.getZoom()<17){
				map.setCenter(point, 17);
				}
			});
		
			GEvent.addListener(marker, "mouseover", function() {
				marker.openInfoWindow(html);
			});
		
			GEvent.addListener(marker, "dblclick", function() {
				if (map.getZoom()<17){
					map.setCenter(point, 17);
				}
			});
		
		// Guardo la informacion de ese punto en arrays.
			//gmarkers[id] = marker;
			//htmls[id] = html;
		//i++;
		return marker;
		}
		
		var punto = new GLatLng(36.77202135586331, -2.810976505279541);
		var marca = createMarker(punto,"<br/>Paseo Pedro Ponce, 4 1&ordf; Planta Oficina C <br/>04700 El Ejido (Almer&iacute;a) <br/><br/>Telf.: +34 950 48 78 96<br/>Fax.: +34 950 57 21 31<br/><br/>E-mail:<b><a href='mailto:comercial@podemar.com' class='enlacepie'>comercial@podemar.com<\/a><\/b><br/>&nbsp;<br/>",icon);
		map.addOverlay(marca);
	}
}


function colocarventana(){
	var puntoprincipal = document.getElementById("capa_pagina");
	//extraemos la posicion de la capa capa_pagina
	ejex = puntoprincipal.offsetLeft;
	//colocamos la capa ventana en la posicion x de la capa pagina
	var posicionarcapa = document.getElementById("ficha");

	posicionarcapa.style.left=ejex+"px";
	posicionarcapa.style.top="289px";
}


var botonactivo;
botonactivo = "b0";

function controlboton(boton,accion){		
	var actual;
	actual = document.getElementById(boton);
	
	if(botonactivo != boton){
		if(accion == "mostrar"){
			actual.src='./imagenes/' + boton + 'on.gif';
			
		}
		if(accion == "ocultar"){
			actual.src='./imagenes/' + boton + '.gif';
		}
	}	
}

function cambioboton(boton){
	var actual;
	var anterior;
	
	actual = document.getElementById(boton);
	anterior = document.getElementById(botonactivo);
	
	if(botonactivo != "b0"){
		anterior.src='./imagenes/'+ botonactivo +'.gif';
	}
	actual.src='./imagenes/'+ boton +'on.gif';


	
	botonactivo = boton;
}