// JavaScript Document
function Abrir_Ventana(theURL,name,param) { 
window.open(theURL,name,param); 
} 

function bookmark(url, description)
{
	netscape="Click en OK luego CTRL+D para aņadir a tus Favoritos."

	if (navigator.appName=='Microsoft Internet Explorer')
	{
		window.external.AddFavorite(url, description);
	}
	else if (navigator.appName=='Netscape')
	{
	alert(netscape);
	}
}

// JScript source code
function doPassVar(args){
	var sendText = args;
	document.getElementById("promociones").SetVariable("myVar", sendText);
	return false;
}

function createComponentJS2Flash()
{
// Conditionally create object elements depending on browser
// IE supports ActiveX, so create an object element that supports ActiveX
// Mozilla supports MIME type, so if Mozilla, create an object element that supports MIME type
if ((window.ActiveXObject) && 
      (navigator.userAgent.indexOf("MSIE")!= -1) && (navigator.userAgent.indexOf("Windows") != -1))
{

document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"');
document.write(' width="540" height="450" id="promociones">');
document.write(' <param name="movie" value="../swf/Promociones_General.swf">');
document.write(' <param name=quality value=high>');
document.write(' <param name="swliveconnect" value="true">');
document.write('<' + '/object>');

}

else
{
var version_check = getFlashPluginVersion();
if (version_check.scriptable)
{
document.write('<object id="promociones" data="../swf/Promociones_General.swf" type="application/x-shockwave-flash"');
document.write(' width="540" height="450">');
document.write('<param name="movie" value="../swf/Promociones_General.swf">');
document.write('<param name="quality" value="high">');
document.write('<param name="swliveconnect" value="true">');    	
document.write('<\/object>'); 
}
else
	identifyFlash()

}

}
function loadIframe(theURL){
    document.getElementById("login").src = theURL;
}

function adjustIFrameSize(mostrarSecundario){

parent.scrollTo(1,1);

var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;

 
var oBody = login.document.body;
var oBody2 = iframe_login.document.body;
 
//oFrame = document.all("login").style;
//oFrame2 = document.all("iframe_login").style;
oFrame = document.getElementById("login").style;
oFrame2 = document.getElementById("iframe_login").style;

oFrame.verticalAlign = 'top';
oFrame2.verticalAlign = 'top';
oFrame.top = 0;
oFrame2.top = 0;
oFrame.height = 705;
oFrame2.height = 705;
if (mostrarSecundario == false)
	{

		oFrame.width = 760;
		oFrame2.width = 0;
		oFrame2.visibility = 'hidden';
	}
else
	{
		oFrame.width = 557;
		oFrame2.width = 193;
		oFrame2.visibility = 'visible';
	}

oFrame.height = oBody.scrollHeight + (oBody.offsetHeight - oBody.clientHeight);
oFrame2.height = oBody.scrollHeight + (oBody.offsetHeight - oBody.clientHeight);
if ((oBody.scrollHeight + (oBody.offsetHeight - oBody.clientHeight)) < 720)
	{
		oFrame.height = 720;
		oFrame2.height = 720;
	}
 

}

function favoritos(url, description){
netscape="Netscape User's hit CTRL+D to add a bookmark to this site."
if (navigator.appName=='Microsoft Internet Explorer'){
window.external.AddFavorite(url, description);
}
else if (navigator.appName=='Netscape'){
alert(netscape);
}
}

function paginaInicio(inicio)
	{

		// If it's Internet Explorer, use automatic link
		// Be sure to change the "http://www.YourWebSiteHere.com\"
		// to the URL you want them to bookmark.
		if (document.all){
			//document.write('<A HREF="javascript:history.go(0);" onClick="this.style.behavior=\'url(#default#homepage)\';this.setHomePage(\'http://www.YourWebSiteHere.com\');">');
			//document.write('<font size="5" color=6699FF face=arial><B>Click Here to Make My Web Page Your Homepage</B></font></a>');
			this.document.body.style.behavior='url(#default#homepage)';this.document.body.setHomePage(inicio);
		}

		// If it's Netscape 6, tell user to drag link onto Home button
		// Be sure to change the "http://www.YourWebSiteHere.com\"
		// to the URL you want them to bookmark.
		else if (document.getElementById){
			//document.write('<a href="http://www.YourWebSiteHere.com">Drag this link onto your Home button to make this your Home Page.</a>');
			alert('Drag this link onto your Home button to make this your Home Page.');
		}

		// If it's Netscape 4 or lower, give instructions to set Home Page
		else if (document.layers){
			//document.write('<b>Make this site your home page:</b><br>- Go to <b>Preferences</b> in the <B>Edit</B> Menu.<br>- Choose <b>Navigator</b> from the list on the left.<br>- Click on the <b>"Use Current Page"</b> button.');
			alert('Make this site your home page: - Go to Preferences in the Edit Menu. - Choose Navigator from the list on the left. - Click on the "Use Current Page" button.');
		}

		// If it's any other browser, for which I don't know the specifications of home paging, display instructions
		else {
			//document.write('<b>Make this site your home page:</b><br>- Go to <b>Preferences</b> in the <B>Edit</B> Menu.<br>- Choose <b>Navigator</b> from the list on the left.<br>- Click on the <b>"Use Current Page"</b> button.');
			alert('Make this site your home page: - Go to Preferences in the Edit Menu. - Choose Navigator from the list on the left. - Click on the "Use Current Page" button.');
		}
	}

function mostrarEmpresa()
	{
		frames['iframe_login'].document.getElementById("divMenuLateral").style.visibility='visible'; 
	}

function ocultarEmpresa()
	{
		frames['iframe_login'].document.getElementById("divMenuLateral").style.visibility='hidden'; 
	}

function ocultarEmpresaFrame()
	{
		document.getElementById("divMenuLateral").style.visibility='hidden'; 
	}

function abrirVentana(url, alto, anxo)
	{
		alto = 'height=' + alto
		anxo = 'width=' + anxo
		window.open(url, "_blank", alto + ',' + anxo + ', top=50, left=50 ,toolbar=0, titlebar=1, menubar=0, scrollbars=1, location=0, fullscreen=0, resizable=0, status=0');
	}
	
function busquedaViviendas(idioma)
	{
		var index = document.getElementById("cboResidenciales").selectedIndex 
		if (index==-1)
			{
				var idRes = ''
			}
		else
			{
				var idRes = document.getElementById("cboResidenciales").options[index].value;
			}
		var precDesde = document.getElementById("txtPrecioDesde").value;
		var precHasta = document.getElementById("txtPrecioHasta").value;
		parent.frames['login'].location.href = 'viviendas.aspx' + '?idioma=' + idioma + '&idres=' + idRes + '&precdesde=' + precDesde + '&prechasta=' + precHasta;
	}

function cargarEnLogin(pagina)
	{
		parent.frames['login'].location.href = pagina;
	}

function mostrarResidencial(idRes, idioma)
	{
		parent.frames['login'].location.href = 'promociones.aspx' + '?idioma=' + idioma + '&idres=' + idRes;
	}

function autorizacionDisponibilidad(idioma)
	{
		abrirVentana("https://www2.sanjosegrupo.com/disponibilidad/login.aspx", 400, 600)
	}

function deshabilitarCache()	
	{
		//browser.cache.memory.enable =  false;
	}