/***************************************************************
 Función para maximizar la ventana del explorador
****************************************************************/

function maximizar() {
 self.moveTo(0,0)
 self.resizeTo(screen.availWidth,screen.availHeight)
}

/***************************************************************
 Función para abir una ventana
****************************************************************/
function abre(cual,tw,th) {
	//Movemos al centro
	var windowW = tw;
	var windowH = th;
	var windowX = Math.ceil( (window.screen.width  - windowW) / 2 );
	var windowY = Math.ceil( (window.screen.height - windowH) / 2 );
	var num= Math.round(Math.random(10000)*5000)
	var otro="wCean"+num
	//Abrimos ventana
	window.open(cual,otro,"toolbar=no,location=no,directories=no,menubar=no,status=no,scrollbars=no,width="+ windowW +",height="+ windowH +",top=" + windowY + ",left=" + windowX);

}

function abreIMG(esta,promo,tipo){
	queNav=navigator.appName
	if (queNav.indexOf('Microsoft')==-1 && queNav.indexOf('Mac')!==-1){
		//Significa que es un Mac
			if(tipo=="casas"){
				abre("img_casa.htm?im="+esta+"&promo="+promo+"&tipo="+tipo+"&idioma="+idioma,786,515)
			}else{
				if(tipo=="fotos_in"){
					abre("img_casa.htm?im="+esta+"&promo="+promo+"&tipo="+tipo+"&idioma="+idioma,600,450)
				}else{
					abre("img.htm?im="+esta+"&promo="+promo+"&idioma="+idioma,608,498)
				}
			}	
			
	}else{
			if(tipo=="casas"){
				abre("img_casa.htm?im="+esta+"&promo="+promo+"&tipo="+tipo+"&idioma="+idioma,100,100)
			}else{
				if(tipo=="fotos_in"){
					abre("img_casa.htm?im="+esta+"&promo="+promo+"&tipo="+tipo+"&idioma="+idioma,100,100)
				}else{
					abre("img.htm?im="+esta+"&promo="+promo+"&idioma="+idioma,100,100)
				}
			}	
	}
}

function resizeV(){
	showHideLayers("lim",'','show');
	showHideLayers("ltxt",'','hide');
	top.resizeTo(document.imm.width + 10,document.imm.height + 29)
	var windowW = document.imm.width;
	var windowH = document.imm.height;
	var windowX = Math.ceil( (window.screen.width  - windowW) / 2 );
	var windowY = Math.ceil( (window.screen.height - windowH) / 2 );
	top.moveTo(windowX ,windowY);
}
function inR(){
	var ic=setInterval(resizeV,1000);
}

<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
// * Dependencies * 
// this function requires the following snippets:
// JavaScript/readable_MM_functions/findObj
//
// Accepts a variable number of arguments, in triplets as follows:
// arg 1: simple name of a layer object, such as "Layer1"
// arg 2: ignored (for backward compatibility)
// arg 3: 'hide' or 'show'
// repeat...
//
// Example: showHideLayers(Layer1,'','show',Layer2,'','hide');
function showHideLayers()
{ 
  var i, visStr, obj, args = showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3)
  {
    if ((obj = findObj(args[i])) != null)
    {
      visStr = args[i+2];
      if (obj.style)
      {
        obj = obj.style;
        if(visStr == 'show') visStr = 'visible';
        else if(visStr == 'hide') visStr = 'hidden';
      }
      obj.visibility = visStr;
    }
  }
}

MM_reloadPage(true);

// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

//-->
