
// Compatibilitat de l'script amb diferents navegadors
// IE 5.5 -> OK
// NS 7.0 -> OK
// Resta -> Es controla i no s'executa



///////////////////////////////////
// Variables pel carrussel de text

var interval = 10000; // Interval de milisegons entre frase i frase

var frasePerDefecte = 0; // Índex de la frase que apareix en primer lloc. Si el navegador no suporta aquest script, aquesta frase apareixerà de forma estàtica.

var frases = new Array(); //Conjunt de frases que apareixen en carrussel

frases[0] = "Obrint camins <br> cap a la innovació";
frases[1] = "Noves oportunitats <br> en l'economia del coneixement";
frases[2] = "Un nou entorn <br> per a la recerca bàsica en biomedicina";
frases[3] = "Sumant esforços,<br> potenciant sinergies";
frases[4] = "Potenciant la transferència <br> de coneixement i tecnologia";
//Per tal d'augmentar o disminuïr el nombre de frases cal editar l'array 'frases' anterior

///////////////////////////////////


///////////////////////////////////
// Variables pel canvi d'imatges aleatori

numOfFeelings = 3; //Nombre de grups d'imatges

///////////////////////////////////


//Funcions de control de canvi de text

next = frasePerDefecte;

function getText(){
	next = next +1;
	if (next>frases.length-1){ next = 0;}
	//alert(document.getElementById("tagline").innerHTML);
	document.getElementById("tagline").innerHTML = frases[next];
	setTimeout("getText()", interval);
}

function getInitText(){
	document.write(frases[next]);
	//alert(navigator.appName);
	//alert(navigator.appVersion);
	if(((navigator.appName=="Microsoft Internet Explorer"&&parseFloat(navigator.appVersion)>=4)||(navigator.appName=="Netscape"&&parseFloat(navigator.appVersion)>=5))){ //Només iniciem el carrussel si és IE 4 i NS 7, o superior
		setTimeout("getText()", interval);
	}
}



//Funcions de canvi d'imatge aleatoria

if (typeof theFeeling == "undefined"){theFeeling=0}

function getTheFeeling(){
	//theFeeling = Math.floor(Math.random()*numOfFeelings);
	document.write("<img src='../img/00_feel_" + theFeeling + "_a.jpg' width=141 height=353>");
}

function keepTheFeeling(){
	document.write("<img src='../img/00_feel_" + theFeeling + "_b.jpg'>");
}

function getColFeeling(sec){
	document.write("<img src='../img/00_colfeel_" + theFeeling + "_" + sec + ".jpg' width='140' height='140'>");
}

//Funcions pels bullets

function getBullet(seccio){
	if (isNaN(seccio)) seccio=0;
	document.write('<img src="../img/bullet_' + seccio + '.gif" width="7" height="7">');

}