// JavaScript Document

var ColorFondo = '';
function mOvr(src,clrOver) {
	if (!src.contains(event.fromElement)) {
		src.style.cursor = 'hand';
		ColorFondo = src.bgColor;
		src.bgColor = clrOver;
	}
}
function mOut(src) {
	if (!src.contains(event.toElement)) {
		src.style.cursor = 'default';
		src.bgColor = ColorFondo;
	}
}
function mClk(src) {
	if(event.srcElement.tagName=='TD') {
		src.children.tags('A')[0].click();
	}
}
<!--

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function menu(tag)
{
obj = document.getElementById(tag);
if( obj.style.display != '' ) obj.style.display='';
else obj.style.display='none';
}
function radio(){
	var amplada = 220; 
	var alt = 300;
  dreta=(screen.width-amplada)/2;
  adalt=(screen.height-alt)/2;
  
  string="toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width="+amplada+",height="+alt+",left="+dreta+",top="+adalt+"";
  
  fin=window.open("http://www.estelroig.com/radio.blog/index.php","",string);
  
}
function popup(url,amplada,alt,scrolling){
  dreta=(screen.width-amplada)/2;
  adalt=(screen.height-alt)/2;
  
  string="toolbar=0,scrollbars="+scrolling+",location=0,statusbar=0,menubar=0,resizable=0,width="+amplada+",height="+alt+",left="+dreta+",top="+adalt+"";
  
  fin=window.open(url,"",string);
  
}


<!-- open/close -->

function openItem(tag)
{
obj = document.getElementById(tag);
obj.style.display='';
}

function closeItem(tag)
{
obj = document.getElementById(tag);
obj.style.display='none';
}


<!-- menu -->

function OpenMenu(){
	
	openItem('mn1');
	openItem('mn2');
	openItem('mn3');
	openItem('mn4');
	openItem('mn5');
	openItem('mn6');
	openItem('mn7');
	openItem('mn8');
	
	openItem('link-2');
	closeItem('link-1');
	openItem('link-2-2');
	closeItem('link-1-2');
	
	
}

function CloseMenu(){
	
	closeItem('mn1');
	closeItem('mn2');
	closeItem('mn3');
	closeItem('mn4');
	closeItem('mn5');
	closeItem('mn6');
	closeItem('mn7');
	closeItem('mn8');
	
	closeItem('link-2');
	openItem('link-1');
	closeItem('link-2-2');
	openItem('link-1-2');
	
}

function infoWiki(){
	
	popup('sabiesque.php?id=wikipedia','400','200','0');
	
}
	

function infoBabylon(){
	
	popup('sabiesque.php?id=babylon','400','400','0');
	
}
		
	function SelectLogo(){
	
	if(cercador.seeker.value == 'google'){ 
		openItem('googleimg');
		closeItem('wikipediaimg');
		closeItem('trobatimg');
	}
	if(cercador.seeker.value == 'wikipedia:en'){ 
		closeItem('googleimg');
		openItem('wikipediaimg');
		closeItem('trobatimg');
	}
	if(cercador.seeker.value == 'wikipedia:es'){ 
		closeItem('googleimg');
		openItem('wikipediaimg');
		closeItem('trobatimg');	
	}
	if(cercador.seeker.value == 'wikipedia:ct'){ 
		closeItem('googleimg');
		openItem('wikipediaimg');
		closeItem('trobatimg');
	}
	if(cercador.seeker.value == 'trobat'){ 
		closeItem('googleimg');
		closeItem('wikipediaimg');
		openItem('trobatimg');
	}
}
var numero = 0;
 
// Funciones comunes
c= function (tag) { // Crea un elemento
   return document.createElement(tag);
}
d = function (id) { // Retorna un elemento en base al id
   return document.getElementById(id);
}
e = function (evt) { // Retorna el evento
   return (!evt) ? event : evt;
}
f = function (evt) { // Retorna el objeto que genera el evento
   return evt.srcElement ?  evt.srcElement : evt.target;
}
 
addField = function () {
   container = d('files');
   
   span = c('SPAN');
   span.className = 'file';
   span.id = 'file' + (++numero);
 
   field = c('INPUT');   
   field.name = 'archivos[]';
   field.type = 'file';
   
   a = c('A');
   a.name = span.id;
   a.href = '#';
   a.onclick = removeField;
   a.innerHTML = 'Quitar';
 
   span.appendChild(field);
   span.appendChild(a);
   container.appendChild(span);
}
removeField = function (evt) {
   lnk = f(e(evt));
   span = d(lnk.name);
   span.parentNode.removeChild(span);
}

<!-- Are you sure script -->

function MakeConfirm(url,question)
{
 var where_to= confirm(question);
 if (where_to== true)
 {
   window.location=url;
 }
 else
 {
  alert('Acció cancel.lada\n\r\n\rFunction timed out');
  }
}


function AddBookmark(){
	
   if ((navigator.appName=="Microsoft Internet Explorer") && 
         (parseInt(navigator.appVersion)>=4)) {
      var url="http://www.escolaeldrac.com/"; 
      var titulo="Escola El Drac";
      window.external.AddFavorite(url,titulo);
   } else { 
      if(navigator.appName == "Netscape") 
         alert("Press Cntrl+D to add this page to your Bookmarks"); 
   }

}



function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}