function MM_reloadPage(init) {  //reloads the window if Nav4 resized
	if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
		document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
  		location.reload();
}
MM_reloadPage(true);

function verifyCompatibleBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;

	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
bw=new verifyCompatibleBrowser()


var speed=50

var loop, timer

mydate = new Date();
myday = mydate.getDay();
mymonth = mydate.getMonth();
myweekday= mydate.getDate();
weekday= myweekday;

if(myday == 0)
	day = " diumenge "
else if(myday == 1)
	day = " dilluns "
else if(myday == 2)
	day = " dimarts "
else if(myday == 3)
	day = " dimecres "
else if(myday == 4)
	day = " dijous "
else if(myday == 5)
	day = " divendres "
else if(myday == 6)
	day = " dissabte "

if(mymonth == 0)
	month = "gener "
else if(mymonth ==1)
	month = "febrer "
else if(mymonth ==2)
	month = "març "
else if(mymonth ==3)
	month = "abril "
else if(mymonth ==4)
	month = "maig "
else if(mymonth ==5)
	month = "juny "
else if(mymonth ==6)
	month = "juliol "
else if(mymonth ==7)
	month = "agost "
else if(mymonth ==8)
	month = "setembre "
else if(mymonth ==9)
	month = "octubre "
else if(mymonth ==10)
	month = "novembre "
else if(mymonth ==11)
	month = "desembre "

function openWindow3(url) {
	popupWin = window.open(url, 'remote', 'menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,dependent,width=430,height=715,left=720,top=50')
}
function openWindow(image, width, height) {
	var URL = 'imatges/'+image;
	var params = 'top=60,left=180,width='+width+',height='+height+',minimized=no,resizable=yes,scrollbars=yes,titlebar=no,menubar=no,status=no';
	window.open(URL,"",params);
	return false;
}

var slideimages=new Array()
var slidelinks=new Array()
function slideshowimages(){
	for (i=0;i<slideshowimages.arguments.length;i++){
		slideimages[i]=new Image()
		slideimages[i].src=slideshowimages.arguments[i]
	}
}



function ConstructObject(obj,nest){
	nest=(!nest) ? '':'document.'+nest+'.'
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
	this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
	this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
	this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight
	this.up=MoveAreaUp;this.down=MoveAreaDown;
	this.MoveArea=MoveArea; this.x; this.y;
	this.obj = obj + "Object"
	eval(this.obj + "=this")
	return this
}


function tamFuente (nivel, elem) {
	var elemento = document.getElementById(elem)
	elemento.className = "nivel"+nivel;
}

function xmlhttpGet(strURL) {
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('GET', strURL, true);
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatecalendar(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(null);
}

function updatecalendar(str){
    document.getElementById("calendari").innerHTML = str;
}
