var geocoder;

function irA(atras,nueva){
	if(atras=="true"){
		history.back();
	}else if(atras=="false" && nueva!=""){
		document.location=nueva;
	}
}

function verImg(dire,ancho,alto,scrollB,centrar,titulo){ 
	if(ancho==0 && alto!=0){
		ancho=screen.width-20;
	}else if(alto==0 && ancho!=0){
		alto=screen.height-60;
	}else if(ancho==0 && alto==0){
		ancho=screen.width-20;
		alto=screen.height-60;
	} 
	altura=0;
	if(centrar=="si"){
		altura=(screen.height-alto)/2;
	}
	anchura=(screen.width-ancho)/2;
	var opt="height="+alto+",width="+ancho+",location=no,status=no,menu=no,scrollbars="+scrollB+",top="+altura+",left="+anchura+"";
	window.open(dire,"_new",opt);
}

function findLocation(direccion) {
	geocoder.getLocations(direccion, addAddressToMap);
}

function addAddressToMap(response) {
	map.clearOverlays();
	if (!response || response.Status.code != 200) {
		map.openInfoWindowHtml(map.getCenter(),"<strong style='color:#ee3a42;font-size:12px;'>Direcci&oacute;n no encontrada</strong>");
	} else {
		place = response.Placemark[0];
		point = new GLatLng(place.Point.coordinates[1],
		place.Point.coordinates[0]);
		map.setCenter(new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]), 15);
		marker = new GMarker(point);
		map.addOverlay(marker);
		marker.openInfoWindowHtml(
		
		"<div class='colorletras_alojamiento_mostrado_direccion'>" + hotel_aux + "</div><div class='colorletras_alojamiento_mostrado_direccion'>" + direccion_aux + "</div>"
		);
	}
}

function mostrar_capa_ms(capa,direccion, nombre_hotel) {
	var IE;
	var posicionratonY=0;
	
	IE = (document.all)?true:false;
	
	if (IE) {
		posicionratonY = document.body.scrollTop;
	} else {
		posicionratonY = document.body.scrollTop;
	}
	
	ocultar_select();
	
	hotel_aux = nombre_hotel;
	direccion_aux = direccion;
	
	if(document.getElementById) {
		obj=document.getElementById(capa);
		document.getElementById('nhotel').innerHTML = hotel_aux;
	} else if(document.all) {
		obj=document.all[capa];
	}
	
	hcapa = obj.style.height; ///PARA CONTROLAR QUE LA CAPA SALGA A LA MITAD DEL MOSTRAR MAPA
	hcapa = hcapa.replace("px","");
	hpag = screen.height;
	
	posicionratonY = posicionratonY + (hpag/2) - (hcapa/2);
	
	wcapa = obj.style.width;
	wcapa = wcapa.replace("px","");
	wpag  = screen.width;
	
	separacion = (wpag/2) - (wcapa/2);
	
	obj.style.left = separacion + "px";
	obj.style.top = posicionratonY + "px";
	obj.style.display = "block";
	
	map = new GMap2(document.getElementById("map"));
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	map.setCenter(new GLatLng(36.721504, -4.420184), 15); // Por defecto si no encuentra la dirección se posiciona en el centro de madrid
	
	geocoder = new GClientGeocoder();
	
	findLocation(direccion);
}
function mostrar_capa_ms_lat_long(capa,direccion, nombre_hotel,latitud,longitud) {
	var IE;
	var posicionratonY=0;
	
	IE = (document.all)?true:false;
	
	if (IE) {
		posicionratonY = document.body.scrollTop;
	} else {
		posicionratonY = document.body.scrollTop;
	}
	
	ocultar_select();
	
	hotel_aux = nombre_hotel;
	direccion_aux = direccion;
	
	if(document.getElementById) {
		obj=document.getElementById(capa);
		document.getElementById('nhotel').innerHTML = hotel_aux;
	} else if(document.all) {
		obj=document.all[capa];
	}
	
	hcapa = obj.style.height; ///PARA CONTROLAR QUE LA CAPA SALGA A LA MITAD DEL MOSTRAR MAPA
	hcapa = hcapa.replace("px","");
	hpag = screen.height;
	
	posicionratonY = posicionratonY + (hpag/2) - (hcapa/2);
	
	wcapa = obj.style.width;
	wcapa = wcapa.replace("px","");
	wpag  = screen.width;
	
	separacion = (wpag/2) - (wcapa/2);
	
	obj.style.left = separacion + "px";
	obj.style.top = posicionratonY + "px";
	obj.style.display = "block";
	
	map = new GMap2(document.getElementById("map"));
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	geocoder = new GClientGeocoder();
	if(latitud!='' && longitud!=''){
		point = new GLatLng(latitud,longitud);
		map.setCenter(point, 15);
		marker = new GMarker(point);
		map.addOverlay(marker);
		marker.openInfoWindowHtml("<div class='colorletras_alojamiento_mostrado_direccion'>" + nombre_hotel + "</div><div class='colorletras_alojamiento_mostrado_direccion'>" + direccion + "</div>");

	}else{
		map.setCenter(new GLatLng(36.721504, -4.420184), 15); // Por defecto si no encuentra la direcciï¿½n se posiciona en el centro de madrid
		findLocation(direccion);

	}
	
}

