
/**
 * Funció que retorna un link per afegir la pàgina com a FAVORITOS
 * @param txt texto HTML
 * @param urlStr adreça del home
 * @param who texte del favorito
 * @param classStr class STYLE_HTML
 */	
function addFavoritos(txt,urlStr,who,classStr)
{
	var ver = navigator.appName;
	var num = parseInt(navigator.appVersion);
	if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
		document.write('<a ');
		if (classStr!="") document.write('class="'+classStr+'" ');
		document.write('HREF="javascript:window.external.AddFavorite(urlStr,who);" ');
		document.write('onMouseOver=" window.status=');
		document.write("'" + txt + "'; return true ");
		document.write('"onMouseOut=" window.status=');
		document.write("' '; return true ");
		document.write('"onBlur=" window.status=');
		document.write("' '; return true ");
		document.write('">'+ txt + '</a>');
	}else{
		txt += " (Ctrl+D)";
		document.write(txt);
	}
}

/**
 * Funció que retorna un link 
 * @param txt texto HTML
 * @param urlStr adreça del home
 * @param classStr class STYLE_HTML
 */
function addLink(txt,urlStr,classStr)
{
	var noFeta = false;
	
	document.write('<a ');
	if (classStr!="") document.write('class="'+classStr+'" ');
	
	if (false){
		urlStr="#";
		noFeta=true;
	}

	document.write('HREF="' + urlStr + '" ');
	document.write('onMouseOver=" window.status=');
	document.write("'" + txt + "'; return true ");
	document.write('"onMouseOut=" window.status=');
	document.write("' '; return true ");
	document.write('"onBlur=" window.status=');
	document.write("' '; return true ");
	if (noFeta){
		document.write('"onClick="javascript:alert(');
		document.write("'en construcción'); ");
	}
	document.write('">'+ txt + '</a>');
}


/** 
 * Funcions per a permutar imatges
 *
 */
function Permut (flag,img) {
   if (document.images) {
        if (document.images[img].permloaded) {
            if (flag==1) document.images[img].src = document.images[img].perm.src
            else document.images[img].src = document.images[img].perm.oldsrc
        }
   }
}
function preloadPermut (img,adresse) {
   if (document.images) {
        img.onload = null;
        img.perm = new Image ();
        img.perm.oldsrc = img.src;
        img.perm.src = adresse;
        img.permloaded = true;
   }
}


/** 
 * Funcions per fer tremolar imatges
 *
 */
//configura aquí la intensidad del movimiento aumentando o disminuyendo el número
var rector=5

///////No escribas a partir de aquí///////////
var stopit=0 
var a=1

function init(which){
stopit=0
shake=which
shake.style.left=0
shake.style.top=0
}

function rattleimage(){
if ((!document.all&&!document.getElementById)||stopit==1)
return
if (a==1){
shake.style.top=parseInt(shake.style.top)+rector
}
else if (a==2){
shake.style.left=parseInt(shake.style.left)+rector
}
else if (a==3){
shake.style.top=parseInt(shake.style.top)-rector
}
else{
shake.style.left=parseInt(shake.style.left)-rector
}
if (a<4)
a++
else
a=1
setTimeout("rattleimage()",50)
}

function stoprattle(which){
stopit=1
which.style.left=0
which.style.top=0
}


/** 
 * Funcions per fer TEXTO SIRENA
 *
 */
mesk=new Array();
mesk[10]="A";
mesk[11]="B";
mesk[12]="C";
mesk[13]="D";
mesk[14]="E";
mesk[15]="F";
A=10;
B=11;
C=12;
D=13;
E=14;
F=15;
let="ABCDEF";

function mes(num){
if(let.indexOf(num) != -1){
	return eval(num);
}else{
	if(num < 10){
		return eval(num);
	}else{
		return mesk[num];
	}
}
}
/*
function color(begin,einde,stappen,stap){
hh1=(mes(begin.charAt(0))*16)+mes(begin.charAt(1));
hh2=(mes(begin.charAt(2))*16)+mes(begin.charAt(3));
hh3=(mes(begin.charAt(4))*16)+mes(begin.charAt(5));
pp1=(mes(einde.charAt(0))*16)+mes(einde.charAt(1));
pp2=(mes(einde.charAt(2))*16)+mes(einde.charAt(3));
pp3=(mes(einde.charAt(4))*16)+mes(einde.charAt(5));

if(hh1 < pp1){ff1=hh1+Math.floor((pp1-hh1)/stappen*stap);
ff1=eval("\'"+mes(Math.floor(ff1/16))+"\'")+eval("\'"+mes(ff1-(Math.floor(ff1/16)*16))+"\'");}
;else{ff1=hh1-Math.floor((hh1-pp1)/stappen*stap);
ff1=eval("\'"+mes(Math.floor(ff1/16))+"\'")+eval("\'"+mes(ff1-(Math.floor(ff1/16)*16))+"\'");}
if(hh2 < pp2){ff2=hh2+Math.floor((pp2-hh2)/stappen*stap);
ff2=eval("\'"+mes(Math.floor(ff2/16))+"\'")+eval("\'"+mes(ff2-(Math.floor(ff2/16)*16))+"\'");}
;else{ff2=hh2-Math.floor((hh2-pp2)/stappen*stap);
ff2=eval("\'"+mes(Math.floor(ff2/16))+"\'")+eval("\'"+mes(ff2-(Math.floor(ff2/16)*16))+"\'");}
if(hh3 < pp3){ff3=hh3+Math.floor((pp3-hh3)/stappen*stap);
ff3=eval("\'"+mes(Math.floor(ff3/16))+"\'")+eval("\'"+mes(ff3-(Math.floor(ff3/16)*16))+"\'");}
;else{ff3=hh3-Math.floor((hh3-pp3)/stappen*stap);
ff3=eval("\'"+mes(Math.floor(ff3/16))+"\'")+eval("\'"+mes(ff3-(Math.floor(ff3/16)*16))+"\'");}
;return ff1+ff2+ff3}
bum=0;bum2=0;txt=new Array();txt[0]="";function lightf(){
for(i=0;i != Math.floor(message.length/2);i++){txt[i]=color(lightcolor1,lightcolor2,Math.floor(message.length/2),i)};
for(i=Math.floor(message.length/2);i != message.length;i++){txt[i]=color(lightcolor2,lightcolor1,Math.floor(message.length/2),(i-Math.floor(message.length/2)))};
lightf1()}
function lightf1(){txt[message.length+1]="";bum2=message.length-bum;for(i=0;i != message.length;i++){if(i+bum < message.length){txt[message.length+1]=txt[message.length+1]+"<font color='#"+txt[(i+bum)]+"'>"+message.charAt(i)+"</font>"};else{txt[message.length+1]=txt[message.length+1]+"<font color='#"+txt[i-bum2]+"'>"+message.charAt(i)+"</font>"
}};if(bum != message.length){bum++;};else{bum=0};light.innerHTML=txt[message.length+1];setTimeout("lightf1()",50)}
*/