<!--

// By Jordi Martínez Lobo renovat-e@renovat-e.com


// GESTIÓ DE CAPES !!!!
// document.getElementById("menuS1").style.display  = "none";
// document.getElementById("menuS2").style.display  = "none";
// document.getElementById("menuS1").style.top = document.getElementById("menudreta").style.top;
// document.getElementById("menuS1").style.left = document.getElementById("menudreta").style.left;

var capavisible=0;

function netejaFormWebMail() {

	ferlogin.usuari.value=ferlogin1.usuari.value;
	ferlogin.claumail.value=ferlogin1.claumail.value;
	ferlogin.submit();
	ferlogin1.reset();

}

function PintaTexte (ElTEXT) {


	alert("\n\n"+ElTEXT+"\n\n");


}

function ensenyala(elsubmenu) {
	document.getElementById("menudreta").style.display  = "none";
	if (capavisible != 0) { 
		document.getElementById(capavisible).style.display  = "none"; 
	}

	document.getElementById(elsubmenu).style.display  = "block";
	capavisible=elsubmenu;

}
function amagala(elsubmenu) {
	// document.getElementById(elsubmenu).style.display  = "none";
	// document.getElementById("menudreta").style.display  = "block";
}

function escondela(elsubmenu) {
	document.getElementById(elsubmenu).style.display  = "none";
	document.getElementById("menudreta").style.display  = "block";
}

function cambialestat(elsubmenu) {
	if ((document.getElementById(elsubmenu).style.display)  == "block") {
		escondela(elsubmenu);
	} else {
		ensenyala(elsubmenu);
	}
}


function ESTATTXT(ELTEXTE) {
window.status=ELTEXTE;
return true
}

function abreIMG(fileurl,ancho,alto,trosnom)
{
ancho=ancho+35;
alto=alto+20;
prox=window.open(fileurl,'ICAT'+trosnom,'height='+alto+',width='+ancho+',top=10,left=10,scrollbars=1,resizable=0,toolbar=0,menubar=0,status=0,directories=0');
}


function obreENQUESTA(laenq)
{
fileurl="/enquestes/"+laenq+"/index.php";
namew="AppENQ";
prox=window.open(fileurl,namew,'height=500,width=750,top=5,left=5,scrollbars=1,resizable=1,toolbar=0,menubar=0,status=0,directories=0');

}

function obrefora(laadreca)
{
// parent.location="/privat/indexnit.html";
// window.topframe.location="/privat/top.htm";
// window.mainFrame.location="/privat/agenda/festa2004.htm";
// window.opener.location="/privat/indexenq.html";
prox=window.open(laadreca,'ICATFora','top=5,left=5,scrollbars=1,resizable=1,toolbar=1,menubar=1,status=1,directories=1,location=1');
prox.focus();
self.close();
}

function obreforanos(laadreca)
{
// parent.location="/privat/indexnit.html";
// window.topframe.location="/privat/top.htm";
// window.mainFrame.location="/privat/agenda/festa2004.htm";
// window.opener.location="/privat/indexenq.html";
prox=window.open(laadreca,'ICATFora','width=640,height=480,top=5,left=5,scrollbars=1,resizable=1,toolbar=0,menubar=0,status=0,directories=0,location=0');
prox.focus();
self.close();

}


function ObreICATMail()
{
// parent.location="/privat/indexnit.html";
// window.topframe.location="/privat/top.htm";
// window.mainFrame.location="/privat/agenda/festa2004.htm";
// window.opener.location="/privat/indexenq.html";
prox=window.open('http://mail.icatgn.org','ICATmail','top=5,left=5,scrollbars=1,resizable=1,toolbar=0,menubar=1,status=0,directories=1,location=1');
prox.focus();
self.close();
}

function obreGaleria(CODIALBUM)
{
fileurl="/galeria/index.php?IDALBUM="+CODIALBUM;
namew="ICATGaleri";
prox=window.open(fileurl,namew,'height=500,width=700,top=5,left=5,scrollbars=1,resizable=1,toolbar=0,menubar=0,status=0,directories=0');

}

function EvaluatePartsDataAGE(cadena, obj, elvalor){
    opc = false; 
	// alert(elvalor)
	// Abans es feia servir parseInt(elvalor) enlloc d'eval(elvalor) i no anavaq
	// alert(elvalor2);
	elvalor2=Number(elvalor);
	if (isNaN(elvalor2))
	{
		elvalor2 = -1;
	} else {
		elvalor2=eval(elvalor);
	}

	if (elvalor == "")
	{
		opc = true // missatge="\nEl camp no pot estar en blanc\n\n\n\nFormat Data: dd|mm|yyyy";
	} else {
		if (cadena == "DD") {
			if (elvalor2)
				if ((elvalor2 < 32) && (elvalor2 > 0))
					opc = true
			missatge="\nEl DIA: "+(elvalor)+" ha de ser número entre 1 i 31\n\nFormat DATA: Dia|Mes|Any (4 digits)";
		}
		
		if (cadena == "MM") {
			if (elvalor2)
				if ((elvalor2 < 13) && (elvalor2 > 0))
					opc = true
			missatge="\nEl MES: "+(elvalor)+" ha de ser número entre 1 i 12\n\nFormat DATA: Dia|Mes|Any (4 digits)";
		}

		if (cadena == "YYYY") {
			if (elvalor2)
				if ((elvalor.length == 4) &&(elvalor2 > 0))
					opc = true
			missatge="\nL'any: "+(elvalor)+" ha de ser número més gran que 0\n\nFormat DATA: Dia|Mes|Any (4 digits)"; // entre 2004 i 2100";
			if ((elvalor.length != 4) && (elvalor2))
			{
				missatge="\nL'any ha de tenir 4 xifres. Exemple: 2004\n\nFormat DATA: Dia|Mes|Any (4 digits)"; // entre 2004 i 2100";
			}
		}


	}

	if(opc == false) {
		alert("Error de data:\n"+missatge+"\n");
		obj.focus();
	}

}


function obreinfage(CODIAGE)
{

destino="infage.php?CODI="+CODIAGE;
namtag="InfAgeICATAP";
prox=window.open(destino,namtag,'height=280,width=380,top=5,left=55,scrollbars=1,resizable=1,toolbar=0,menubar=1,status=1,directories=0');

}


// -->