function tratar(formulario){
	//tratar fecha del proyecto		
	correcto=true;
	alertado=false;
	control=document[formulario].noches.value;	
	if(control.length==0||control==0){
		correcto=false;
		alert("No ha introducido numero de noches o es igual a 0.");
	}	
	control=document[formulario].fecha0.value;
	if(control.length==0||control==0){
		correcto=false;
		alert("No ha introducido fecha de entrada.");
	}
	control=document[formulario].napartamentos.value;
	if(control.length==0||control==0){
		correcto=false;
		alert("No ha introducido el numero de apartamentos o es igual a 0.");
	}	
	control=document[formulario].tapartamentos.value;
	if(control.length==0){
		correcto=false;
		alert("No ha introducido el tipo de apartamento");
	}
	control=document[formulario].adultos.value;
	if(control.length==0||control==0){
		correcto=false;
		alert("No ha introducido el numero de adultos o es igual a 0");
	}
	control=document[formulario].ninos.value;
	if (control.length==0||control==0){	
	}else{
		for(i=0;i<control;i++){
		control2=document[formulario]['edad'+i].value;		
		if((control2.length==0||control2==0) && (alertado==false)){
			correcto=false;
			alertado=true;			 
			alert("No ha introducido la edad de los niños correctament o es igual a 0");
			//break();
			}
		}
	}
	//tratar=correcto;
	return correcto;
	
}

function Portada(id_h,obj,Tabla,Campo){
var opt="height='100',width='100',location=no,status=no,menu=no,scrollbars=no,target='_blank'";

dire="addPortada.asp?id_h=" + id_h + "&id=" + obj.value + "&Tabla=" + Tabla + "&Campo=" + Campo;
window.open(dire,"_new",opt);
}		

function seleccionar(tr,color,especial){
	tr.style.backgroundColor=color;
	tr.style.color="#FFFFFF";
	if(especial!="0"){
		//alert(especial);
		especial.style.backgroundColor=color;
		especial.style.color="#FFFFFF";
		tractivar.style.backgroundColor=color;		
	}
}

function deseleccionar(tr,color,especial){

	tr.style.backgroundColor=color;
	tr.style.color=color;
	if(especial!="0"){
		especial.style.backgroundColor=color;
		especial.style.color=color;
		tractivar.style.backgroundColor="#CABFB9";
	}
}

function irG (dire,campo,obj){
	
document.location=dire + "?" + campo + "=" + obj.value;
}

function acceptNum(evt){	
var nav4 = window.Event ? true : false;
// NOTE: Backspace = 8, Enter = 13, '0' = 48, '9' = 57	
var key = nav4 ? evt.which : evt.keyCode;	
return (key <= 13 || (key >= 48 && key <= 57));
}


