function ampliar(URLampliacion,nombreventana,ancho,alto) {
	window.open(URLampliacion, nombreventana, "toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,outerWidth="+ancho+",width="+ancho+",height="+alto+",resizable=no" );
}

function addBookmark() {

 title = "Dream Flats - online apartment bookings"; 
 url = "http://www.dream-flats.com/";


	if (window.sidebar) { // Mozilla Firefox 
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE 
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera 
		return true; }
 }



function cargandoBuscador(mensaje) {
	$("body").prepend("<div id=\"bloqueador_buscador\"><img src=\"/img/cargando_buscador.gif\" /><h4>"+ mensaje +"</h4></div>");
	$.glassPane(true);
	$("div#bloqueador").addClass("bloqueador");
	var pagesize = tamanioPantalla();
	var arrayPageScroll = calculaScroll();
	$("div#bloqueador_buscador").css({display: "block", left: ((pagesize[0] - 300)/2)+"px", top: (arrayPageScroll[1] + ((pagesize[1]-100)/2))+"px" });
};

$.glassPane = function (show) {
	var o = $('#bloqueador');
	if (o.size() == 0 && !show) { // don't bother creating if show==false
		return;
	}
	if (o.size() == 0) {
		// create glass pane element
		$("body").append("<div id='bloqueador'><\/div>");
		$("#bloqueador").addClass('bloqueador');
	} else {
		o = o[0];
	}	
	if (show) {
		if (window.innerHeight && window.scrollMaxY) {	
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			yScroll = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			yScroll = document.body.offsetHeight;
		}
		$("#bloqueador").css("height",yScroll +"px");
		$(window).scroll(actualizaScroll);
	}else{
		$("div#bloqueador").remove();
	// for good measure, set cursor on the body too
	}
	document.body.style.cursor = show ? 'wait' : 'default';
};

function actualizaBloqueador(){
	var de = document.documentElement;
	var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;		
	var yScrolltop;
	if (self.pageYOffset) {
		yScrolltop = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){   // Explorer 6 Strict
		yScrolltop = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScrolltop = document.body.scrollTop;
	}		
	$("#bloqueador").css("height",h +"px");
	actualizaScroll();
};



function actualizaScroll() {  
	if (window.innerHeight && window.scrollMaxY) {      
		yScroll = window.innerHeight + window.scrollMaxY;  
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac   
		yScroll = document.body.scrollHeight;  
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari   
		yScroll = document.body.offsetHeight;    
	}
	$("#bloqueador").css("height",yScroll +"px"); 
};

function tamanioPantalla(){
	var de = document.documentElement;
	var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
	
	arrayPageSize = new Array(w,h) 
	return arrayPageSize;
};	

function calculaScroll(){
	var yScrolltop;
	if (self.pageYOffset) {
		yScrolltop = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScrolltop = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScrolltop = document.body.scrollTop;
	}
	arrayPageScroll = new Array('',yScrolltop) 
	return arrayPageScroll;
};