if (document.images) {
	var activado = new Array();
	var desactivado = new Array();
	for (i=0; i<=7; i++) {
		desactivado["bt"+i] = new Image();
		desactivado["bt"+i].src = "imagenes/menu_principal/bt_"+i+"_off.jpg";
		activado["bt"+i] = new Image();
		activado["bt"+i].src = "imagenes/menu_principal/bt_"+i+"_on.jpg";
	}
}

function comprobar_direcciones(){
	e1=document.getElementById('email').value;
	e2=document.getElementById('email_2').value;
	n=document.getElementById('nombre').value;
	a=document.getElementById('apellidos').value;
	t=document.getElementById('tienda').value;
	if ((n!="")&&(a!="")&&(t!="")){
		if ((e1==e2)&&(e1!="")) {
			document.getElementById('f').submit();
		} else alert('Les adreces de correu electrónic han de ser iguals.');
	} else alert('(*) Camps obligatoris.');
}

function eliminar(i) {
	id=document.getElementById('id_'+i).value;
	if (document.getElementById('tipo_'+i)!=undefined){
		id_tipo=document.getElementById('tipo_'+i).value;
	} else id_tipo="";
	if (id_tipo!=""){
		self.location="ver_carrito.php?accion=eliminar&id="+id+"&id_tipo="+id_tipo;
	} else self.location="ver_carrito.php?accion=eliminar&id="+id;	
}

function act(nombreImagen) {
	if (document.images){
		document[nombreImagen].src=activado[nombreImagen].src;
	}
}

function desact(nombreImagen) {
	if (document.images){
		document[nombreImagen].src=desactivado[nombreImagen].src;
	}
}

function cambiar_subcategoria(opcion,id_producto,valor) {
	//if (id_producto!=""){
	//	self.location="index.php?opcion="+opcion+"&id_producto="+id_producto+"&id_subcategoria="+valor+"\n";
	//} else
	if (valor==0){
		self.location="index.php?opcion="+opcion+"\n";
	} else self.location="index.php?opcion="+opcion+"&id_subcategoria="+valor+"\n";
}

function load() {
	if (GBrowserIsCompatible()) {
		//map.setMapType(G_SATELLITE_TYPE);
		var map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl()); 
		map.addControl(new GMapTypeControl());       
		map.setCenter(new GLatLng(42.098891, 2.225204), 10);
	
		//asturias
		var point = new GPoint(2.225204,42.098891);
		var marker = new GMarker(point);
		map.addOverlay(marker);
		
		map.setMapType(G_HYBRID_TYPE);
	}
}