/*
function Abrir_Ventana(pagina,ancho,alto)
{
	
	var adj=10
	var w = screen.width;
	var h = screen.height;
	var byFactor=1;
	if(w<740){
	  var lift=0.90;
	}
	if(w>=740 & w<835){
	  var lift=0.91;
	}
	if(w>=835){
	  var lift=0.93;
	}
	if (ancho>w){	
	  byFactor = w / ancho;			
	  ancho = w;
	  alto = ancho * byFactor;
	}
	if (alto>h-adj){
	  byFactor = h / alto;
	  ancho = (ancho * byFactor);
	  alto = h; 
	}
	   
	var scrWidth = w-adj;
	var scrHeight = (h*lift)-adj;

	if (alto>scrHeight){
  	  alto=alto*lift;
	  ancho=ancho*lift;
	}

	var posLeft=0;
	var posTop=0;


	var scrHeightTemp = alto - 0;
	if (scrHeightTemp < scrHeight) {
	scrHeight = scrHeightTemp;
	} 
	var scrWidthTemp = ancho - 0;
	if (scrWidthTemp < scrWidth) {
	scrWidth = scrWidthTemp;
	}
	
	if (scrHeight<100){scrHeight=100;}
	if (scrWidth<100){scrWidth=100;}
	
	
	posTop =  ((h-(scrHeight/lift)-adj)/2);
	posLeft = ((w-(scrWidth)-adj)/2);

	if (alto > (h*lift)-adj || ancho > w-adj){
		alto=alto-adj;
		ancho=ancho-adj;
	}
	posTop = parseInt(posTop);
	posLeft = parseInt(posLeft);			
	window.open(pagina,'_new',"HEIGHT='" +alto+ "',WIDTH='" +ancho+ "',TOOLBAR=no,MENUBAR=no,SCROLLBARS=no,RESIZABLE=no,LOCATION=no,DIRECTORIES=no,STATUS=no,left='"+posLeft+"',top='"+posTop);
}*/

function borrarImagen(direccion,identificador,nombreFoto,tipo){
	var opt="";
	var newDireccion="";
	newDireccion=direccion;
	newDireccion=newDireccion.replace("&","!");
	newDireccion=newDireccion.replace("?","@");
	respuesta=confirm("La acción borrará la foto asociada. ¿Desea continuar?");
	if(respuesta==true){
		window.open("delFoto.asp?idf="+identificador+"&nomf="+nombreFoto+"&volver="+newDireccion+"&tipo="+tipo,"_self",opt);
	}
}
function enviarProducto(dire,identificador,tipo,abrir){
	//var opt="";				
		window.open( dire + "?id="+identificador+"&estado="+tipo,abrir,"status=yes,resizable=no,width=515,height=440");
	
}
function MostrarImagen(imageName,imageWidth,imageHeight,alt,bgcolor,hugger,hugMargin) {
	if (bgcolor=="") {
		bgcolor="#FFFFFF";
	}
	var adj=10
	var w = screen.width;
	var h = screen.height;
	var byFactor=1;

	if(w<740){
	  var lift=0.90;
	}
	if(w>=740 & w<835){
	  var lift=0.91;
	}
	if(w>=835){
	  var lift=0.93;
	}
	if (imageWidth>w){	
	  byFactor = w / imageWidth;			
	  imageWidth = w;
	  imageHeight = imageHeight * byFactor;
	}
	if (imageHeight>h-adj){
	  byFactor = h / imageHeight;
	  imageWidth = (imageWidth * byFactor);
	  imageHeight = h; 
	}
	   
	var scrWidth = w-adj;
	var scrHeight = (h*lift)-adj;

	if (imageHeight>scrHeight){
  	  imageHeight=imageHeight*lift;
	  imageWidth=imageWidth*lift;
	}

	var posLeft=0;
	var posTop=0;

	if (hugger == "hug image"){
	  if (hugMargin == ""){
	    hugMargin = 0;
	  }
	  var scrHeightTemp = imageHeight - 0 + 2*hugMargin;
	  if (scrHeightTemp < scrHeight) {
		scrHeight = scrHeightTemp;
	  } 
	  var scrWidthTemp = imageWidth - 0 + 2*hugMargin;
	  if (scrWidthTemp < scrWidth) {
		scrWidth = scrWidthTemp;
	  }
	  
	  if (scrHeight<100){scrHeight=100;}
	  if (scrWidth<100){scrWidth=100;}

	  posTop =  ((h-(scrHeight/lift)-adj)/2);
	  posLeft = ((w-(scrWidth)-adj)/2);
 	}

	if (imageHeight > (h*lift)-adj || imageWidth > w-adj){
		imageHeight=imageHeight-adj;
		imageWidth=imageWidth-adj;
	}
	posTop = parseInt(posTop);
	posLeft = parseInt(posLeft);		
	scrWidth = parseInt(scrWidth); 
	scrHeight = parseInt(scrHeight);
	
	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("opera") != -1){
	  var args= new Array();
	  args[0]='parent';
	  args[1]=imageName;
	  var i ; document.MM_returnValue = false;
	  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
	} else {
	newWindow = window.open("imagen_ampliada.php","newWindow","width="+scrWidth+",height="+scrHeight+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><head><meta http-equiv="imagetoolbar" content="no"><meta http-equiv="pragma" content="no-cache"><script language="Javascript">var TimeID;function timer() {window.clipboardData.clearData(); timeID = setTimeout("timer()", 100);  } </script><script type="text/javascript" language="Javascript"> document.oncontextmenu = function(){return false} </script> <title>'+alt+'</title><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor='+bgcolor+' onLoad="timer()" oncontextmenu="return false" ondragstart="return false" onselectstart="return false" onkeydown="return false" onBlur="self.close()" onClick="self.close()">');  
	newWindow.document.write('<table width='+imageWidth+' border="0" cellspacing="0" cellpadding="0" align="center" height='+scrHeight+' ><tr><td>');
	newWindow.document.write('<img src="'+imageName+'" width='+imageWidth+' height='+imageHeight+' alt="haz click aquí para cerrar" >'); 
	newWindow.document.write("</td></tr></table></body></html>");
	newWindow.document.close();
	newWindow.focus();
	}
}


