function zoom(nome) {
var w=560;
var h=480;


x=(screen.width-w)/2;
y=(screen.height-h)/2;
window.open('/zoom.php?id='+nome,'nome','left='+ x +',top='+y+',width='+ w +',height='+ h +',resizable=yes,status=no,location=no,toolbar=no,scrollbars=yes');

}



function getClassN(div_,cl){
	cl= !cl? "highlight" :cl;
	document.getElementById(div_).setAttribute('className',cl);
	document.getElementById(div_).setAttribute('class',cl);
	
}

var url_="";
function search(){
	
	url_="/"+ getRadioValue('condizione')+ "/";
	var tmp= getSelectValue('src_tipo')+"_" ;
	tmp+= getSelectValue('src_zona')+"_";
	tmp+= getSelectValue('src_precio')+".htm";
	
	url_=url_+"_"+ tmp;
	//document.getElementById('debugg').innerHTML+=url_;
	window.open(url_,'_self');
	}
	
	
function search2(){
	
	url_="/venta/";
	var tmp="?tipo="+ getSelectValue('src_tipo');
	tmp+="&zona="+ getSelectValue('src_zona');
	tmp+="&precio=" +getSelectValue('src_precio')+"&telefono="+document.getElementById("telefono2").value;
	url_="/section/text/registri_richiesta.php"+tmp;
	//document.getElementById('debugg').innerHTML+=url_;
	window.open(url_,'_self');
	}	
	
	
function getSelectValue(id){
	
	//document.getElementById('debugg').innerHTML+=id;
	var radioLength=document.getElementById(id).length;
	
	//document.getElementById('debugg').innerHTML+="lun" + radioLength + " =";
					for(var i = 0; i < radioLength; i++) {
						if(document.getElementById(id).options[i].selected) {
							/*
							for (p in document.getElementById(id).options[i]){
								
								//document.getElementById('debugg').innerHTML+= p + "=" + document.getElementById(id).options[i][p] + "<br>";
								}
							*/
							
							var	value=document.getElementById(id).options[i].value;
							var name;
							if (value==0 && id=='src_tipo')
							name="casa-";
							else if(value==0 && id=='src_zona')
							name="valencia";
							else if(id=='src_precio')
							name="";
							else
							name=document.getElementById(id).options[i].innerHTML.replace(".","-").replace("€","-").replace(" ","-")+"-"; 
							
							url_+=name;
							
						}

}
//document.getElementById('debugg').innerHTML+= name +"=" +value+ "<br>";
	return value;
	
	
	}	
	
function getRadioValue(id){
	var tmp;
	var obj=document.getElementById(id);
	var obj2=document.getElementById(id+'2');
	if (obj2.checked)tmp="venta";
	if (obj.checked)tmp="alquiler";
	
	return tmp
	
	
	}	
	

function apriRegistro(str,nome) {
var h=540;	
if (screen.width>800)h=680;	
var x=(screen.width-740)/2;

var y=(screen.height-h)/2;

window.open(str,nome,'left='+ x +',top=0,width=740,height='+ h +',resizable=yes,status=no,location=no,toolbar=no,scrollbars=yes');
}

function recommend(str2,nome2) {
x=screen.width/8
x1=x*4
y=screen.height/8
y2=y*4
window.open(str2,nome2,'left=500,top=0,width=500,height=480,resizable=no,status=no,location=no,toolbar=no,scrollbars=no');
}



function searchCodigo(){
	var value= document.getElementById('ref').value;
	url_="/valencia/codigo_"+ value+".htm";
	window.open(url_,'_self');
	}