//Fitxer de scrips


// Funció que incrusta el fitxer amb flash
function writeObjFlash (file, width, height, bgcolor, mode, name) 
{ 
document.write ("<OBJECT id='"+name+"' name='"+name + "' codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0 height=" + height + " width=" + width + " classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000><PARAM NAME='FlashVars' VALUE=''><PARAM NAME='Movie' VALUE='" + file + "'><PARAM NAME='Src' VALUE='" + file + "'><PARAM NAME='WMode' VALUE='" + mode + "'><PARAM NAME='Play' VALUE='-1'><PARAM NAME='Loop' VALUE='-1'><PARAM NAME='Quality' VALUE='High'><PARAM NAME='SAlign' VALUE=''><PARAM NAME='Menu' VALUE='0'><PARAM NAME='Base' VALUE=''><PARAM NAME='AllowScriptAccess' VALUE='0'><PARAM NAME='Scale' VALUE='ShowAll'><PARAM NAME='DeviceFont' VALUE='0'><PARAM NAME='EmbedMovie' VALUE='0'><PARAM NAME='BGColor' VALUE='" + bgcolor +"'><PARAM NAME='SWRemote' VALUE=''><PARAM NAME='MovieData' VALUE=''><PARAM NAME='SeamlessTabbing' VALUE='1'><PARAM NAME='Profile' VALUE='0'><PARAM NAME='ProfileAddress' VALUE=''><PARAM NAME='ProfilePort' VALUE='0'><embed src='" + file + "' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='" + width + "' height='" + height +"'></embed></OBJECT>"); 
}

// Funció que incrusta el fitxer amb flash transparent
function writeObjFlash2 (file, width, height, mode, name) 
{ 
document.write ("<OBJECT id='"+name+"' name='"+name + "' codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0 height=" + height + " width=" + width + " classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000><PARAM NAME='FlashVars' VALUE=''><PARAM NAME='Movie' VALUE='" + file + "'><PARAM NAME='Src' VALUE='" + file + "'><PARAM NAME='WMODE' VALUE='" + mode + "'><PARAM NAME='Play' VALUE='-1'><PARAM NAME='Loop' VALUE='-1'><PARAM NAME='Quality' VALUE='High'><PARAM NAME='SAlign' VALUE=''><PARAM NAME='Menu' VALUE='0'><PARAM NAME='Base' VALUE=''><PARAM NAME='AllowScriptAccess' VALUE='0'><PARAM NAME='Scale' VALUE='ShowAll'><PARAM NAME='DeviceFont' VALUE='0'><PARAM NAME='EmbedMovie' VALUE='0'><PARAM NAME='SWRemote' VALUE=''><PARAM NAME='MovieData' VALUE=''><PARAM NAME='SeamlessTabbing' VALUE='1'><PARAM NAME='Profile' VALUE='0'><PARAM NAME='ProfileAddress' VALUE=''><PARAM NAME='ProfilePort' VALUE='0'><embed src='" + file + "' wmode='" + mode +"' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='" + width + "' height='" + height +"'></embed></OBJECT>"); 
}

function popUp( direccio ) {

id = 'window1';

window.open(direccio, id, '');

}


function getISODate3 (dia, mes, anio)
{
	hoy = new Date();
	anioactual = hoy.getYear();
	
	if (dia<10) dia="0"+eval(dia);
	if (mes<10) mes="0"+eval(mes);
	if (anio<=(anioactual-2000)) anio=eval(anio)+2000;
		else {
			if (anio<100) anio=eval(anio)+1900;
			}
		
	return anio + "-" + mes + "-" + dia;
}

Array.prototype.in_array2 = function(search_term) {
  var i = this.length;
  
  if (i > 0) {
	 do {
		if (this[i]!=undefined) {
			elemento=this[i];
			cadena=elemento.substr(0,10);
			
		if (cadena === search_term) {
			if (elemento.indexOf("#")>-1) return 2;
				else return 0;
		}
		
		
		}
	 } while (i--)
  }
  return 1; // false
}