<!--

	var diaHora = ""
	var titol = document.title
	var subtit = document.title

// ===================================================
// Monta el Banner que es presenta a la barra d'estat
// ===================================================
	var speed = 5
	var pause = 2500 
	var timerID = null 
	var bannerRunning = false 

	var ar = new Array() 
	ar[0] = "Benvinguts a aquesta plana Web." 
	ar[1] = " " 
	ar[2] = " " 
	
	var message = 0 
	var state = "" 
	
	clearState() 
	
	function stopBanner() { 
		if (bannerRunning) 
			clearTimeout(timerID) 
			bannerRunning = false 
	} 
	
	function startBanner() { 
		stopBanner() 
		showBanner() 
	} 
	
	function clearState() { 
		state = "" 
		for (var i = 0; i < ar[message].length; ++i) { 
			state += "0" 
		} 
	} 
	
	function showBanner() { 
		if (getString()) { 
			message++ 
				if (message == 1) {
					montaData()	
					ar[1] = diaHora
				}
				if (message == 2) {
					ar[2] = titol
				}
			if (ar.length <= message) 
				message = 0 
			clearState() 
			timerID = setTimeout("showBanner()", pause) 
			bannerRunning = true 
		} else { 
			var str = "" 
			for (var j = 0; j < state.length; ++j) { 
			str += (state.charAt(j) == "1") ? ar[message].charAt(j) : "     " 
			} 
			window.status = str 
			timerID = setTimeout("showBanner()", speed) 
			bannerRunning = true 
		} 
	} 
	
	function getString() { 
		var full = true 
		for (var j = 0; j < state.length; ++j) { 
			if (state.charAt(j) == 0) 
				full = false 
		} 
		if (full) 
			return true 
		while (1) { 
			var num = getRandom(ar[message].length) 
			if (state.charAt(num) == "0") 
				break 
		} 
		state = state.substring(0, num) + "1" + state.substring(num + 1, state.length) 
		return false 
	} 
	
	function getRandom(max) { 
		return Math.round((max - 1) * Math.random()) 
	} 

// ============================================================================
// Monta la data i l'hora
// ============================================================================
function montaData() {
 	var now = new Date();
	var hora = "";
	
   	// Obtenim l'hora actual.
   	var Seconds = ((now.getSeconds() < 10) ? ": 0" : ":") + now.getSeconds();
   	var Minutes = ((now.getMinutes() < 10) ? ": 0" : ":") + now.getMinutes();
   	var Hours   = now.getHours(); 
	 	Hours = ((Hours > 23) ? Hours - 24 : Hours);

   	// Monta l'hora actual.
		if (Hours == 1 )
			{
	     hora=(" i es la "
	         + Hours
	         + Minutes
	         + Seconds);
			}
			else
			{
	     hora=(" i son les "
	         + Hours
	         + Minutes
	         + Seconds);
			}
		
   	// Obtenim la data actual.
		var mydate=new Date();

		// Dia actual
		var daym=mydate.getDate();

		// Nom del Mes actual
		var montharray = new Array("Gener","Febrer","Marē","Abril","Maig","Juny","Juliol","Agost","Setembre","Octubre","Novembre","Desembre");
		var month=mydate.getMonth();
		var nommes = montharray[month];

		// Montem l'any actual
		var year=mydate.getYear();
		if (year < 1000)
		year+=1900;

		// Obtenim el dia de la setmana
		var nomdia = new Array("Diumenge","Dilluns","Dimarts","Dimecres","Dijous","Divendres","Dissabte");
		var day=mydate.getDay();
		var setmana = nomdia[day];

		// Mirem el mes, per poder posar els noms en catalą
		
		if (nommes.substring(0,1) == "A")
			{ 
			  diaHora = "Avui es "+setmana+", "+daym+" d'"+nommes+" de "+year+hora;
			}
			else if (nommes.substring(0,1) == "O")
				{ 
			  	diaHora= "Avui es "+setmana+", "+daym+" d'"+nommes+" de "+year+hora;
				}
				else
					{
			  		diaHora= "Avui es "+setmana+", "+daym+" de "+nommes+" de "+year+hora;
					}
}