function escribeCapa(capa,texto){ 
document.getElementById(capa).innerHTML=texto; 
} 




/*
function validar_fecha(caja){ 
   if (caja){  
      borrar = caja;
      if ((caja.substr(2,1) == "/") && (caja.substr(5,1) == "/")){      
         for (i=0; i<10; i++){	
            if (((caja.substr(i,1)<"0") || (caja.substr(i,1)>"9")) && (i != 2) && (i != 5)){
               borrar = '';
               break;  
			}  
         }
	     if (borrar){ 
	        a = caja.substr(6,4);
		    m = caja.substr(3,2);
		    d = caja.substr(0,2);
		    if((a < 1900) || (a > 2050) || (m < 1) || (m > 12) || (d < 1) || (d > 31))
		       borrar = '';
		    else{
		       if((a%4 != 0) && (m == 2) && (d > 28))	   
		          borrar = '';
			   else{
		          if ((((m == 4) || (m == 6) || (m == 9) || (m==11)) && (d>30)) || ((m==2) && (d>29)))
			         borrar = '';	      				  	 
			   }
		    }
         }
      }
	  else
	     borrar = '';
	  if (borrar == '')
	     alert('Debe Introducir una fecha con este formato "dd/mm/yyyy"');
   }
}
function ReplaceCaracter(inputString, fromString, toString) {
   // Goes through the inputString and replaces every occurrence of fromString with toString
   var temp = inputString;
   if (fromString == "") {
      return inputString;
   }
   if (toString.indexOf(fromString) == -1) { // If the string being replaced is not a part of the replacement string (normal situation)
      while (temp.indexOf(fromString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(fromString));
         var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
         temp = toTheLeft + toString + toTheRight;
      }
   } else { // String being replaced is part of replacement string (like "+" being replaced with "++") - prevent an infinite loop
      var midStrings = new Array("~", "`", "_", "^", "#");
      var midStringLen = 1;
      var midString = "";
      // Find a string that doesn't exist in the inputString to be used
      // as an "inbetween" string
      while (midString == "") {
         for (var i=0; i < midStrings.length; i++) {
            var tempMidString = "";
            for (var j=0; j < midStringLen; j++) { tempMidString += midStrings[i]; }
            if (fromString.indexOf(tempMidString) == -1) {
               midString = tempMidString;
               i = midStrings.length + 1;
            }
         }
      } // Keep on going until we build an "inbetween" string that doesn't exist
      // Now go through and do two replaces - first, replace the "fromString" with the "inbetween" string
      while (temp.indexOf(fromString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(fromString));
         var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
         temp = toTheLeft + midString + toTheRight;
      }
      // Next, replace the "inbetween" string with the "toString"
      while (temp.indexOf(midString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(midString));
         var toTheRight = temp.substring(temp.indexOf(midString)+midString.length, temp.length);
         temp = toTheLeft + toString + toTheRight;
      }
   } // Ends the check to see if the string being replaced is part of the replacement string or not
   return temp; // Send the updated string back to the user
} // Ends the "replaceSubstring" function*/






//==========================================================================================
// descripcion: Genera número aleatorios entre un número inicial y un número final
//==========================================================================================
function Aleatorio(limite,inicio){
	return Math.floor(Math.random()*limite)+ inicio;
}

