// JavaScript Document
function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function MM_findObj(n, d) {
  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 MO(e) {
	if (!e)
	var e=window.event;
	var S=e.srcElement;
	while (S.tagName!="TD")
	{S=S.parentElement;}
	S.className="topmenu01b";
}

function MO2(e) {
	if (!e)
	var e=window.event;
	var S=e.srcElement;
	while (S.tagName!="TD")
	{S=S.parentElement;}
  	S.className="topmenu01";
}


function dl(url) {
  ext = url.substr(url.length-3, url.length);
  if(ext=="pdf" || ext=="jpg") extras = "";
  else extras = "toolbar=yes, location=yes, menubar=yes, ";
  MM_openBrWindow(url, "", extras+"status=yes,scrollbars=yes,resizable=yes");
}

function gf(url) {
	w   = 700
	h 	= 500
	l 	= frameWidth / 2 - (w/2);   t = frameHeight / 2 - (h/2);
	pos = "width="+w+", height="+h+", left="+l+", top="+t+","						 
	MM_openBrWindow(url, "", pos+"status=yes,scrollbars=yes,resizable=yes");
}

function goLink(url) {
  window.location.href=url;
}

function goLink_nw(url) {
	w   = 700
	h 	= 500
	l 	= frameWidth / 2 - (w/2);   t = frameHeight / 2 - (h/2);
	pos = "width="+w+", height="+h+", left="+l+", top="+t+","						 
	MM_openBrWindow(url, "", pos+"status=yes,scrollbars=yes,resizable=yes,menubar=yes,location=yes,toolbar=yes");
}

// inicialitza les variables al principi
function setVariables() {
	if (self.innerWidth)
	{
		frameWidth = self.innerWidth;
		frameHeight = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientWidth)
	{
		frameWidth = document.documentElement.clientWidth;
		frameHeight = document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		frameWidth = document.body.clientWidth;
		frameHeight = document.body.clientHeight;
	}  
	rollover = true;
}

// **** variables ****

var frameWidth;		// amplada de la pantalla
var frameHeight;	// alçada de la pantalla
setVariables();		// definir amplada i alçada de la pantalla, rollover, etc