	/*
 * byo - 2008
 * Asetra
 */

// DomReady - v1 //////////////////////////////
window.addEvent('domready', function() {



});
// DomReady //////////////////////////////

function getURL(url){
	window.location.href=url;	
}

function setstyleTr(idtr){
	
	document.getElementById(idtr).style.background="#cfe1c1";
}

function setOutstyleTR(idtr){
	
	document.getElementById(idtr).style.background="#ffffff";
}

function openPopup(location, fullscreen, tools, direcciones, status, menubar, scrollbars, resizable, width, height, left, top, sustituir){

     var opciones = "fullscreen=" + fullscreen +
                 ",toolbar=" + tools +
                 ",location=" + location +
                 ",status=" + status +
                 ",menubar=" + menubar +
                 ",scrollbars=" + scrollbars +
                 ",resizable=" + resizable +
                 ",width=" + width +
                 ",height=" + height +
                 ",left=" + left +
                 ",top=" + top;
     var ventana = window.open(location,"venta",opciones,sustituir);

    	
}


///////////// slide images homepage

var slideCache = new Array();
function RunSlideShow(pictureName,imageFiles,displaySecs){
	var imageSeparator = imageFiles.indexOf(";");
	var nextImage = imageFiles.substring(0,imageSeparator);
	
	if (document.all){
		document.getElementById(pictureName).style.filter="blendTrans(duration=2)";
		document.getElementById(pictureName).filters.blendTrans.Apply();
	}
	
	document.getElementById(pictureName).src = nextImage;
	
	if (document.all){
		document.getElementById(pictureName).filters.blendTrans.Play();
	}
	
	var futureImages= imageFiles.substring(imageSeparator+1,imageFiles.length)
	+ ';' + nextImage;
	setTimeout("RunSlideShow('"+pictureName+"','"+futureImages+"',"+displaySecs+")",
	displaySecs*700);
	// Cache the next image to improve performance.
	imageSeparator = futureImages.indexOf(";");
	nextImage = futureImages.substring(0,imageSeparator);
	
	if (slideCache[nextImage] == null) {
		slideCache[nextImage] = new Image;
		slideCache[nextImage].src = nextImage;
	}
}

///////////// slide images homepage end

// getZones() /////////////////////////////////

	function getZones(idarea){
	
		$('select-zone').load(baseurl+'/index.php/es/property/generate-select-zone/area/'+idarea+'/');
	
	}

// /getZones() ////////////////

// getPrices() /////////////////////////////////

	function getPrices(typeofoffer){
	
		$('select-price').load(baseurl+'/index.php/es/property/generate-select-price/typeofoffer/'+typeofoffer+'/');
	
	}

// /getPrices() ////////////////

function getDivsHeight(){
	var heightsDiv = new Array();
	heightsDiv[0] = parseInt($$('#news1').getStyle('height'));
	heightsDiv[1] = parseInt($$('#news2').getStyle('height'));
	heightsDiv[2] = parseInt($$('#news3').getStyle('height'));
	heightsDiv = heightsDiv.sort();

	$$('.center').setStyle("height", heightsDiv[0] + "px");
	
}

