// array function     
        function makeArray(len)   
        {       for (var i = 0; i < len; i++)  
                {       this[i] = null  
                }  
                this.length = len  
        }   
  
// array of day names  
        var daynames = new makeArray(7)  
        daynames[0] = "Domingo"  
        daynames[1] = "Lunes"  
        daynames[2] = "Martes"  
        daynames[3] = "Mi&eacute;rcoles"  
        daynames[4] = "Jueves"  
        daynames[5] = "Viernes"  
        daynames[6] = "S&aacute;bado"  
          
// array of month names  
        var monthnames = new makeArray(12)  
        monthnames[0] = "Enero"  
        monthnames[1] = "Febrero"  
        monthnames[2] = "Marzo"  
        monthnames[3] = "Abril"  
        monthnames[4] = "Mayo"  
        monthnames[5] = "Junio"  
        monthnames[6] = "Julio"  
        monthnames[7] = "Agosto"  
        monthnames[8] = "Septiembre"  
        monthnames[9] = "Octubre"  
        monthnames[10] = "Noviembre"  
        monthnames[11] = "Diciembre"   

// define date variables  
        var now = new Date()  
        var day = now.getDay()  
        var month = now.getMonth()  
        var year = now.getYear()  
        var date = now.getDate()  
        var hour=now.getHours()  
        var minutes=now.getMinutes()  
        var segundos = now.getSeconds()
          
          
// write date  
  function writeDate()  
  {
    document.write(daynames[day] + ", "+ date + " de " + monthnames[month] +" del ");
   if (year < 2000)
	document.write ( year+1900);
   if (year >= 2000)
	document.write (year);
    document.write ("&nbsp;&nbsp;| &nbsp;<FONT color=white>"+ hour + ":" + minutes + ":" + segundos + " h  </FONT>");
 }

  function EscribeFecha()
  {
    document.write(date);
	document.write("/");
	document.write(month+1);
	document.write("/");
   if (year < 2000)
	document.write ( year+1900);
   if (year >= 2000)
	document.write (year);
 }

	function EscribeHora ()
	{
	    document.write (hour + ":" + minutes + ":" + segundos + " h ");
	}



	var imagen=0;
//funcion de carga aleatoria de imagenes
function ImgRamdom()
{
	imagen = segundos%4 + 1;
	document.write ("<IMG src='../photos/ramdom"+imagen+".jpg'>");
}

function AbreMapa(){
	MapaCarreteras=open("../thumbnails/carreteras.htm","mapadecarreteras","toolbar=no,directories=no,menubar=no,status=yes,width=640, height=480");
}

function AbreMapa2(){
	MapaCarreteras=open("../thumbnails/situacion.htm","mapadesituacion","toolbar=no,directories=no,menubar=no,status=yes,width=610, height=470");
}

function AbreCallejero(){
	Callejero=open("../callejero/zona.htm","callejero","toolbar=no,directories=no,menubar=no,status=yes,width=699, height=528");
}

function AbreCentinela(){
	centinela=open("../thumbnails/centinela.htm","centinela","toolbar=no,directories=no,menubar=no,status=no,width=250, height=450");
}

function AbreTeatro(){
	Teatro=open("../thumbnails/teatro.htm","teatro","toolbar=no,directories=no,menubar=no,status=no,width=400, height=425");
}


// funcion para ampliar una imagen
// Parámetros: nombre de la ventana, path de la imagen, título de página, tamaño);
function AmpliarImagen(ventana, path, titulo, ancho, alto){
	ventana=open("zoom.htm",ventana,"toolbar=no,directories=no,menubar=no,status=yes,width="+ancho+", height="+alto);
	ventana.document.write ("<HTML><HEAD>");
	ventana.document.write ("<TITLE>"+titulo+"</TITLE></HEAD><BODY bgcolor='white' topmargin=0 leftmargin=0>");
	ventana.document.write ("<IMG src="+path+"><BR>");
	ventana.document.write ("</BODY></HTML>");
}

// funcion para reproducir galeria de fotos
function ReproducirGaleria(ancho, alto) {
	galeria=open("../applets/galeria.html", 'galeria', "fullscreen=0 , toolbar=0 , location=0 , status=0 , menubar=0 , scrollbars=0 , width="+ancho+", height="+alto);
}


// funcion para reproducir galeria de fotos encuentro juvenil 2008
function ReproducirGaleria08(ancho, alto) {
	galery=open("../applets/galeria08.html", 'galery', "fullscreen=0 , toolbar=0 , location=0 , status=0 , menubar=0 , scrollbars=0 , width="+ancho+", height="+alto);
}


