function CambiarOrdenListado(num){	
	
	if (num==1){
		document.getElementById('etprecio').style.color="#FF0000";
		document.getElementById('ettipo').style.color="";
		document.getElementById('ethabitaciones').style.color="";
		document.getElementById('etlocalidad').style.color="";			
		document.getElementById('ordenprecio').value="1";
		document.getElementById('ordentinmueble').value="";
		document.getElementById('ordenhabitaciones').value="";
		document.getElementById('ordenlocalidad').value="";
	}
	if (num==2){
		document.getElementById('etprecio').style.color="";
		document.getElementById('ettipo').style.color="#FF0000";
		document.getElementById('ethabitaciones').style.color="";
		document.getElementById('etlocalidad').style.color="";
		document.getElementById('ordenprecio').value="";
		document.getElementById('ordentinmueble').value="2";
		document.getElementById('ordenhabitaciones').value="";
		document.getElementById('ordenlocalidad').value="";
	}
	if (num==3){
		document.getElementById('etprecio').style.color="";
		document.getElementById('ettipo').style.color="";
		document.getElementById('ethabitaciones').style.color="#FF0000";
		document.getElementById('etlocalidad').style.color="";
		document.getElementById('ordenprecio').value="";
		document.getElementById('ordentinmueble').value="";
		document.getElementById('ordenhabitaciones').value="1";
		document.getElementById('ordenlocalidad').value="";
	}
	if (num==4){
		document.getElementById('etprecio').style.color="";
		document.getElementById('ettipo').style.color="";
		document.getElementById('ethabitaciones').style.color="";
		document.getElementById('etlocalidad').style.color="#FF0000";
		document.getElementById('ordenprecio').value="";
		document.getElementById('ordentinmueble').value="";
		document.getElementById('ordenhabitaciones').value="";
		document.getElementById('ordenlocalidad').value="2";
	}
	document.getElementById('ordenarpor').value = num;
	document.f.submit();
	
}

/////////////////////////////////////////////////////////////////////////////////
var ie = document.all ? 1 : 0
var ns = document.layers ? 1 : 0

if(ie){doc = "document.all."; sty = ".style"}
else {doc = "document."; sty = ".style"}

var initialize = 0
var Ex, Ey, topColor, subColor, ContentInfo

if(ie){
Ex = "event.x"
Ey = "event.y"

topColor = "#A7A7A7"
subColor = "#F7F7F7"
}

else{
Ex = "e.pageX"
Ey = "e.pageY"
document.onmousemove=overhere

topColor = "#A7A7A7"
subColor = "#F7F7F7"
}

function MoveToolTip(layerName, FromTop, FromLeft, e){
if(ie){eval(doc + layerName + sty + ".top = "  + (eval(FromTop) + document.body.scrollTop))
eval(doc + layerName + sty + ".left = " + (eval(FromLeft) + 15))
}
else{	
if(e != null){ eval("document.getElementById(layerName)" + sty + ".top = "  +  eval(FromTop))}
if(e != null){ eval("document.getElementById(layerName)" + sty + ".left = " + (eval(FromLeft) + 15))}
}
}

function ReplaceContent(layerName){
if(ie){document.all[layerName].innerHTML = ContentInfo}
else {
	document.getElementById(layerName).innerHTML = ContentInfo;
}
}

function Activate(){initialize=1}
function deActivate(){initialize=0}

function overhere(e){

if(initialize){

MoveToolTip("ToolTip", Ey, Ex, e)
eval("document.getElementById('ToolTip')" + sty + ".visibility = 'visible'")
}

else{
MoveToolTip("ToolTip", 0, 0)
eval("document.getElementById('ToolTip')" + sty + ".visibility = 'hidden'")
}
}

function EnterContent(layerName, TTitle, TContent){

ContentInfo = '<table border="0" width="170" cellspacing="0" cellpadding="0" style="border: 1px solid #A7A7A7">'+
'<tr><td width="100%" style="background-color:#ffffff">'+
'<table border="0" width="100%" cellspacing="0" cellpadding="2">'+
'<tr><td width="100%" bgcolor='+topColor+'>'+
'<table border="0" width="90%" cellspacing="0" cellpadding="0" align="center">'+
'<tr><td width="100%" class="v">'+
'<font color="#ffffff"><b>'+TTitle+'</b></font>'+
'</td></tr>'+
'</table>'+
'</td></tr>'+
'<tr><td width="100%" bgcolor='+subColor+'>'+
'<table border="0" width="90%" cellpadding="0" cellspacing="1" align="center">'+
'<tr><td width="100%">'+
'<font class="v">'+TContent+'</font>'+
'</td></tr>'+
'</table>'+
'</td></tr>'+
'</table>'+
'</td></tr>'+
'</table>';

ReplaceContent(layerName)
}
///////////////////////////////////////////////////////////////////////////////////
