/* Clase que gestiona els triggers */function clsTrigger() {	this._list = new Array();}clsTrigger.prototype.addFunc = function( func ) {	this._list.push( func );}clsTrigger.prototype.Execute = function () {	al = this._list.length;	for(i=0;i<al; i++ ) {		eval(this._list[i]);	}}/* declarem els triggers */triggerOnLoad = new clsTrigger(); //trigger per "OnLoad"/* resta de funcions */function nullFunc() {}function animateExpand( id, maxwidth, maxheight ) {	el = document.getElementById(id);		var width  = parseInt( el.offsetWidth );		var height = parseInt( el.offsetHeight );	var delta  = 50;		if ( (height < maxheight) || (width < maxwidth) )	{		if( width  < maxwidth ) {			newwidth = width + delta;			if( newwidth > maxwidth ) newwidth = maxwidth;			el.style.width  = newwidth + "px";		}		if( height < maxheight ) {			newheight = height + delta;			if( newheight > maxheight ) newheight = maxheight;			el.style.height = newheight + "px";		}						var expandTimeout = setTimeout("animateExpand('" + id + "','" + maxwidth + "','" + maxheight + "')", 10);			} else {		clearTimeout( expandTimeout );	}}function cursorWait( id ) {	if( id == '' ) {		document.body.style.cursor = 'wait';	} else {		el = document.getElementById(id);		if( el!=null ) el.style.cursor = 'wait';	}}function cursorDefault( id ) {	if( id == '' ) {		document.body.style.cursor = 'default';	} else {		el = document.getElementById(id);		if( el!=null ) el.style.cursor = 'default';	}}function hide( id ) {	el = document.getElementById( id );	el.style.visibility = "hidden";}function openWindow( url, name, w, h ) {  // Fudge factors for window decoration space.  // In my tests these work well on all platforms & browsers.  w += 32;  h += 96;  wleft = (screen.width - w) / 2;  wtop = (screen.height - h) / 2;  var win = window.open(url,    name,    'width=' + w + ', height=' + h + ', ' +    'left=' + wleft + ', top=' + wtop + ', ' +    'location=no, menubar=no, ' +    'status=no, toolbar=no, scrollbars=no, resizable=no');  // Just in case width and height are ignored  win.resizeTo(w, h);  // Just in case left and top are ignored  win.moveTo(wleft, wtop);  win.focus();	}function openWindowWithScroll( url, name, w, h ) {  // Fudge factors for window decoration space.  // In my tests these work well on all platforms & browsers.  w += 32;  h += 96;  wleft = (screen.width - w) / 2;  wtop = (screen.height - h) / 2;  var win = window.open(url,    name,    'width=' + w + ', height=' + h + ', ' +    'left=' + wleft + ', top=' + wtop + ', ' +    'location=no, menubar=no, ' +    'status=no, toolbar=no, scrollbars=yes, resizable=yes');  // Just in case width and height are ignored  win.resizeTo(w, h);  // Just in case left and top are ignored  win.moveTo(wleft, wtop);  win.focus();	}function show( id ) {	el = document.getElementById( id );	el.style.visibility = "visible";	}function loadScript( scriptName ) {   var e = document.createElement("script");   e.src = scriptName;   e.type="text/javascript";   document.getElementsByTagName("head")[0].appendChild(e);}function closeJSWindow() {	el = document.getElementById( 'jsWindow' );	if( el ) {		el.parentNode.removeChild(el);	}}function openJSWindow( title, content ) {	closeJSWindow();		jsWidth = 250;	jsHeight= 220;	/*jsLeft  = 250;*/	    var ua = navigator.userAgent.toLowerCase();    var msie = ua.indexOf ( "msie " )    if ( msie > 0 ) {      // If Internet Explorer, return version number       var msieVersion = parseInt (ua.substring (msie+5, ua.indexOf (".", msie )));    } else {                 // If another browser, return 0       var msieVersion = 0;    }       	if (msie > 0) { 		winW = document.body.offsetWidth;  		winH = document.documentElement.clientHeight;  //IE6+ Strict  		if(winH==0) winH = document.body.offsetHeight; //IE5-7 no strict 	} else { 		winW = window.innerWidth;  		winH = window.innerHeight; 	} 	jsLeft = (winW - parseInt(jsWidth)) / 2;	if( (msieVersion==0) || (msieVersion >= 7) ) {		jsTop = ( (winH - parseInt(jsHeight)) / 2 ) + document.documentElement.scrollTop;	} else {		jsTop = ( (winH - parseInt(jsHeight)) / 2 ) + document.documentElement.scrollTop;	}		win  = '<div style="position: absolute; left: '+jsLeft+'px; top: '+jsTop+'px" id="jsWindow">';	win += '<table class="fonsNegre text textBlanc" style="width: '+jsWidth+'px; height: '+jsHeight+'px;" cellpadding="0" cellspacing="0">';	win += '<tr style="height: 5px;" onmousedown="dragStart(event, \'jsWindow\')">';	win += ' <td class="fonsBlanc" style="width: 5px; vertical-align: top;height: 5px "><img src="/templates/default/img/icones/marge_nw_negre.gif" width="5px" height="5px" /></td>';	win += ' <td style="width: 100%;height: 5px"></td>';	win += ' <td class="fonsBlanc" style="width: 5px; vertical-align: top;height: 5px"><img src="/templates/default/img/icones/marge_ne_negre.gif" width="5px" height="5px" /></td>';	win += '</tr>';	win += '<tr style="height: 10px;" onmousedown="dragStart(event, \'jsWindow\')">';	win += '  <td></td>';	win += '  <td style="vertical-align: top; cursor: pointer;"><div style="float: left">'+title+'</div><div style="float: right" onclick="closeJSWindow();">X</div></td>';	win += '  <td></td>';	win += '</tr>';	win += '<tr>';	win += '<td style="vertical-align: top; text-align: center; height: '+(jsHeight - 20)+'px" colspan="3">';	win += '<div style="background: #ffffff; color: #000000; margin-left: 5px; margin-right: 5px; width: '+(jsWidth-10)+'px; height: 100%; overflow: auto;">';	//Aquí va el contingut de la finestra	win += unescape( content );	//Aquí s'acaba el contingut de la finestra	win += '</div>';	win += '</td>';	win += '</tr>';	win += '<tr style="height: 5px;">';	win += '<td class="fonsBlanc"style="width: 5px; vertical-align: bottom; height: 5px"><img src="/templates/default/img/icones/marge_sw_negre.gif" width="5px" height="5px" /></td>';	win += '<td style="width: 100%; height: 5px"></td>';	win += '<td class="fonsBlanc" style="width: 5px; vertical-align: bottom; height: 5px"><img src="/templates/default/img/icones/marge_se_negre.gif" width="5px" height="5px" /></td>';	win += '</tr>';	win += '</table>';			win += '</div>';		var newcontent = document.createElement('div'); 	newcontent.innerHTML = win; 	document.getElementsByTagName("body")[0].appendChild(newcontent);	newcontent.style.top = jsTop + 'px';	newcontent.style.left = jsLeft + 'px';	}function jsAlert( text ) {	content  = '<table class="centrat" style="margin-top: 50px;">';	content += '<tr><td>' + text + '</td></tr>';	content += '<tr><td style="text-align: center"><button onclick="closeJSWindow();" class="botoFormulari">Ok</button></td></tr>';	content += '</table>';	triggerOnLoad.addFunc( "openJSWindow( 'Alerta', '"+escape(content)+"' );" );}  var IE = document.all?true:false;  var mnuDisableHide = false;  var mnuActiveRes = 0;       function showMenuCopiarDossier( e, oElement, codRecurs ) {  		var mnu = document.getElementById( 'divMnuDossiers' );    		if( mnu == null ) alert( 'mnu es Null' );  			if (IE) { // grab the x-y pos.s if browser is IE	  tempX = event.clientX  + document.documentElement.scrollLeft;	  tempY = event.clientY  + document.documentElement.scrollTop;	} else {  // grab the x-y pos.s if browser is NS	  tempX = e.pageX;	  tempY = e.pageY;	}		mnu.style.position = 'absolute';	mnu.style.visibility = 'visible';	mnu.style.top = tempY+'px';	mnu.style.left = tempX+'px'; 		mnuDisableHide = true;	mnuActiveRes   = codRecurs;  }    function hideMenuCopiarDossier( e, oElement ) {  		if( !mnuDisableHide ) {   		var mnu = document.getElementById( 'divMnuDossiers' );   		if( mnu == null ) alert( 'mnu es NULL');   		mnu.style.visibility = 'hidden';  		}  		mnuDisableHide = false;  }  /******************************************************* * Funcions nova plantilla *******************************************************/function call(anURL) {	window.location.href=anURL;	}/** Rollover genèric **/function rollover(el) {	el.className = el.className.replace(/_down/gi,'_up');}function rollout(el) {	el.className = el.className.replace(/_up/gi,'_down');}function rolloverImg(el) {	el.src = el.src.replace(/_down/gi,'_up');}function rolloutImg(el) {	el.src = el.src.replace(/_up/gi,'_down');}/** El rollover del botó de sortir **/function rolloutBoto(id) {	el_e = document.getElementById(id+"_e");	el_c = document.getElementById(id+"_c");	el_d = document.getElementById(id+"_d");	if(el_e) el_e.className = "button_e_down";	if(el_c) el_c.className = "button_c_down";	if(el_d) el_d.className = "button_d_down";}function rolloverBoto(id) {	el_e = document.getElementById(id+"_e");	el_c = document.getElementById(id+"_c");	el_d = document.getElementById(id+"_d");	if(el_e) el_e.className = "button_e_up";	if(el_c) el_c.className = "button_c_up";	if(el_d) el_d.className = "button_d_up";}/** funcions per a canviar l'etapa **/function rolloutEtapa(el,etapa) {	el.className = "etapa_"+etapa+"_down";}function rolloverEtapa(el,etapa) {	el.className = "etapa_"+etapa+"_up";}/** El rollover del botó de sortir **/function rolloutExit(path) {	el = document.getElementById("btnExit");	el.src = path+"/img/buttons/exit_down.gif";}function rolloverExit(path) {	el = document.getElementById("btnExit");	el.src = path+"/img/buttons/exit_up.gif";	}/** Fem un rollover-rollout d'un fitxer **/var activeFile = null;function rolloutFile(el) {	rollout(el);	img = document.getElementById(el.id+"_img");	if(img) {		img.src=img.src.replace(/_up/gi,'_down');			}}function rolloverFile( el ) {	rollover(el);	img = document.getElementById(el.id+"_img");	if(img) {		img.src=img.src.replace(/_down/gi,'_up');	}}/** Fem un rollover-rollout d'una carpeta **/var activeFolder=null;function rolloutFolder(path) {	if(activeFolder!= null) {		el = document.getElementById(activeFolder+"_img");		el.src = el.src.replace(/_up/gi,'_down');		activeFolder   = null;	}}function rolloverFolder( anId, path ) {	el = document.getElementById(anId+"_img");	el.src = el.src.replace(/_down/gi,'_up');	activeFolder = anId;}/** Fem el Rollover del menú lateral **/function rolloutMenu(id) {	el1 = document.getElementById(id+"1");	el2 = document.getElementById(id+"2");		el1.className = el1.className.replace(/up/gi,'down');	el2.className = el2.className.replace(/up/gi,'down');}function rolloverMenu(id) {	el1 = document.getElementById(id+"1");	el2 = document.getElementById(id+"2");		el1.className = el1.className.replace(/down/gi,'up');	el2.className = el2.className.replace(/down/gi,'up');	}/** Fem el Rollover de la barra de menú fitxer **/var activeMenuBarButton = null;function rolloutMenuBarButton() {	if(activeMenuBarButton!=null) {		el1 = document.getElementById(activeMenuBarButton+"1");		el2 = document.getElementById(activeMenuBarButton+"2");		el3 = document.getElementById(activeMenuBarButton+"3");		elI = document.getElementById(activeMenuBarButton+"Img");		el1.className = "menubar_button_start";		el2.className = "menubar_button_body";		el3.className = "menubar_button_end";		if(elI!=null) elI.src = elI.src.replace(/_up/gi,'_down');		activeMenuBarButton = null;	}}function rolloverMenuBarButton(aButton) {	el1 = document.getElementById(aButton+"1");	el2 = document.getElementById(aButton+"2");	el3 = document.getElementById(aButton+"3");	elI = document.getElementById(aButton+"Img");	el1.className = "menubar_button_start_up";	el2.className = "menubar_button_body_up";	el3.className = "menubar_button_end_up";	if(elI!=null) elI.src = elI.src.replace(/_down/gi,'_up');	activeMenuBarButton = aButton;	}