// ============================================================================
//	TOOLTIPS.JS
//  Call script using similar tags
//
//  for links use:  <a href="index.html" onmouseover="tooltip('Tooltip Title','Tooltip Heading','Tooltip Content');" onmouseout="exit();"> 
//  for images use: <img src="image.jpg" onmouseover="tooltip('Tooltip Title','Tooltip Heading','Tooltip Content');" onmouseout="exit();">                      
//
// ============================================================================

// ============================================================================
// Configuració
// ============================================================================
var offsetx = 12;
var offsety = 8;

var ie5 = (document.getElementById && document.all); 
var ns6 = (document.getElementById && !document.all); 
var ua = navigator.userAgent.toLowerCase();
var isapple = (ua.indexOf('applewebkit') != -1 ? 1 : 0);

// ============================================================================
// Funcio NewElement
// ============================================================================
function newelement(newid){ 

    if(document.createElement){ 
        var el = document.createElement('div'); 
        el.id = newid;     
        with(el.style)
        { 
            display = 'none';
            position = 'absolute';
        } 
        el.innerHTML = '&nbsp;'; 
        document.body.appendChild(el); 
    } 
} 

// ============================================================================
// Funcio GetMousePosition
// ============================================================================
function getmouseposition(e){

    if(document.getElementById){

        var iebody=(document.compatMode && document.compatMode != 'BackCompat') ? 
        		document.documentElement : document.body;
        pagex = (isapple == 1 ? 0:(ie5)?iebody.scrollLeft:window.pageXOffset);
        pagey = (isapple == 1 ? 0:(ie5)?iebody.scrollTop:window.pageYOffset);
        mousex = (ie5)?event.x:(ns6)?clientX = e.clientX:false;
        mousey = (ie5)?event.y:(ns6)?clientY = e.clientY:false;

        var fstooltip = document.getElementById('tooltip');

if ((mousex+offsetx+fstooltip.clientWidth+5) > document.body.clientWidth) {
fstooltip.style.left = ((document.body.scrollLeft+document.body.clientWidth) - (fstooltip.clientWidth*2));
}

else { fstooltip.style.left = (mousex+pagex+offsetx); }

if ((mousey+offsety+fstooltip.clientHeight+5) > document.body.clientHeight) {
fstooltip.style.top = ((document.body.scrollTop+document.body.clientHeight) - (fstooltip.clientHeight*1.2)) - pagey ;
}

else { fstooltip.style.top = (mousey+pagey+offsety-300); }

    }
}

// ============================================================================
// Funcio ToolTip
// ============================================================================
function tooltip(tiptitle,tipbold,tipnormal){

    if(!document.getElementById('tooltip')) newelement('tooltip');
    var fstooltip = document.getElementById('tooltip');
    fstooltip.innerHTML = '<table class="fstooltips" cellpadding="0" cellspacing="0"><tr><td width="5" class="tipheader"></td><td class="tipheader"><img src="images/tooltips.gif" height="16" width="16" align="right">' + tiptitle + '</td></tr><tr><td width="5" class="tipcontent"></td><td class="tipcontent"><b>' + tipbold + '</b><br />' + tipnormal + '</td></tr></table>';
    fstooltip.style.display = 'block';
    fstooltip.style.position = 'absolute';
    fstooltip.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(Opacity=100) progid:DXImageTransform.Microsoft.dropshadow(OffX=5, OffY=5, Color=gray, Positive=true)';
    document.onmousemove = getmouseposition;

}


// ============================================================================
// Funcio ToolTip amb retard
// ============================================================================
function tooltip2(tiptitle,tipbold,tipnormal){

   setTimeout('tooltip("' + tiptitle + '","' + tipbold + '","' + tipnormal + '")', 250);
}

// ============================================================================
// Funcio Exit
// ============================================================================
function exit(){

    document.getElementById('tooltip').style.display = 'none';

}
//-->