//==========================================================================================
// descripcion: Cambia el src de una imagen y le asigna el valor de mostrada (1) en una matriz
//==========================================================================================
function randomImage(minimo,maximo,destino,ruta){
	var imgSrc, r;
	r = Aleatorio(maximo,minimo);
	i=r;
	iteraciones=0;
		//Si al imagen ya se muestra, busca la siguiente foto q no se esta mostrando.
		while(mostrando[i-1]==1){
		iteraciones++;
		i++;
		r = i;
		if(i>maximo){
			i=1;
			r=i;
		}
		if(iteraciones>200){break;}
	}
	numero=r.toString();
	//if(numero.length==1){numero="0" + numero;}
	imgSrc = numero+".jpg";	
	document.all[destino].src = ruta + imgSrc;
	mostrando[r-1]=1;
}

//==========================================================================================
// descripcion: Cambia cada cierto tiempo el src de varias imágenes y al final resetea los valores de muestra (1 --> 0)
//==========================================================================================
function temporizador(first,minimoT,maximoT,destinoT,cuantasT,rutaT){
	//for(j=1;j<=cuantasT;j++){
		randomImage(minimoT,maximoT,destinoT + first,rutaT);		
	//}
	for(k=0;k<mostrando.length;k++){
		mostrando[k]="0";
	}
}

function Aleatorio(limite,inicio){
	return Math.floor(Math.random()*limite)+ inicio;
}


function poner(obj){
	obj.src=obj.src.replace(".jpg","Sobre.jpg");
}
	
function quitar(obj){
	obj.src=obj.src.replace("Sobre.jpg",".jpg");
}



