/********************************************************************/
/* Codigo JS para el pase de fotografias de la cabecera (slideshow) */
/********************************************************************/
var slideCache = new Array();
function RunSlideShow(pictureName,imageFiles,displaySecs){
	
	var imageSeparator = imageFiles.indexOf(";");
	var nextImage = imageFiles.substring(0,imageSeparator);
	
	if (document.all){
		document.getElementById(pictureName).style.filter="blendTrans(duration=2)";
		document.getElementById(pictureName).filters.blendTrans.Apply();
	}
	
	document.getElementById(pictureName).src = nextImage;
	
	if (document.all){
		document.getElementById(pictureName).filters.blendTrans.Play();
	}
	
	var futureImages= imageFiles.substring(imageSeparator+1,imageFiles.length)+ ';' + nextImage;
	setTimeout("RunSlideShow('"+pictureName+"','"+futureImages+"',"+displaySecs+")",displaySecs*1000);

	// Cache the next image to improve performance.
	imageSeparator = futureImages.indexOf(";");
	nextImage = futureImages.substring(0,imageSeparator);
	
	if (slideCache[nextImage] == null) {
		slideCache[nextImage] = new Image;
		slideCache[nextImage].src = nextImage;
	}
}


/************************************************************/
/* Codigo para redimensionar el texto de un div determinado */
/************************************************************/

function zoomText(Accion,Elemento){
	//inicializacion de variables y parámetros 
	var obj=document.getElementById(Elemento);
	var max = 175 //tamaño máximo del fontSize
	var min = 75 //tamaño mínimo del fontSize
	if (obj.style.fontSize==""){
		obj.style.fontSize="100%";
	}

	actual=parseInt(obj.style.fontSize); //valor actual del tamaño del texto 
	incremento=4;// el valor del incremento o decremento en el tamaño 

	//accion sobre el texto 
	if( Accion=="reestablecer" ){
		obj.style.fontSize="100%"
	}
	if( Accion=="aumentar" && ((actual+incremento) <= max )){
		valor=actual+incremento;
		obj.style.fontSize=valor+"%"
	}
	if( Accion=="disminuir" && ((actual+incremento) >= min )){
	valor=actual-incremento;
	obj.style.fontSize=valor+"%"
	}
}

/**********************************************************************************************/
/* Evita la aparicion de errores por falta de implementaciones de Microsoft Internet Explorer */
/**********************************************************************************************/
window.onerror = new Function("return true");


/********************************************************/
/* Redimensiona los iframes automaticamente (OBSOLETO) */
/*******************************************************/
function sizeFrame()
{
	var F = document.getElementById("ifrm");
	if(F.contentDocument) {
		if (navigator.appName == "Microsoft Internet Explorer"){
				F.height = F.contentDocument.body.scrollHeight+30; //IE8
		}else{
			F.height = F.contentDocument.documentElement.scrollHeight+30; //FF 3.0.11, Opera 9.63 and Chrome
		}
	} else {
		F.height = F.contentWindow.document.body.scrollHeight+30; //IE6, IE7 and Chrome
	}
}

/*********************************************/
/* Deja marcado el enlace activo del menu h. */
/*********************************************/
function activar(id){
	var allHTMLTags = new Array();
	var allHTMLTags=document.getElementsByTagName("li");

	for (i=0; i<allHTMLTags.length; i++) {
		if (allHTMLTags[i].className=="on") {
			allHTMLTags[i].className="";
		}
	}
	var elemento = document.getElementById(id);
	elemento.className = "on";			
}

/*********************************************/
/* Opciones para el round-corners.           */
/*********************************************/
var settings = {
	  tl: { radius: 0 },
	  tr: { radius: 0 },
	  bl: { radius: 20 },
	  br: { radius: 20 },
	  antiAlias: true,
	  autoPad: true};
	  
var settings2 = {
	  tl: { radius: 20 },
	  tr: { radius: 20 },
	  bl: { radius: 0 },
	  br: { radius: 0 },
	  antiAlias: true,
	  autoPad: true};