
    var map;
    var geocoder;
    var address;
	 var tipoMapa = 0;

	 var texto_datos;	 

    function initialize(tipo) {

      map = new GMap2(document.getElementById("canva_mapas"));
		
    	pointAdresse = new GLatLng(lat, lng);
		
		if(tipo==0)
      	map.setCenter(pointAdresse, 7);
		else
      	map.setCenter(pointAdresse, 10);		
		
      map.setUIToDefault();
		
	   geocoder = new GClientGeocoder();
	
	//	map.addControl(new GLargeMapControl());

		tipoMapa = 1;
		
		var extension = "png";
   		
		icon = new GIcon();
		if(tipo==0)
			icon.image = "http://oftex.es/img/ico_mapa." + extension;
		else
			icon.image = "http://oftex.es/img/ico_mapa." + extension;
		icon.iconSize = new GSize(20, 24);
		icon.shadowSize = new GSize(20, 24);
		icon.iconAnchor = new GPoint(10, 34);
		icon.infoWindowAnchor = new GPoint(5, 1);

    	map.checkResize();
            
    //	addMarker(lat, lng, icon);

      geocoder = new GClientGeocoder();
            
      map.checkResize();
            
        
	}
	
	    function createMarker(latlng,img) {
	      number++;
	      var marker = new GMarker(latlng,{ icon:img });
			bounds.extend(marker.getPoint());


	      return marker;
		}
	
		function addMarker(latGM,lngGM,img) {
		    var latlng = new GLatLng(latGM, lngGM);
			 var marker =  createMarker(latlng,img);
		    map.addOverlay(marker); 

	 
			 return marker;
		}
		
		function toggleMarker(nomMarker,opt) {

			if (markers[nomMarker]){ //vérifier que le marker existe ! sinon erreur javascript
				if(opt == "hide")
					markers[nomMarker].hide();
				else if(opt == "show"){
					markers[nomMarker].show();
				}
			}
	    }



var direccion = "";
function obtenerDatos(marker,point,id,nombre){
	
	

//	marker.openInfoWindowHtml(nombre);
	document.location = 'ficha_pais.php?id='+id;

}




	function mostrarSubmenu(cont,total){

			for(i=0;i<total;i++)
				$(document.getElementById('txt_faqs_'+i)).slideUp();
		
			if ($(document.getElementById('txt_faqs_'+cont)).is(":hidden")) {
			  $(document.getElementById('txt_faqs_'+cont)).slideDown("slow");
			} else {
			  $(document.getElementById('txt_faqs_'+cont)).slideUp();
			}		
		
	}
	
	function abrirMapa(){
		window.open("http://maps.google.es/maps?f=q&source=s_q&hl=es&geocode=&q=Carrer+Jaume+I,+31,+03550+San+Juan+de+Alicante,+Alicante,+Comunidad+Valenciana&sll=38.396316,-0.43396&sspn=0.002901,0.004823&ie=UTF8&hq=&hnear=Carrer+Jaume+I,+31,+03550+San+Juan+de+Alicante,+Alicante,+Comunidad+Valenciana&t=h&z=16");
	}
	
	function abrirDocumento(archivo){
		window.open("descarga.php?archivo=img/manual/"+archivo+"&nom="+archivo);
	}
	
	
		function mostrarArea(){

			if ($(document.getElementById('bloque_area')).is(":hidden")) {
			  $(document.getElementById('bloque_area')).slideDown("slow");
			} else {
			  $(document.getElementById('bloque_area')).slideUp();
			}		
		
	}
	
		function comprobarValor(valor,tipo){
		if(valor == ""){
			if(tipo==1) //usuario
				document.acceso_area.usuario.value='Usuario';
			else{
				document.acceso_area.password.value='Contraseña';			
				document.acceso_area.password.type='text';
			}
		}
		
	}
	
	function QuitarValor(valor,tipo){

			if(tipo==1 && valor=="Usuario"){ //usuario
				document.acceso_area.usuario.value='';
			}
			else if(tipo==2 && valor=="Contraseña"){
				document.acceso_area.password.value='';			
				document.acceso_area.password.type='password';
		}
		
	}	
	
	
	function mostrarArchivos(cont,total){



			for(i=1;i<=total;i++){
				$(document.getElementById('contenido_descarga_'+i)).slideUp();
				document.getElementById('fila_'+i).className='fila_categoria_descarga ';
			}
		
			if ($(document.getElementById('contenido_descarga_'+cont)).is(":hidden")) {
			  $(document.getElementById('contenido_descarga_'+cont)).slideDown("slow");
  				document.getElementById('fila_'+cont).className='fila_categoria_descarga fila_categoria_sel';			  
			} else {
			  $(document.getElementById('contenido_descarga_'+cont)).slideUp();
			}		
		
	}	
	

	function mostrarFilial(cont,total){

			for(i=0;i<total;i++){
				$(document.getElementById('opcion_'+i)).slideUp();
				document.getElementById('tit_filial_'+i).className='titulo_filial';				
			}
		
			if ($(document.getElementById('opcion_'+cont)).is(":hidden")) {
			  $(document.getElementById('opcion_'+cont)).slideDown("slow");
				document.getElementById('tit_filial_'+cont).className = 'titulo_filial tit_filial_sel';										  
			} else {
			  $(document.getElementById('opcion_'+cont)).slideUp();
			document.getElementById('tit_filial_'+cont).className = 'titulo_filial';										  
			}		
			

		
	}	
