	
	function AbreIframe(url, width, height){
		alert (url);
		var gallery = document.getElementById("gallery");
		var frame = document.getElementById("frameIntegrado");
		var frameVolver = document.getElementById("frameVolver");
		frame.width = width;
		frameVolver.style.width = width;
		frame.height = height;
		frame.src = url;
		new Rico.Effect.FadeTo(gallery, 0,500,10,
		{complete:function() {
			gallery.style.display = "none";
			new Rico.Effect.FadeTo(gallery, 0,1,1,
			{complete:function() {
				frame.style.display = "block";
				frameVolver.style.display = "block";
				new Rico.Effect.FadeTo(gallery, 1,500,10);
				}});
			}});
	}
	


	
	function bd_Onload(){
	
		utilAjax.getDestacados(getDestacadeos_callback);
	
	}
	
	function getDestacadeos_callback(response){
	    
	    
		if (response.error != null){
			alert(response.error.Message);
			return;
		}
		var resp = response.value;
		var resp2 = resp.replace(/display:none/g,"display:inline-block");
		resp2 = resp2.replace(/display:block/g,"display:none");
		
		document.getElementById("divDestacados").innerHTML = resp;	
		document.getElementById("divDestacadosIzda").innerHTML = resp2;	

	}
	
	function showHideMenu(id, what){
	
		
		var bt = document.getElementById("bt" + id);
		var div = document.getElementById("div" + id);
		
		if (what){
			initMenu();
			div.style.display = "block";
			bt.style.display = "none";
		}else{
			div.style.display = "none";
			bt.style.display = "block";
		}
	}
	
	function initMenu(){
	
		var div1 = document.getElementById("divmenu1");
		var div2 = document.getElementById("divmenu2");
		var div3 = document.getElementById("divmenu3");
		div1.style.display = "none";
		div2.style.display = "none";
		div3.style.display = "none";
		var bt1 = document.getElementById("btmenu1");
		var bt2 = document.getElementById("btmenu2");
		var bt3 = document.getElementById("btmenu3");
		bt1.style.display = "block";
		bt2.style.display = "block";
		bt3.style.display = "block";
	
	}


	// Abre una popup centrada en la pantalla
	// parametros : 
	// -----------> URL_Ventana : url pagina 
	// -----------> OpcionesVentana : width, heigh, scroll etc (ver window.open())
	// -----------> Centrada : true or false
	// -----------> PosX, PosY : si centrada=false especifican las coordenadas de la ventana
	// --------------------------------------------------------------------------------------//
	function AbreVentana(URL_Ventana, OpcionesVentana, Ancho, Alto, Centrada, PosX, PosY) {

	if (Centrada) {
		PosX = (screen.availWidth)? ((screen.availWidth - Ancho)/2):20;
		PosY = (screen.availHeight)? ((screen.availHeight - Alto)/2):20;
		}
		
	if (OpcionesVentana == '')
		OpcionesVentana = 'width=' + Ancho;
	else
		OpcionesVentana += ',width=' + Ancho;

	OpcionesVentana += ',height=' + Alto + ',left=' + PosX
		+ ',top=' + PosY;
		
	return window.open(URL_Ventana, "", OpcionesVentana);
	
	}
	
	
	// cambia el tamaņo de una image (respetando proporciones)
	// parametros : 
	// -----------> Image : ref a la imagen que se quiere modificar 
	// -----------> max_ancho : ancho maximum
	// -----------> max_alto : alto maximum (si = 0 la image coje la anchura especificada y el alto se deduce)
	// ---------------------------------------------------------------------------------------------------------//
	function Cambia(image,max_ancho,max_alto)
	{
	
		//alert (image.width+" , "+image.height);
		
		if (image)
		{
			w=image.width;
			h=image.height;
			
			
			
			if (w > max_ancho) {
					ratio = w / max_ancho;
					w = max_ancho;
					h = h/ratio;
				}
				
			if (max_alto > 0) {
			
				if (h > max_alto) {
						ratio = h / max_alto;
						h = max_alto;
						w = w/ratio;

				}
				
			}else{
			
				if (w < max_ancho) {
					ratio = w / max_ancho;
					w = max_ancho;
					h = h/ratio;
				}	
					
			}
			
			if (typeof image.style != 'undefined') {
				//setTimeout('cambia()',1000);
			}else{
				image.width=w;
				image.height=h;
			}
			return false;
				
		}else{
			//alert ("miColeLib.js");
			//setTimeout('document["'+image+'"].style.visibility = "visible"',1000);
		}
	}