// funcion para reproducir galeria de fotos general
function ReproducirGalery(ancho, alto) {
	galery=open("../applets/galery.html", 'galery', "fullscreen=0 , toolbar=0 , location=0 , status=0 , menubar=0 , scrollbars=0 , width="+ancho+", height="+alto);


}


// funcion para reproducir galeria de fotos viaje juventud a londres
function ReproducirGalerylon(ancho, alto) {
	galerylon=open("../applets/galerylon.html", 'galery', "fullscreen=0 , toolbar=0 , location=0 , status=0 , menubar=0 , scrollbars=0 , width="+ancho+", height="+alto);
}


// funcion para reproducir galeria de fotos nevada
function ReproducirGaleryn(ancho, alto) {
	galeryn=open("../applets/galeryn.html", 'galery', "fullscreen=0 , toolbar=0 , location=0 , status=0 , menubar=0 , scrollbars=0 , width="+ancho+", height="+alto);
}


// funcion para abrir la ventana de como llegar
function OpenWinHowToGet(){
	comollegar=open("../thumbnails/comollegar.htm","como_llegar","toolbar=no,directories=no,menubar=no,status=yes,width=300, height=325");

}

// funcion para abrir la ventana de poblacion
function OpenWinPoblacion(){
	poblac=open("../thumbnails/poblacion.htm","poblacion","toolbar=no,directories=no,menubar=no,status=yes,width=500, height=325");
}


