/**********************************************************

	Sección: Administración (todo el área)

	Descripción: funciones para mostrar fecha y hora

***********************************************************/

<!-- Función parpedeo() -->
function parpadeo()
{
	if(document.getElementById('plazo_abierto').style.visibility=="hidden")
	{
		document.getElementById('plazo_abierto').style.visibility= "visible"
	}
	else
	{
		document.getElementById('plazo_abierto').style.visibility= "hidden"
	}
}

<!-- Código para mostrar el reloj -->
function muestra_reloj()
{ 
	momentoActual = new Date();
	hora = momentoActual.getHours();
	minuto = momentoActual.getMinutes();
	segundo = momentoActual.getSeconds(); 
	if (hora < 10)
		hora = "0" + hora;
	if (minuto < 10)
		minuto = "0" + minuto;
	if (segundo < 10)
		segundo = "0" + segundo;
	horaImprimible = hora + ":" + minuto + ":" + segundo + "&nbsp;";
	document.getElementById('reloj').innerHTML = horaImprimible;
	setTimeout("muestra_reloj()",1000);
}

<!-- Código para mostrar la fecha -->
function muestra_fecha()
{
	var mydate=new Date();
	var year=mydate.getYear();
	if (year < 1000)
	year+=1900;
	var day=mydate.getDay();
	var month=mydate.getMonth();
	var daym=mydate.getDate();
	if (daym<10)
	daym="0"+daym;
	var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sábado");
	var montharray=new Array("01","02","03","04","05","06","07","08","09","10","11","12");
	fechaImprimible = daym + "." + montharray[month] + "." + year;
	document.getElementById('fecha_actual').innerHTML = fechaImprimible;
}





/******************************************

	Sección: Introducción (index.php)		  

	Descripción: fade in con temporizador

*******************************************/



var steps=15;	// How many steps would you like for fading?. Max is 100, min is 1.

var gap=75;		// How long would you like the delay between each frame 

				// (in 1/1000 ths of a second)? Min is 1, max should be no more

				// than 10000 (10 seconds).

var n=0;

var m=0;

steps=(steps<1 || steps>100)?15:steps.toFixed(0);

gap=(gap<1)?75:gap.toFixed(0);



function fade()

{

	m=Math.round(n/steps*100);

	// Uncomment the beginning of following line for a different fade effect. 

	//It will fade in quicker.

	// m=Math.round(Math.pow((n/steps*Math.pow(100,(1/2))),2));	

	document.getElementById("logo_intro").style.filter="alpha(opacity="+m+")";

	n++;

	

	if(n<=steps){setTimeout("fade()",gap);}

}





/******************************************

	Sección: Introducción (index.php)		  

	Descripción: fade out

*******************************************/



function opacity(id, opacStart, opacEnd, millisec) {

	//speed for each frame

	var speed = Math.round(millisec / 100);

	var timer = 0;



	//determine the direction for the blending, if start and end are the same nothing happens

	if(opacStart > opacEnd) {

		for(i = opacStart; i >= opacEnd; i--) {

			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));

			timer++;

		}

	} else if(opacStart < opacEnd) {

		for(i = opacStart; i <= opacEnd; i++)

			{

			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));

			timer++;

		}

	}

}



//change the opacity for different browsers

function changeOpac(opacity, id) {

	var object = document.getElementById(id).style; 

	object.opacity = (opacity / 100);

	object.MozOpacity = (opacity / 100);

	object.KhtmlOpacity = (opacity / 100);

	object.filter = "alpha(opacity=" + opacity + ")";

}



function shiftOpacity(id, millisec) {

	//if an element is invisible, make it visible, else make it ivisible

	if(document.getElementById(id).style.opacity == 0) {

		opacity(id, 0, 100, millisec);

	} else {

		opacity(id, 100, 0, millisec);

	}

}



function blendimage(divid, imageid, imagefile, millisec) {

	var speed = Math.round(millisec / 100);

	var timer = 0;

	

	//set the current image as background

	document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";

	

	//make image transparent

	changeOpac(0, imageid);

	

	//make new image

	document.getElementById(imageid).src = imagefile;



	//fade in image

	for(i = 0; i <= 100; i++) {

		setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));

		timer++;

	}

}



function currentOpac(id, opacEnd, millisec) {

	//standard opacity is 100

	var currentOpac = 100;

	

	//if the element has an opacity set, get it

	if(document.getElementById(id).style.opacity < 100) {

		currentOpac = document.getElementById(id).style.opacity * 100;

	}



	//call for the function that changes the opacity

	opacity(id, currentOpac, opacEnd, millisec)

}







