var win = null;
	
function NewWindow (mypage,myname,w,h,scroll)
{
	LeftPosition	= (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition 	= (screen.height) ? (screen.height-h)/2 : 0;
	
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+', resizable=no';
	
	win = window.open( mypage, myname, settings);
	win.focus();
}


function abrirVentanaTiempo ()
{	
	// Dirección URL de información del tiempo.
	var mypage 	= 'http://espanol.weather.com/weather/local/SPXX0098';
	var myname	= 'name';
	var w			= 555;
	var h			= 450;
	var scroll		= 'yes';
	
	// Configuración para pantalla 800 x 600 
	//			width = 555
	//			height = 450
	// Para el resto la medida de la nueva ventana será 800 x 600

//	var wid = screen.width;

//	if ( parseInt( wid) > 800 ) {
//		w = '800';
//		h = '600';
//	}

	NewWindow ('', myname, w, h, scroll);
	
	if ( win != null )
	{
		win.document.write("<HTML>"); 
		win.document.write("<HEAD>");
		win.document.write("<TITLE>TurismoEnCazorla.com</TITLE>");
		win.document.write("</HEAD>");
		// Nota: Damos el tamaño (alto) del primer frame, MAYOR que  el alto de la ventana.
		win.document.write("<FRAMESET ROWS='500,0' FRAMEBORDER='NO' BORDER='0' FRAMESPACING='0' MARGINWIDTH='0' MARGINHEIGHT='0'>");
		win.document.write("<frame name='contenido' scrolling='AUTO' noresize src=' " + mypage + "' frameborder='no' marginwidth='0' marginheight='0' >") 
		win.document.write("<frame name='Botonera' scrolling='no' noresize frameborder='no' marginwidth='0' marginheight='0'>") 
		win.document.write("</FRAMESET>") 
		win.document.write("</HTML>") 
		
		win.focus();
	}
}



// Función de javascript, que cambia de imagen, en función del estado que se pase.
function Rollover_Simple( obj, estado)  
{
	 
	     if (!estado)		eval ( "document." + obj + ".src = '../imagen/top_button.gif' ");
	     	else			eval ( "document." + obj + ".src = '../imagen/top_button_on.gif' ");
}


function Precargar_Imagenes()  
{
		Imagen = new Image();
     		Imagen.src = "../imagen/top_button.gif";
}



function openInformation()
{
	var mypage = "information.html";	
	var myname = "TurismoEnCazorla.com";
	var h = 250;
	var w = 325;
	
	settings = 'height='+h+',width='+w+',top=0,left=0, scrollbars=no, resizable=no';
	
	win = window.open( mypage, myname, settings);
	
}

var winCalendario = null;
function openCalendario()
{
	var mypage = "dinamic/layerPresentation/calendario.php?ID_ALOJAMIENTO="+document.formulario.ID_ALOJAMIENTO.value;	
	var myname = "calendario";
	var h = 200;
	var w = 205;
	
	settings = 'height='+h+',width='+w+',top=0,left=0,scrollbars=no,resizable=no,status=0';
	winCalendario = window.open( mypage, myname, settings);
}

function openCalendarioRes()
{
	var mypage = "calendario.php?ID_ALOJAMIENTO="+document.formulario.ID_ALOJAMIENTO.value;	
	var myname = "calendario";
	var h = 200;
	var w = 205;
	
	settings = 'height='+h+',width='+w+',top=0,left=0, scrollbars=no, resizable=no,status=0';
	
	winCalendario = window.open( mypage, myname, settings);
	
}

function openCalendarioResb()
{
	var mypage = "/dinamic/layerPresentation/calendario.php?ID_ALOJAMIENTO="+document.formulario.ID_ALOJAMIENTO.value;	
	var myname = "calendario";
	var h = 200;
	var w = 205;
	
	settings = 'height='+h+',width='+w+',top=0,left=0, scrollbars=no, resizable=no,status=0';
	
	winCalendario = window.open( mypage, myname, settings);
	
}

function closeCalendario() {	
	if (winCalendario!= null) {
		if (  winCalendario.name != undefined)		
			winCalendario.close();	
	}	
	winCalendario= null;	
}