// ::::::::::::::::::::::::::::::::::::::::::::
// Indice izquierdo

  function EscribeIndice()  
  {
		document.write("<IMG src='../imagenes/montefrio.jpg'><BR>");
		document.write("<TABLE background='../imagenes/fondomenu1.jpg' width='100%'><TR><TD><DIV ALIGN='right'>");	
        document.write("<FONT face='Verdana, Arial' color='#BFCCEB' size=1><BR>");
	    document.write("<A class='wcBar' href='localizacion.htm' title=''>Localizaci&oacute;n <IMG src='../imagenes/flecha.gif' border='0' align='middle'></A><BR>");
		document.write("<A class='wcBar' href='historia.htm' title=''>Historia <IMG src='../imagenes/flecha.gif' border='0' align='middle'></A><BR>");
		document.write("<A class='wcBar' href='monumentos.htm' title='Patrimonio monumental: castillo de la Villa, la Encarnación, fortaleza &aacute;rabe, puente romano,...'>Monumentos <IMG src='../imagenes/flechas.gif' border='0' align='middle'></A><BR>");
		document.write("<A class='wcBar' href='escudo.htm' title='Descripcion del Escudo Heráldico y Logotipo'> Escudo y Logo <IMG src='../imagenes/flechas.gif' border='0' align='middle'></A><BR>");
		document.write("<A class='wcBar' href='pgitanos.htm' title=''>Las Peñas <IMG src='../imagenes/flecha.gif' border='0' align='middle'></A><BR>");
		document.write("<A class='wcBar' href='fiestas.htm' title=''>Fiestas <IMG src='../imagenes/flecha.gif' border='0' align='middle'></A><BR>");
		document.write("<A class='wcBar' href='gastronomia.htm' title=''>Gastronom&iacute;a <IMG src='../imagenes/flecha.gif' border='0' align='middle'></A><BR>");
		document.write("<A class='wcBar' href='agricultura.htm' title=''>Agricultura <IMG src='../imagenes/flecha.gif' border='0' align='middle'></A><BR>");
		document.write("<A class='wcBar' href='rutas.htm' title=''>Rutas <IMG src='../imagenes/flecha.gif' border='0' align='middle'></A><BR>");
		document.write("<A class='wcBar' href='javascript:AbreCallejero();' title=''>Callejero <IMG src='../imagenes/flecha.gif' border='0' align='middle'></A><BR>");
		document.write("<A class='wcBar' href='alojamientos.htm' title=''>Alojamientos <IMG src='../imagenes/flecha.gif' border='0' align='middle'></A><BR>");
		document.write("<A class='wcBar' href='restaurantes.htm' title=''>Restaurantes <IMG src='../imagenes/flecha.gif' border='0' align='middle'></A><BR>");
		document.write("<A class='wcBar' href='galerias.htm' title=''>Foto-Galerías <IMG src='../imagenes/flechas.gif' border='0' align='middle'></A><BR>");
		document.write("<A class='wcBar' href='enlaces.htm' title=''>Enlaces <IMG src='../imagenes/flecha.gif' border='0' align='middle'></A><BR><br>");
		document.write("</TD></TR></TABLE>");
		
		document.write("<IMG src='../imagenes/ayto.jpg'><BR>");
		document.write("<TABLE background='../imagenes/fondomenu2.jpg' width='100%'><TR><TD><DIV ALIGN='left'>");	
        document.write("<FONT face='Verdana, Arial' color='#BFCCEB' size=1><BR>");
		document.write("&nbsp;<A class='wcBar' href='corporacion.htm' title='Corporación Municipal / Plenos'><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Corporación / Plenos</A><BR>");
		document.write("&nbsp;<A class='wcBar' href='tablon.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Tabl&oacute;n de Anuncios </A><BR>");
		document.write("&nbsp;<A class='wcBar' href='notpress.htm' title='Notas de prensa (Información Local)'><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Notas de Prensa<IMG src='../imagenes/new.gif' border='0'></A><BR>");
		document.write("&nbsp;<A class='wcBar' href='ordenanzas.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Ordenanzas Municipales </A><BR>");
		document.write("&nbsp;<A class='wcBar' href='contratante.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Perfil de Contratante </A><BR>");
		document.write("&nbsp;<A class='wcBar' href='pgou.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> P. G. O. U. </A><BR>");
		document.write("&nbsp;<A class='wcBar' href='proyectos.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Proyectos Municipales</A><BR>");
		document.write("&nbsp;<A class='wcBar' href='seguridad.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Seguridad Ciudadana</A><BR>");
		document.write("&nbsp;<A class='wcBar' href='guarderia.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Guardería (C.A.S.E.) </A><BR>");
		document.write("&nbsp;<A class='wcBar' href='educacion.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Educaci&oacute;n</A><BR>");
		document.write("&nbsp;<A class='wcBar' href='sanidad.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Sanidad</A><BR>");
		document.write("&nbsp;<A class='wcBar' href='biblioteca.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Biblioteca</A><BR>");
		document.write("&nbsp;<A class='wcBar' href='deportes.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Deportes</A><BR>");
		document.write("&nbsp;<A class='wcBar' href='juventud.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Juventud</A><BR>");
		document.write("&nbsp;&nbsp;&nbsp;&nbsp;<A class='wcBar' href='juventud2.htm' title=''> Campos de trabajo</A><BR>");
		document.write("&nbsp;<A class='wcBar' href='cmim.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> C. INFORMACION A LA MUJER</A><BR>");
		document.write("&nbsp;<A class='wcBar' href='opdl.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> OPDL</A><BR>");
		document.write("&nbsp;<A class='wcBar' href='orienta.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Unidad ANDALUCIA ORIENTA</A><BR>");
		document.write("&nbsp;<A class='wcBar' href='http://www.guadalinfo.es/ficha_centro.php?id_centro=218''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Centro GUADALINFO </A><BR>");
		document.write("&nbsp;<A class='wcBar' href='cultura.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Cultura<IMG src='../imagenes/new.gif' border='0'></A><BR>");
		document.write("&nbsp;<A class='wcBar' href='tabloncu.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Tablón Cultural (Prg. Fiestas)</A><BR>");
		document.write("&nbsp;<A class='wcBar' href='cementerio.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Cementerio</A><BR>");
		document.write("&nbsp;<A class='wcBar' href='aemo.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> AEMO</A><BR>");
		document.write("&nbsp;<A class='wcBar' href='turismo.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Turismo</A><BR>");
		document.write("&nbsp;<A class='wcBar' href='http://www.montefriofm.com' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Radio Montefr&iacute;o</A><BR>");
		document.write("&nbsp;<A class='wcBar' href='servsociales.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> Servicios Sociales</A><BR>");
		document.write("&nbsp;<A class='wcBar' href='impresos.htm' title=''><IMG src='../imagenes/flecha.gif' border='0' align='middle'> IMPRESOS (Rellenables)</A><BR>");
				document.write("</TD></TR></TABLE>");
		document.write("<IMG src='../imagenes/linea.jpg' border=0>");
} 


// :::::::::::::::::::::::::::::::::::::::::
// Funcion que escribe el pie en la pagina: copyright, direccion, y recomendaciones
function EscribePiePagina(){
	    document.write("<FONT color='navy' face='Arial, Verdana, Helvetica' size=1><CENTER> &copy; Ayuntamiento de Montefr&iacute;o. Plaza de Espa&ntilde;a, 7. Tlfno: 958 336 136. FAX: 958 336 186. E-Mail: ayuntamiento@montefrio.org<BR>");
	    document.write("<CENTER>Página optimizada para Internet Explorer o Netscape 5.0 o superiores. Resoluci&oacute;n m&iacute;nima: 800x600.<BR></FONT>");
}


