function hoy_tipo1(){
	fecha = new Date();
	mes = fecha.getMonth();
	diaMes = fecha.getDate();
	anio = fecha.getFullYear();
	dia = fecha.getDay();
	dias = new Array('Domingo','Lunes','Martes','Miercoles','Jueves','Viernes','Sábado');
	meses = new Array('Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre');
    document.write (diaMes + " de " + meses[mes] + " de " + anio);
}

function Hoy() {
	DiaActual = new Date();
	document.calendario.mes.value=DiaActual.getMonth()+1;
	document.calendario.ano.value=DiaActual.getYear();
	document.calendario.submit();
}

function over(img,ruta) {
  img.src=ruta;
}

function out(img,ruta) {
  img.src=ruta;
}
function imagen_thumb(miimg,img_tmp,tamano) {
	porcentaje=(tamano*100)/img_tmp.width;
	reducido=(porcentaje*img_tmp.height)/100;
	//miimg.src=img_tmp.src;
	miimg.width=tamano;
	miimg.height=reducido;
	//alert(img_tmp.src);
	parent.celda.height = tabla.offsetHeight;
}

var ocultar = "";
var etiqueta = "";
	
function cambiaEstado(iden) {
	var este = document.getElementById(iden);
	if (este.style.display == 'block')
		este.style.display = 'none';
	else
		este.style.display = 'block';
	if (ocultar!= "" && este!=ocultar) {
		ocultar.style.display = 'none';
	}
	if (etiqueta != "") {
		etiqueta.style.display = 'none';
	}
	ocultar=document.getElementById(iden);
	//parent.resizeIframe("cont",0);
}

function abre(url_ventana,nombre,ancho,alto) {
	var opciones="toolbar=no,resizable=no,directories=no,channelmode=no,menubar=no,status=no,scrollbars=yes,resizable=no,width="+ancho+",height="+alto;
	ventana=window.open(url_ventana,nombre,opciones);
	ventana.focus();
}

function redim() {
	parent.document.getElementById("cont").style.height = null;
	parent.celda.height = null;
	parent.celda.style.height = "0px";
	parent.document.getElementById("cont").style.height = thistabla.offsetHeight+30;
	parent.celda.height = thistabla.offsetHeight;
	//alert(thistabla.offsetHeight);
}

function validar(campo) {
	formulario=document.datos.elements[campo]  //llamando solicitud al formulario con el parámetro name
	//alert(document.datos.elements[campo].name);
    if (formulario.value == "" || formulario.value == "nada") {
		alert ("Existen campos obligatorios vacios, asegurese de darles un valor");
		formulario.focus(); 
		//alert(formulario.value);
		return false;
	} else {
        return true;
    }
}

function abre(url_ventana,nombre,ancho,alto) {
	var opciones="toolbar=no,resizable=no,directories=no,channelmode=no,menubar=no,status=no,scrollbars=yes,resizable=no,width="+ancho+",height="+alto;
	ventana=window.open(url_ventana,nombre,opciones);
	ventana.focus();
}

function abrir_grande(mifoto,nombre) {
  // CREAMOS UN NUEVO OBJETO IMAGEN EN DONDE CARGAMOS LA IMAGEN Q ESTA 
  // ACTUALMENTE CARGADA, Y DE LA CUAL COGEMOS EL ANCHO Y EL ALTO PARA 
  // ABRIR LA VENTANA CON EL MISMO TAMAÑO Q LA IMAGEN (DE OTRA FORMA NO
  // SE CARGAN BIEN LAS IMAGENES CUANDO SE SUBE A INTERNET Y LA VENTANA
  // NO SE ABRE EN EL TAMAÑO CORRECTO
    var imagen=new Image;
	imagen.src=mifoto+".jpg";
	ancho=imagen.width;
	alto=imagen.height;
    //alert(ancho);
    //alert(alto);
    foto=imagen.src;
    mi_ventana = window.open("../vacio.htm",nombre,"width="+ancho+", height="+alto+", status=no, resizable=no, directories=no, location=no, toolbar=no, menubar=no, scrollbars=no");
}
function escribir() {

  document.write('<head>');
  document.write('<title>CECAM - Confederación Regional de Empresarios de Castilla-La Mancha</title>');

  document.write('</head>');
  document.write('<body style="background-repeat: no-repeat; background-position: center center;" background="img/fondo_fotos.gif" leftmargin="0" topmargin="0">');
  document.write('<img name="grande" src="'+window.opener.foto+'">');
  document.write('</body>');

//  alert(grande.width);
//  alert(grande.height);
 
//  window.innerWidth=grande.width;
//  window.innerHeight=grande.height;
//  window.resizeTo(grande.width+10,grande.height+29);
	window.resizeTo(grande.width+10,grande.height+29);
}

var urlbase;
function anclas(miancla) {
	//alert(document.location.href);
	//alert(miancla);
	if (urlbase == null) {
		urlbase = document.location.href;
	} else {
		trozos = urlbase.split("#");
		urlbase = trozos[0];
	}
	document.location.href = urlbase + miancla;
}
