function ordenar(criterio){
	//alert (criterio);
	location.search += "&ordencons="+criterio;
}

function simplePreload(){
	var args = simplePreload.arguments;
	document.imageArray = new Array(args.length);
	
	for(var i=1; i<args.length; i++){
	
		document.imageArray[i] = new Image;
		document.imageArray[i].src = args[i];
	}
}


function changeimgsmid (destino, imagen, imagengrande){
	document.getElementById(destino).src = imagen;
	document.getElementById("zoom" + destino).href = imagengrande;	
}

function zoomfoto(zoom){
	try{
		lawin.close();
    }catch(e){	}
	
	imagengrande = document.getElementById(zoom).href;
	urlPhoto = "/photo.php?code="+imagengrande;
	lawin = window.open(urlPhoto, "lawin", "scrollbars=no,width=665,height=510,menubar=no,resizable=no,toolbar=no,location=no,status=no");	
}

function validaraddprop(xxx){	
	
	formadd = document.getElementById("formaddprop_" + xxx);
	
	if (formadd.clie1name.value == "" || formadd.clie1name.value == ""){  
  		alert("Nombre de usuario incorrecto");
   		return;
  	}
	
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(formadd.clie1email.value) || /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(formadd.clie1email.value)){  
  		
		formadd.submit();
		verformadd(xxx);
		formadd.clie1name.value = "";
		formadd.clie1email.value = "";
		formadd.clie1namef.value = "";
		formadd.clie1emailf.value = "";		
		
		alert("Thank you, the information was sent correctly.");			
  	}else{	
   		alert("Please enter a valid e-mail address.");
   		return;
  	}	
}

function verformadd(xxx){
	
	formadd = document.getElementById("formu_" + xxx);
	
	if(formadd.style.visibility == "hidden"){
		formadd.style.visibility = "visible";
		formadd.style.position = "relative";
	}else{
		formadd.style.visibility = "hidden";
		formadd.style.position = "absolute";
	}
}

function PrintProp(){
	frames.eliframe.location.href = "/htmlfiles/property/' . $lang . '/pageprint.php?prop1id=" + prop1id;
}
