	
	var cronos=0;
	var theScroll=0;
	var thisYBit=0;
	var fselect=0;
	var here=0;
	var fadr=0;
	


/* Inici característiques */


	function firstSize() {
		if(document.getElementById('megaForm')){	
			document.getElementById('megaForm').style.height='480px'; /*Alçada inicial*/
		}
	}

	
	
	function fShow(wha) {
		if(document.getElementById("nav"+wha).className!="current") {
			clearTimeout(cronos);
			var x=document.getElementById("megaForm");
			x=x.getElementsByTagName("div");
			for(var n=1; n<x.length; n++) {
				if(document.getElementById("nav"+n)){
					document.getElementById("nav"+n).className="";
					x[n].style.display="none";
				}
			}
			fScroll(wha);
			fselect=wha;
			document.getElementById("nav"+fselect).className="current";
		}
	}


	
	function fScroll(wha) {
		switch(wha) {
			case 1: scrollMe('480'); /*Alçada després de clicar la caixeta 1*/
			break;
			case 2: scrollMe('482'); /*Alçada després de clicar la caixeta 2*/
			break;
			case 3: scrollMe('805'); /*Alçada després de clicar la caixeta 3*/
			break;
			case 4: scrollMe('890'); /*Alçada després de clicar la caixeta 3*/
			break;
		}
	}
	


	function scrollMe(thaY) {
		clearTimeout(cronos);
		thisYBit=thaY;
		theScroll=document.getElementById("megaForm").style.height;
		if (parseInt(theScroll)!=thisYBit){
			hereDoWeGo();
		}
	}


	
	function hereDoWeGo() {
		if (parseInt(theScroll)!=thisYBit) {
			theScroll=Math.round(parseInt(theScroll)+((thisYBit-parseInt(theScroll))/3))+"px";
			if (parseInt(theScroll)>thisYBit) {
				theScroll=parseInt(theScroll)-1+"px";
			}else{
				theScroll=parseInt(theScroll)+1+"px";
			}
			document.getElementById("megaForm").style.height=theScroll;
			cronos=setTimeout('hereDoWeGo()',1);
		}else{
			clearTimeout(cronos);
			here=document.getElementById("f"+fselect);
			here.style.display="block";
			here.style.width="99.9%";
			if(document.all) {
				here.style.filter = "alpha(opacity=0)";
			}else{
				here.style.opacity=0;
			}
			fadeMeIn();
		}
	}


/* Fi característiques */



/* Inici fade */
	

	function fadeMeIn() {
		if(document.all) {
			if (fadr<100) {
				fadr=fadr+10;
				here.style.filter = "alpha(opacity=" + fadr + ")";
				cronos=setTimeout('fadeMeIn()',5);
			}else{
				fadr=0;
				clearTimeout(cronos);
			}
		}else{
			if (here.style.opacity<1) {
				fadr=fadr+.1;
				here.style.opacity=fadr;
				cronos=setTimeout('fadeMeIn()',1);
			}else{
				fadr=0;
				clearTimeout(cronos);
			}
		}
	}
	

/* Fi fade */	



/* Inici carrega la caixeta */
	

	function addLoadEvent(func) {	
		var oldonload = window.onload;
		if (typeof window.onload != 'function'){
			window.onload = func;
		} else {
			window.onload = function(){
			oldonload();
			func();
			}
		}
	}
	
	addLoadEvent(firstSize);	// run initLightbox onLoad
	
	
/* Fi carrega la caixeta */










/* Inici marcació de les caixetes */

var pulsada=new Array();
function toolsBar(id,classe,ev)
{
if (ev==0)
{
if(pulsada[0]!=id) document.getElementById(id).className=classe;
}
else if(ev==1)
{
if(pulsada[0]!=id) document.getElementById(id).className=classe;
}
else
{
if(pulsada[0]!=id&&pulsada!='') document.getElementById(pulsada[0]).className=pulsada[1];
pulsada[0]=id;
pulsada[1]='toolsBarOff';
document.getElementById(id).className=classe;
}
} 

/* Fi marcació de les caixetes */