/******************************************

	Sección: General (todo el sitio)		  

	Descripción: agregar a Favoritos

*******************************************/



function agregar()

{ 

   if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) 

   { 

      var url="http://www.cdwc.es/isla/"; 

      var titulo="Noveno Festival de Islantilla - Cine y Televisión"; 

      window.external.AddFavorite(url,titulo); 

   } 

   else 

   { 

    	if(navigator.appName == "Netscape") 

        	window.sidebar.addPanel('Noveno Festival de Islantilla - Cine y Televisión','http://www.cdwc.es/isla/','')

   }

}



/******************************************

	Para crossfader (Seccion contactar)

******************************************/



var useBSNns;

if (useBSNns)

{

	if (typeof(bsn) == "undefined")

		bsn = {}

	var _bsn = bsn;

}

else

{

	var _bsn = this;

}



_bsn.Crossfader = function (divs, fadetime, delay )

{	

	this.nAct = -1;

	this.aDivs = divs;

	

	for (var i=0;i<divs.length;i++)

	{

		document.getElementById(divs[i]).style.opacity = 0;

		document.getElementById(divs[i]).style.position = "absolute";

		document.getElementById(divs[i]).style.filter = "alpha(opacity=0)";

		document.getElementById(divs[i]).style.visibility = "hidden";

	}

	

	this.nDur = fadetime;

	this.nDelay = delay;

		

	this._newfade();

}





_bsn.Crossfader.prototype._newfade = function()

{

	if (this.nID1)

		clearInterval(this.nID1);

	

	this.nOldAct = this.nAct;

	this.nAct++;

	if (!this.aDivs[this.nAct])	this.nAct = 0;

	document.getElementById( this.aDivs[this.nAct] ).style.visibility = "visible";

	

	this.nInt = 50;

	this.nTime = 0;

	

	var p=this;

	this.nID2 = setInterval(function() { p._fade() }, this.nInt);

}





_bsn.Crossfader.prototype._fade = function()

{

	this.nTime += this.nInt;

	

	var op = this._easeInOut(this.nTime, 0, 1, this.nDur);

	var ieop = op*100;

	document.getElementById( this.aDivs[this.nAct] ).style.opacity = op;

	document.getElementById( this.aDivs[this.nAct] ).style.filter = "alpha(opacity="+ieop+")";

	

	if (this.nOldAct > -1)

	{

		document.getElementById( this.aDivs[this.nOldAct] ).style.opacity = 1 - op;

		document.getElementById( this.aDivs[this.nOldAct] ).style.filter = "alpha(opacity="+(100 - ieop)+")";

	}

	

	if (this.nTime == this.nDur)

	{

		clearInterval( this.nID2 );

		

		if (this.nOldAct > -1)

			document.getElementById( this.aDivs[this.nOldAct] ).style.visibility = "hidden";	

		

		var p=this;

		this.nID1 = setInterval(function() { p._newfade() }, this.nDelay);

	}

}



_bsn.Crossfader.prototype._easeInOut = function(t,b,c,d)

{

	return c/2 * (1 - Math.cos(Math.PI*t/d)) + b;

}





/* Abrir ventana popup */



function abrir(direccion, pantallacompleta, herramientas, direcciones, estado, barramenu, barrascroll, cambiatamano, ancho, alto, izquierda, arriba, sustituir)

{

     var opciones = "fullscreen=" + pantallacompleta +

                 ",toolbar=" + herramientas +

                 ",location=" + direcciones +

                 ",status=" + estado +

                 ",menubar=" + barramenu +

                 ",scrollbars=" + barrascroll +

                 ",resizable=" + cambiatamano +

                 ",width=" + ancho +

                 ",height=" + alto +

                 ",left=" + izquierda +

                 ",top=" + arriba;

     var ventana = window.open(direccion,"venta",opciones,sustituir);

}                     







/* Aumento, reduccion y restablecimiento del texto (fuente mas, menos o normal */



function aumentar () 

{

	incremento+=.25;

	tamano = original + incremento;

	document.getElementById("contenedor").style.fontSize = tamano + "em";

}



/* 	C&oacute;digo para reducir el tamaño del texto. */

function reducir () 

{

	incremento-=.25;

	tamano = original + incremento;

	document.getElementById("contenedor").style.fontSize = tamano + "em";

}



/* 	C&oacute;digo para restaurar el tamaño del texto a su valor original. */

function restaurar () 

{

	document.getElementById("contenedor").style.fontSize = original + "em";

	tamano = 0;

	incremento = 0;

}