

function mOvr (origen, clase) {
	if (!origen.contains(event.fromElement)){
		origen.style.cursor = 'hand';
		origen.className=clase; // Cambiar la clase del elemento
	}
//	if (clase=='celdaResultadoOn') { origen.children.tags('A')[0].className='enlaceResultadoOn' }
}
function mOut (origen, clase) {
	if (!origen.contains(event.toElement)){
		origen.style.cursor = 'default';
		origen.className=clase; // Cambiar la clase del elemento
	}
//	if (clase=='celdaResultadoOff') { origen.children.tags('A')[0].className='enlaceResultadoOff' }
}
function mClk (origen) {
	if (event.srcElement.tagName=='TD') {
		if (origen.children.tags('A')[0]) {
			origen.children.tags('A')[0].click();
		}
	}
}


// Pone todos los TD de un TR a una clase determinada
function procesaTR (objeto, clase) {
	for (i=0; i<objeto.childNodes.length; i++) {
		objeto.childNodes[i].className=clase;
	}
}


function compruebaCamposLogin() {
	if (self.document.form1.usuario.value=="") {
		alert("Introduzca un nombre de usuario por favor.");
		self.document.form1.usuario.focus();
		return false;
	}
	if (self.document.form1.password.value=="") {
		alert("Introduzca una contraseņa por favor.");
		self.document.form1.password.focus();
		return false;
	}
	return true;
}


function CadenaFecha() {
	d=new Array ("domingo","lunes","martes","mi&eacute;rcoles","jueves","viernes","s&aacute;bado");
	m=new Array ("enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre");
	fecha=new Date();
	dia=fecha.getDate();
	ano=fecha.getYear();
	if (ano < 2000) ano=ano+1900; 
	cadFecha = "Hoy es "+d[fecha.getDay()]+" "+dia+" de "+m[fecha.getMonth()]+" de "+ano;
	return cadFecha;
}


function abrirImagen(sPagina, sURL, iAncho, iAlto, iParamAdmon){
	var s = window.open(sPagina+"?imagen="+escape(sURL), "Foto",'fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no');
	s.moveTo(2000,2000);
	s.resizeTo(iAncho, iAlto);

	var ah = screen.availHeight - 30;
	var aw = screen.availWidth - 10;
	var xc = (aw - iAncho) / 2;
	var yc = (ah - iAlto) / 2;

	s.moveTo(xc,yc);
}

function sobre (origen) {
	if (!origen.contains(event.fromElement)){
		origen.style.cursor = 'hand';
	}
}
function fuera (origen) {
	if (!origen.contains(event.toElement)){
		origen.style.cursor = 'default';
	}
}

// Checking the browser version
 browserversion = parseInt(navigator.appVersion);

if  (browserversion >= 3) ver = "n3";
else ver = "n2";
        
var osd = "   "
osd +="Bienvenido a INMOVERA.COM: El portal Inmobiliario de Inmobiliaria La Vera ";
osd +="          ";
var timer;
var msg = "";

function scrollMaster () {
	msg = customDateSpring(new Date(),1);
	clearTimeout(timer);
	msg += " " + showtime() + " " + osd;
	for (var i= 0; i < 100; i++){
		msg = " " + msg;
	}
	scrollMe();
}

function scrollMe(){
	window.status = msg;
	msg = msg.substring(1, msg.length) + msg.substring(0,1);
	timer = setTimeout("scrollMe()", 75);
}

function showtime (){
	var now = new Date();
	var hours= now.getHours();
	var minutes= now.getMinutes();
	var seconds= now.getSeconds();
	var months= now.getMonth();
	var dates= now.getDate();
	var years= now.getYear();
	var timeValue = "";
	timeValue += ((months >9) ? "" : " ");
	timeValue += ((dates >9) ? "" : " ");
	timeValue = ( months +1);
	timeValue +="/"+ dates;
	timeValue +="/"+  years;
	var ap="A.M.";
	if (hours == 12) {
		ap = "P.M.";
	}
	if (hours == 0) {
		hours = 12;
	}
	if(hours >= 13){
		hours -= 12;
		ap="P.M.";
	}
	var timeValue2 = " " + hours;
	timeValue2 += ((minutes < 10) ? ":0":":") + minutes + " " + ap;
	return timeValue2;
}

function MakeArray(n) {
	this.length = n;
	return this;
}

monthNames = new MakeArray(12);
monthNames[1] = "de Enero";
monthNames[2] = "de Febrero";
monthNames[3] = "de Marzo";
monthNames[4] = "de Abril";
monthNames[5] = "de Mayo";
monthNames[6] = "de Junio";
monthNames[7] = "de Julio";
monthNames[8] = "de Agosto";
monthNames[9] = "de Septiembre";
monthNames[10] = "de Octubre";
monthNames[11] = "de Noviembre";
monthNames[12] = "de Diciembre";
daysNames = new MakeArray(7);
daysNames[1] = "Domingo";
daysNames[2] = "Lunes";
daysNames[3] = "Martes";
daysNames[4] = "Miercoles";
daysNames[5] = "Jueves";
daysNames[6] = "Viernes";
daysNames[7] = "Sabado";

function customDateSpring(oneDate,st) {
	var theDay = daysNames[oneDate.getDay() +1];
	var theDate =oneDate.getDate();
	var theMonth = monthNames[oneDate.getMonth() +1];
	var dayth="th";

	if ((theDate == 1) || (theDate == 21) || (theDate == 31)) {
		dayth="st";
	}
	if ((theDate == 2) || (theDate ==22)) {
		dayth="nd";
	}
	if ((theDate== 3) || (theDate  == 23)) {
		dayth="rd";
	}
	if (st==1)
	{	
		return theDay + ", " + theDate +  " " + theMonth + ",";
	}else{
		return theDay + ", " + theDate +  " " + theMonth + " ";
	}
}
scrollMaster();


function right(e) {
	if (navigator.appName == 'Netscape' &&
	(e.which == 3 || e.which == 2))
		return false;
	else if (navigator.appName == 'Microsoft Internet Explorer' &&
	(event.button == 2 || event.button == 3)) {
		alert("inmovera.com - 2007");
		return false;
	}
	return true;
}

document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;
