/*function bucleimg() {
	
	var segundos = 5 //cada cuantos segundos cambia la imagen
	var dire = "local" //directorio o ruta donde están las imágenes
	
	var imagenes=new Array()
		imagenes[0]="0.jpg"
		imagenes[1]="1.jpg"
		imagenes[2]="2.jpg"
		imagenes[3]="3.jpg"
		imagenes[4]="4.jpg"
		imagenes[5]="5.jpg"
		imagenes[6]="6.jpg"
		imagenes[7]="7.jpg"
		imagenes[8]="8.jpg"
		imagenes[9]="9.jpg"
		imagenes[10]="10.jpg"
	
	if(dire != "" && dire.charAt(dire.length-1) != "/")
		{dire = dire + "/"}
	
	var preImagenes = new Array()
	for (pre = 0; pre < imagenes.length; pre++){
		preImagenes[pre] = new Image()
		preImagenes[pre].src = dire + imagenes[pre]
	}
	cont=1
	var iex = navigator.appName=="Microsoft Internet Explorer" ? true : false;
	var fi = iex?'filters.alpha.opacity':'style.MozOpacity'
	function presImagen(){
		document.foto.src = document.foto2.src
		eval('document.foto.' + fi + ' = iex?100:1;')
		eval('document.foto2.' + fi + ' = 0')
		document.foto2.src= dire + imagenes[cont]
		document.foto.style.left = 0 - (document.foto.width/2)
		document.foto2.style.left = 0 - (document.foto2.width/2)
		if (cont < imagenes.length-1)
			{cont ++}
		else
			{cont=0}
		tiempo=window.setTimeout('Opacidad()',segundos*1000)
	}
	var opa = iex ? 100 : 1;
	var opa2 = 0
	function Opacidad(){
		if(opa >= 0){
			cambia()
			opa -= iex?10:0.1
			setTimeout('Opacidad()',10)
		}
		else{
		opa = iex?100:1;
			presImagen()
		}
	}
	function cambia(){
		opaci = iex?100 : 1
		eval('document.foto.' + fi + ' = opa')
		eval('document.foto2.' + fi + ' = (opaci-opa)')
	}
	var tiempo
	function inicio(){
		clearTimeout(tiempo)
		Opacidad()
	}
	function escribe(){
		document.writeln('<div style="position:relative; width: 5px; height: 5px;" id="fu"> ')
		document.writeln('<div align="left">')
		document.writeln('<img src="' + dire + imagenes[0] + '" name="foto2" id="foto2" style="-moz-opacity:0"> ')
		document.writeln(' <img src="' + dire + imagenes[3] + '" name="foto" id="foto">')
		document.writeln(' </div></div>')
		document.foto.onload = centra
	}
	function centra(){
		document.foto.style.left = 0 - (document.foto.width/2)
		document.foto2.style.left = 0 - (document.foto2.width/2)
	}
	document.writeln ('<style type="text/css">')
	document.writeln ('#foto {')
	if(iex){
		document.writeln ('filter: alpha(opacity=100);')
	}
	document.writeln ('position:absolute}')
	document.writeln ('#foto2 {')
	if(iex){
		document.writeln ('filter: alpha(opacity=0);')
	}
	document.writeln ('position:absolute}')
	document.writeln ('</style>')

}*/

function validar() {
	
    if (!document.getElementById("checkbox").checked) { 
	
        alert("Tiene que aceptar las condiciones. Muchas gracias."); 
        return false;
		
    }
	
    return true;
	
}

function validaren() {
	
    if (!document.getElementById("checkbox").checked) { 
	
        alert("You must accept the conditions. Thank you very much."); 
        return false;
		
    }
	
    return true;
	
}

function Fecha(){
	
	fecha = new Date();
	dia = fecha.getDate();
	
	if(dia < 10){
		
		dia = "0" + dia;
		
	}
	
	mes = fecha.getMonth()+1;
	
	if(mes < 10){
		
		mes = "0" + mes;
		
	}
	
	anio = fecha.getYear();
	anio = anio.toString();
	
	if (anio.length>2){
		
		anio=anio.substr(2);
		
	}

	org = dia + "." + mes + "." + anio;
	var ua, s, i;
	
	ua = navigator.userAgent;
	
	s = "MSIE";
	
	if ((i = ua.indexOf(s)) >= 0) {
		
		document.write('<td align="right" valign="top"><span class="fecha">'+org+'</span></td>');
		
	}else{
		
		document.write('<td align="right" height="36" valign="bottom"><span class="fecha">'+org+'</span></td>');
	
	}

}

function mostrar() {
  document.getElementById('ver').style.display="block";
  document.getElementById('ocultar').style.display="none";
}
 
function cerrar() {
  document.getElementById('ver').style.display="none";
  document.getElementById('ocultar').style.display="block";
}

function confirmSubmit()
{
var agree=confirm("¿Está seguro que desea eliminar esta propiedad?");
if (agree)
return true ;
else
return false ;
}

function change(cual){
	
  document.getElementById('map').src="Images/mapa"+cual+".gif";
  
}

function procesa(valor){ 

	document.getElementById(valor).disabled = false;

} 

function cambiar(img){ 

if (document.images['grande'].src!=document.images[img].src) {	
 
    document.images['grande'].src=document.images[img].src;

}

}

function filtra_precio()
{
  document.busqueda.action=window.location.pathname +"?tipo=" + document.busqueda.tipo.value+"&localidad=" + document.busqueda.localidad.value
  document.busqueda.submit();
}
function filtra_lista()
{
  cand="";
  cad="";
  if (document.busqueda.tipo.value!='') { cad="tipo='"+document.busqueda.tipo.value+"'"; }
  if(cad!='') { cand= " and "; }
  if (document.busqueda.localidad.value!='') { cad=cad + cand + " localidad='"+document.busqueda.localidad.value+"'"; }
  if(cad!='') { cand= " and "; }
  if (document.busqueda.rango.value!='') { cad=cad + cand + " rango="+document.busqueda.rango.value; }
	if(cad!='') { cad=" where " + cad ; }
  document.busqueda.action=window.location.pathname +"?cad=" + cad;
  document.busqueda.submit();
}

function Browser() {

	var ua, s, i;
	
	ua = navigator.userAgent;
	
	s = "MSIE";
	
	if ((i = ua.indexOf(s)) >= 0) {
		
		document.write('<textarea name="comentario" cols="72" rows="8" class="form" id="comentario">');
		
	}else{
		
		document.write('<textarea name="comentario" cols="68" rows="8" class="form" id="comentario">');
	
	}

}