var lockBar=0;var aOffset = new Array(16,136,256,376,496,569); var aIFrmHt = new Array()


/* Funciones del Menu desplegable */
function mDsp(menuId) {
  var tmpWidth = 0; lockBar = menuId
  for (ii=1; ii<7;ii++) {
    if (document.body.clientWidth-752 > 0) {tmpWidth = document.body.clientWidth-751} else {tmpWidth = 1}
    if (menuId == ii) {
      document.getElementById("tpMnu"+ii).style.display = "block";document.getElementById("tpMnu"+ii).style.left=aOffset[ii-1]+tmpWidth/2+"px"
      if (navigator.userAgent.indexOf("Opera") < 0) {document.getElementById("navIFrm"+ii).style.display = "block";document.getElementById("navIFrm"+ii).style.left=aOffset[ii-1]+tmpWidth/2+"px"}
      document.getElementById("mnSpn"+ii).style.backgroundImage = "url(/img/bgNavSlct.gif)";document.getElementById("mnSpn"+ii).style.backgroundRepeat = "repeat";
    }
    else {document.getElementById("tpMnu"+ii).style.display = "none";document.getElementById("navIFrm"+ii).style.display = "none";document.getElementById("mnSpn"+ii).style.backgroundImage = "none";}
  }
}

function mOff(menuId) {lockBar=0;setTimeout("mHide("+menuId+")",700)}

function mHide(menuId) {if (menuId != lockBar) {document.getElementById("tpMnu"+menuId).style.display = "none";document.getElementById("navIFrm"+menuId).style.display = "none";document.getElementById("mnSpn"+menuId).style.backgroundImage = "none";}}



/* Funciones relacionadas con el WebMail */

function validarEmail(email) {
	var lsAT;
	lsAT = email.indexOf("@");
	if (lsAT == -1 || email.indexOf(" ") != -1 ) {
		return false;
	}
	return true;
}//validarEmail



/* Anular boton derecho */


function right(e) {
if (((navigator.appName == 'Netscape') || (navigator.appName == 'Mozilla Firefox')) && (e.which == 2 || e.which == 3)){
  alert("Agencia J. Morató - Gracias por visitar nuestra página web.");
  return false;
}
else if ((navigator.appName == 'Microsoft Internet Explorer') &&  (event.button == 2 || event.button == 3)) {
  alert("Agencia J. Morató - Gracias por visitar nuestra página web.");
  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;







// Abrir Ventana

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// Funcion de PopUp genérico

var ventana;
function popUp(fichero){

	ventana=window.open('','ventana','width=500,height=380,status=yes')
	var texto = "<html><head><title>Ampliación de la imagen</title>";
	texto = texto +"</head><body bgcolor='#c7d9e0' text='#666666' leftmargin='5' topmargin='5' marginwidth='5' marginheight='5' onClick='javascript:window.close();'>";
	texto = texto + "<img src='"+fichero+"' width='480' height='360'></body></html>"	
	ventana.document.open("text/html","replace");
	ventana.document.write(texto);
	ventana.focus();
}

function imprimirPagina(quediv){
	var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,";
	disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25";
	var content_value = document.getElementById(quediv).innerHTML;
	var docprint=window.open("","",disp_setting);
	docprint.document.open();
	docprint.document.write('<html><head><title>Agencia Morató</title>');	
	docprint.document.write('<style type="text/css">');
	docprint.document.write('#textoref2,#hipoteca{');
	docprint.document.write('display:none;');
	docprint.document.write('}');
	docprint.document.write('</style>');	
	docprint.document.write('</head><body onLoad="self.print()">');
	docprint.document.write(content_value);
	docprint.document.write('</body></html>');
	docprint.document.close();
	docprint.focus();
}

function agregarFavoritos() {
	if (window.sidebar&&window.sidebar.addPanel)
		window.sidebar.addPanel("Agencia Morató",location.href,"");
	else
		window.external.AddFavorite(location.href,"Agencia Morató");
}