// :::::::::::::::::::::::::::::::::::::::::
// FUNCIONES PARA MOSTRAR EL MENU DE ACCESO RAPIDO (FORMULARIO DE LA CABECERA)

function EscribeMenuSalto(){
		document.write("<FORM name='formulario'>");
		document.write("<SELECT NAME='menu1' SIZE=1 onChange ='irA(this)' style='font-size: 9px; font-style: normal; font-weight: bold; font-family:Verdana, Arial;'>");
		document.write("<OPTION>Montefr&iacute;o...");
		document.write("<OPTION VALUE='localizacion'>Localizaci&oacute;n");
		document.write("<OPTION VALUE='historia'>Historia");
		document.write("<OPTION VALUE='monumentos'>Monumentos");
		document.write("<OPTION VALUE='escudo'>Escudo y Logotipo");
		document.write("<OPTION VALUE='gitanos'>Las Pe&ntilde;as");
		document.write("<OPTION VALUE='fiestas'>Fiestas");
		document.write("<OPTION VALUE='gastronomia'>Gastronom&iacute;a");
		document.write("<OPTION VALUE='agricultura'>Agricultura");
		document.write("<OPTION VALUE='rutas'>Rutas");
		document.write("<OPTION VALUE='callejero'>Callejero");
		document.write("<OPTION VALUE='alojamientos'>Alojamientos");
		document.write("<OPTION VALUE='restaurantes'>Restaurantes");
		document.write("<OPTION VALUE='galerya'>Galerías");
		document.write("<OPTION VALUE='enlaces'>Enlaces");
		document.write("</SELECT>");
		
		document.write("<SELECT NAME='menu2' SIZE=1 onChange ='irA(this)' style='font-size: 9px; font-style: normal; font-weight: bold; font-family:Verdana, Arial;'>");
		document.write("<OPTION>Ayuntamiento...");
		document.write("<OPTION VALUE='gobierno'>Corporación Municipal");
		document.write("<OPTION VALUE='tablon'>Tabl&oacute;n de Anuncios");
		document.write("<OPTION VALUE='notas'>Notas de Prensa");
		document.write("<OPTION VALUE='perfil'>Perfil de Conratante");
		document.write("<OPTION VALUE='pgou'>P.G.O.U.");
		document.write("<OPTION VALUE='ordenanzas'>Ordenanzas Mnicipales");
		document.write("<OPTION VALUE='proyectos'>Proyectos Municipales");
		document.write("<OPTION VALUE='seguridad'>Seguridad Ciudadana");
		document.write("<OPTION VALUE='guardería'>Guarderia (C.A.S.E.)");
		document.write("<OPTION VALUE='educacion'>Educaci&oacute;n");
		document.write("<OPTION VALUE='sanidad'>Sanidad");
		document.write("<OPTION VALUE='biblioteca'>Biblioteca");
		document.write("<OPTION VALUE='deportes'>Deportes");
		document.write("<OPTION VALUE='juventud'>Juventud");
		document.write("<OPTION VALUE='campost'>Campos de Trabajo");
		document.write("<OPTION VALUE='cmim'>Centro Inf. a la Mujer");
		document.write("<OPTION VALUE='opdl'>OPDL");
		document.write("<OPTION VALUE='orienta'>Ud. Andalucía ORIENTA");
		document.write("<OPTION VALUE='cultura'>Cultura");
		document.write("<OPTION VALUE='tabloncu'>Tablon Cultural");
		document.write("<OPTION VALUE='cementerio'>Cementerio");
		document.write("<OPTION VALUE='aemo'>AEMO");
		document.write("<OPTION VALUE='turismo'>Turismo");
		document.write("<OPTION VALUE='radio'>Radio Montefr&iacute;o");
		document.write("<OPTION VALUE='servicios'>Servicios Sociales");
		document.write("<OPTION VALUE='agenda'>Agenda Cultural");
		document.write("<OPTION VALUE='telefonos'>Directorio Telef&oacute;nico");
		document.write("<OPTION VALUE='empresas'>Empresas");
		document.write("<OPTION VALUE='asociaciones'>Asociaciones");
		document.write("<OPTION VALUE='impresos'>Impresos");
		document.write("</SELECT><FORM>");
}

