// sysyfus functions de cambio de opacidades
// thanx sysyfus from tierradenomadas.com!

var ELM = (document.getElementById);
var IE5 = ((ELM) && (navigator.userAgent.toLowerCase().indexOf('msie')!=-1) && (! window.opera));
var GKO = (navigator.userAgent.toLowerCase().indexOf('gecko')!=-1);

// mik's functions de plegado y desplegado 
// thanx mik from inklude.com!

function expandeCont(total,idNo){
	id='content'+idNo;
	if (window.getComputedStyle) { //leemos valor, solo Moz
  		if ( window.getComputedStyle(document.getElementById(id),null).display == 'none' ) {
	 		despliega(id);//despliego
			mikAllUP(total,idNo);
		} else {
			pliega(id);//pliego
		}
	} else if (document.getElementById(id).currentStyle.display) { //leemos valor, solo IE
 		if ( document.getElementById(id).currentStyle.display == 'none' ) {
			 despliega(id);//despliego
			 mikAllUP(total,idNo);
		} else {
			 pliega(id);//pliego
		}

	} else {
 		if ( document.getElementById(id).style.display == 'none' ) {
			 despliega(id);//despliego
			 mikAllUP(total,idNo);
		} else {
			 pliega(id);//pliego
		}	
	}
}

function mikAllUP(total,idNo) {
	for (var i=1; i <= total; i++){
		id='content'+i+'';
		if (i != idNo) {
			if (document.getElementById(id)){
				pliega(id);//pliego
			}
		}
	}
}

function pliega(id){
	document.getElementById(id).style.display = 'none';
}

function despliega(id){
	document.getElementById(id).style.display = 'block';//despliego
}

// freakhardous functions 

//function expande2(secc,cont) {
//	document.getElementById(secc).className = 'secc_expandida';
//	if (GKO) document.getElementById(secc).childNodes[0].style.MozOpacity = 0.5;
//	if (IE5) document.getElementById(secc).childNodes[0].style.filter = 'alpha(opacity='+50+')';
//	document.getElementById(cont).style.display = 'block';
//}

function setNavinfo(text) {
	document.getElementById("navinfo").childNodes[0].nodeValue = text;
}

//function squareOn(id) {
//	document.getElementById(id).className = 'but_square_on';
//}

//function squareOff(id) {
//	document.getElementById(id).className = 'but_square';
//}

function tabOn(id) {
	//if (GKO) document.getElementById(id).style.MozOpacity = 1;
	if (IE5) document.getElementById(id).style.filter = 'alpha(opacity='+100+')';
}

function tabOff() {
			//if (GKO) { 
				//document.getElementById('secc1').style.MozOpacity = 0.3; 
				//document.getElementById('secc2').style.MozOpacity = 0.5;
				//document.getElementById('secc3').style.MozOpacity = 0.6;
				//document.getElementById('secc4').style.MozOpacity = 0.8;
				//document.getElementById('secc5').style.MozOpacity = 0.9;
				//}
			if (IE5) { 
				document.getElementById('secc1').style.filter = 'alpha(opacity='+30+')';
				document.getElementById('secc2').style.filter = 'alpha(opacity='+50+')';
				document.getElementById('secc3').style.filter = 'alpha(opacity='+60+')';
				document.getElementById('secc4').style.filter = 'alpha(opacity='+80+')';
				document.getElementById('secc5').style.filter = 'alpha(opacity='+90+')';
				}
}

function setTabs() {
				document.getElementById('secc1').style.filter = 'alpha(opacity='+30+')';
				document.getElementById('secc2').style.filter = 'alpha(opacity='+50+')';
				document.getElementById('secc3').style.filter = 'alpha(opacity='+60+')';
				document.getElementById('secc4').style.filter = 'alpha(opacity='+80+')';
				document.getElementById('secc5').style.filter = 'alpha(opacity='+90+')';
}


//var noElements=5;

function expandeSecc(total,idNo){
	id='secc'+idNo;
	if (window.getComputedClassName) { //leemos valor, solo Moz
  		if ( window.getComputedClassName(document.getElementById(id),null).className == 'secc_plegada' ) {
	 		contrae(id);//despliego
			contraeAll(total,idNo);
		} else {
			expande(id);//pliego
		}
	} else if (document.getElementById(id).currentClassName) { //leemos valor, solo IE
 		if ( document.getElementById(id).currentClassName == 'secc_plegada' ) {
			 contrae(id);//despliego
			 contraeAll(total,idNo);
		} else {
			 expande(id);//pliego
		}

	} else {
 		if ( document.getElementById(id).className == 'secc_plegada' ) {
			 contrae(id);//despliego
			 contraeAll(total,idNo);
		} else {
			 expande(id);//pliego
		}	
	}
}

function contrae(id,cont){
	document.getElementById(id).className = 'secc_expandida';
}

function expande(id,cont){
	document.getElementById(id).className = 'secc_plegada';
}

function contraeAll(total,idNo) {
	for (var i=1; i <= total; i++){
		id='secc'+i+'';
		if (i != idNo) {
			if (document.getElementById(id)){
				expande(id);
			}
		}
	}
}

function subseccOn(id) {
	if (GKO) document.getElementById(id).style.MozOpacity = 0.9;
	if (IE5) document.getElementById(id).style.filter = 'alpha(opacity='+90+')';
}

function subseccOff(id) {
	if (GKO) document.getElementById(id).style.MozOpacity = 0.3;
	if (IE5) document.getElementById(id).style.filter = 'alpha(opacity='+30+')';
}

<!-- Randomizamos fonfo y color de los tabs -->
<!-- Basado en script de Gabriel Rodríguez (http://www.gamarod.com.ar) -->

// declaramos los fondos
var imagenes = new montavector (
"http://www.insert-coin.tv/ichtm/img/bg/icosbeta.gif"
//"../img/bg/alb50.jpg"
//"../img/bg/ic_johnb2.jpg"
//"../img/bg/bg-este.jpg"
//"../img/bg/bg-fillsofhouse.jpg",
//"../img/bg/bg-ictobcn.jpg",
//"../img/bg/bg-flanmetro.jpg",
);

// declaramos los colores
var colores = new montavector (
"#FF0066"
//"#F0A800"
//"#FF0033"
//"#FF0033"
//"#FFFF00",
//"#FFFFFF",
//"#00CCFF",

);

function fondo() {
hoy= new Date();
maximo=1; //La cantidad de imagenes que poseemos.
segundos=hoy.getSeconds();

if (segundos==0) {segundos=1}
	 while (segundos>maximo) {segundos=segundos-maximo}
	 document.write ('<style type="text/css"><!-- body {background-image: url('+imagenes[segundos]+');} div.secc_plegada, div.secc_expandida {background-color: '+colores[segundos]+';}--></style>');
}

function montavector (v1) { //function montavector (v1, v2, v3, v4)
 this[1]=v1;
 //this[2]=v2;
 //this[3]=v3;
 //this[4]=v4;
}