/****************************************************************************************************/
/* Funciones para Ajax																				*/
/****************************************************************************************************/
	function creaAjax(){
	  var objetoAjax=false;
	  try{
	    //Para navegadores distintos a ie
	    objetoAjax=new ActiveXObject("Msxml12.XMLHTTP");
	  }catch(e){
	    try{
	      // Para ie
	      objetoAjax = new ActiveXObject("Microsoft.XMLHTTP");
	    }catch (e) {
	      objetoAjax = false;
	    }
	  }
	  if (!objetoAjax && typeof XMLHttpRequest !='undefined'){
	    objetoAjax = new XMLHttpRequest();
	  }
	  return objetoAjax;
	}

	function FAjax (url,capa,valores,metodo){
		//alert("FAJAX : "+url);
		var ajax=creaAjax();
	   var capaContenedora = document.getElementById(capa);
		
		if(metodo.toUpperCase()=='POST'){
	   	ajax.open ('POST', url, true);
	      ajax.onreadystatechange = function() {
	   	   if (ajax.readyState==1) {
	      		capaContenedora.innerHTML="Cargando.......";
	      	}else if (ajax.readyState==4){
	      		if(ajax.status==200){
		      		 	
		         	document.getElementById(capa).innerHTML=ajax.responseText;
					}else if(ajax.status==404){
						capaContenedora.innerHTML = "La direccion no existe";
	         	}else{
		         	capaContenedora.innerHTML = "Error: "+ajax.status;
	   	      }
	      	}
	   	}
	   	if (ajax.overrideMimeType) {
	   		ajax.overrideMimeType('text/http; charset=iso-8859-1');
	   	}
	   	ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset:ISO-8859-1');   	
		   ajax.send(valores);
	      return;
	   }
		if (metodo.toUpperCase()=='GET'){
			ajax.open ('GET', url, true);
	      ajax.onreadystatechange = function() {
	         if (ajax.readyState==1) {
	         	capaContenedora.innerHTML="";
	         }else if (ajax.readyState==4){
	         	if(ajax.status==200){
	            	document.getElementById(capa).innerHTML=ajax.responseText;
	            }else if(ajax.status==404){
	            	capaContenedora.innerHTML = "La direccion no existe";
	           	}else{
	           		capaContenedora.innerHTML = "Error: "+ajax.status;
	            }
	         }
	      }
	      ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	      ajax.send(null);
	      return
		}
	}

	function actualizar(divName,fichero,tipo,parametros){
		FAjax (fichero, divName, parametros, tipo);	
	}


	
	
	function mostrarDescHotel(div,id,integracion){
		var mostrar = document.getElementById(div);
		//var x =document.getElementById('mousePositionX').value;
		//var y =document.getElementById('mousePositionY').value;
		var x;
		var y;
		if(window.innerWidth){
		 	x = window.innerWidth /2;
		        y = window.innerHeight /2;

		}else{
			x = document.body.offsetWidth / 2;
			y = document.body.offsetHeight /2;
		}

		FAjax ("temp/mostrarDivHotelDescripcion.php?estado=CARGANDO",div,'','GET');
		
		mostrar.style.left =x -400;
		var tempY = y -300 + document.body.scrollTop;
		if(tempY<10){ /* Margen minimo superior */
			tempY = 10;
		}
		mostrar.style.top = tempY;
		mostrar.style.display='block';
		FAjax ("temp/mostrarDivHotelDescripcion.php?integracion="+integracion+"&id="+id,div,'','GET');		
	}
	function ocultarDescHotel(div){
		var div =document.getElementById(div);
		div.style.display='none';
	}
	
	function mostrar_capa_ms_2(capa,direccion, nombre_hotel) {	
		var IE;
		var posicionratonY=0;

		hotel_aux = nombre_hotel;
		direccion_aux = direccion;
		
		if(document.getElementById) {
			obj=document.getElementById(capa);

		} else if(document.all) { 

			obj=document.all[capa];
		}
				
		
		
			
		obj.style.left = "0 px";	
		obj.style.top ="0px";
		obj.style.display = "block";
	     		
		map = new GMap2(document.getElementById("map3"));        		
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		map.setCenter(new GLatLng(36.721504, -4.420184), 15); // Por defecto si no encuentra la dirección se posiciona en el centro de madrid
		
		geocoder = new GClientGeocoder();
		findLocation(direccion);

	}


	function mostrar_capa_ms_LatLong(capa,nombre_hotel,latitud,longitud){
		var IE;
		var posicionratonY=0;
			

		hotel_aux = nombre_hotel;		
		
		if(document.getElementById) {
			obj=document.getElementById(capa);
		} else if(document.all) { 
			obj=document.all[capa];
		}
				
		obj.style.left = "0 px";	
		obj.style.top ="0px";
		obj.style.display = "block";
	     		
		map = new GMap2(document.getElementById("map3"));        		
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		point = new GLatLng(latitud,longitud);
		map.setCenter(point, 15);
		marker = new GMarker(point);
		map.addOverlay(marker);
		marker.openInfoWindowHtml("<div class='colorletras_alojamiento_mostrado_direccion'>" + nombre_hotel + "</div>");
		
		geocoder = new GClientGeocoder();		

	}
	
	function mostrarOcultarTabHotelesDescripion (mostrar,ocultar1,ocultar2,situacion,direccion,nombre,latitud,longitud){
	
		
		var mostrar = document.getElementById(mostrar);
		var ocultar1 = document.getElementById(ocultar1);
		var ocultar2 = document.getElementById(ocultar2);
		mostrar.style.display='block';
		if (latitud!=''){	
			mostrar_capa_ms_LatLong(situacion,nombre,latitud,longitud);
		}else if(direccion!=''){
			mostrar_capa_ms_2(situacion,direccion,nombre);
		}else{	
			ocultar_capa_ms(situacion);			
		}

		ocultar1.style.display='none';
		ocultar2.style.display='none';
		
	}
	function actualizarImagen(ruta,idImagen){
		var imagen = document.getElementById(idImagen);
		imagen.src=ruta;		
	}

/***************************************************************************************/
/* Funcion de mostrar div de datos de Clientes										   */
/***************************************************************************************/
	function mostrarDivDatosCliente(div,divOcultar1,divOcultar2,fichero){
		var mostrar = document.getElementById(div);
		var ocultar1 =document.getElementById(divOcultar1);
		var ocultar2 =document.getElementById(divOcultar2);
		
		ocultar1.style.display='none';
		ocultar2.style.display='none';
		FAjax (fichero,div,'','GET');
		mostrar.style.display='block';
		
				
	}
	function mostrarDivDatosClienteSinAjax(div,divOcultar1,divOcultar2,fichero){
		var mostrar = document.getElementById(div);
		var ocultar1 =document.getElementById(divOcultar1);
		var ocultar2 =document.getElementById(divOcultar2);
		
		ocultar1.style.display='none';
		ocultar2.style.display='none';
		mostrar.style.display='block';
		
				
	}