function irA(menu){
  if (menu.options[menu.selectedIndex].value=="localizacion"){ top.location.href="localizacion.htm";}
  if (menu.options[menu.selectedIndex].value=="historia"){ top.location.href="historia.htm";}
  if (menu.options[menu.selectedIndex].value=="monumentos"){ top.location.href="monumentos.htm";}
  if (menu.options[menu.selectedIndex].value=="escudo"){ top.location.href="escudo.htm";}
  if (menu.options[menu.selectedIndex].value=="gitanos"){ top.location.href="pgitanos.htm";}
  if (menu.options[menu.selectedIndex].value=="fiestas"){ top.location.href="fiestas.htm";}
  if (menu.options[menu.selectedIndex].value=="gastronomia"){ top.location.href="gastronomia.htm";}
  if (menu.options[menu.selectedIndex].value=="agricultura"){ top.location.href="agricultura.htm";}
  if (menu.options[menu.selectedIndex].value=="rutas"){ top.location.href="rutas.htm";}
  if (menu.options[menu.selectedIndex].value=="callejero"){ top.location.href="javascript:AbreCallejero();";}
  if (menu.options[menu.selectedIndex].value=="alojamientos"){ top.location.href="alojamientos.htm";}
  if (menu.options[menu.selectedIndex].value=="restaurantes"){ top.location.href="restaurantes.htm";}
  if (menu.options[menu.selectedIndex].value=="galerya"){ top.location.href="galerias.htm";}
  if (menu.options[menu.selectedIndex].value=="enlaces"){ top.location.href="enlaces.htm";}
	
  if (menu.options[menu.selectedIndex].value=="gobierno"){ top.location.href="corporacion.htm";}
  if (menu.options[menu.selectedIndex].value=="tablon"){ top.location.href="tablon.htm";}
  if (menu.options[menu.selectedIndex].value=="notas"){ top.location.href="notpress.htm";}
  if (menu.options[menu.selectedIndex].value=="ordenanzas"){ top.location.href="ordenanzas.htm";}
  if (menu.options[menu.selectedIndex].value=="perfil"){ top.location.href="contratante.htm";}
  if (menu.options[menu.selectedIndex].value=="pgou"){ top.location.href="pgou.htm";}
  if (menu.options[menu.selectedIndex].value=="proyectos"){ top.location.href="proyectos.htm";}	
  if (menu.options[menu.selectedIndex].value=="seguridad"){ top.location.href="seguridad.htm";}
  if (menu.options[menu.selectedIndex].value=="guarderia"){ top.location.href="guarderia.htm";}	
  if (menu.options[menu.selectedIndex].value=="educacion"){ top.location.href="educacion.htm";}
  if (menu.options[menu.selectedIndex].value=="sanidad"){ top.location.href="sanidad.htm";}
  if (menu.options[menu.selectedIndex].value=="biblioteca"){ top.location.href="biblioteca.htm";}
  if (menu.options[menu.selectedIndex].value=="deportes"){ top.location.href="deportes.htm";}
  if (menu.options[menu.selectedIndex].value=="juventud"){ top.location.href="juventud.htm";}
  if (menu.options[menu.selectedIndex].value=="campost"){ top.location.href="juventud2.htm";}
  if (menu.options[menu.selectedIndex].value=="cmim"){ top.location.href="cmim.htm";}
  if (menu.options[menu.selectedIndex].value=="opdl"){ top.location.href="opdl.htm";}
  if (menu.options[menu.selectedIndex].value=="orienta"){ top.location.href="orienta.htm";}
  if (menu.options[menu.selectedIndex].value=="cultura"){ top.location.href="cultura.htm";}
  if (menu.options[menu.selectedIndex].value=="cultura"){ top.location.href="tabloncu.htm";}
  if (menu.options[menu.selectedIndex].value=="cementerio"){ top.location.href="cementerio.htm";}
  if (menu.options[menu.selectedIndex].value=="aemo"){ top.location.href="aemo.htm";}
  if (menu.options[menu.selectedIndex].value=="turismo"){ top.location.href="turismo.htm";}
  if (menu.options[menu.selectedIndex].value=="radio"){ top.location.href="http://www.montefriofm.com";}
  if (menu.options[menu.selectedIndex].value=="servicios"){ top.location.href="servsociales.htm";}
  if (menu.options[menu.selectedIndex].value=="agenda"){ top.location.href="cultura.htm";}
  if (menu.options[menu.selectedIndex].value=="telefonos"){ top.location.href="telefonos.htm";}
  if (menu.options[menu.selectedIndex].value=="empresas"){ top.location.href="empresas.htm";}
  if (menu.options[menu.selectedIndex].value=="asociaciones"){ top.location.href="asociaciones.htm";}
  if (menu.options[menu.selectedIndex].value=="impresos"){ top.location.href="impresos.htm";}
  
}