var nCurrentLang=0;
var sRootPath = ".";

function GetLanguage()
{
	var nLang=0;
	var cval=getCookie("language");
	if (cval)
		nLang=cval-0;
	return nLang;
}
		
function SetLanguage(nLang)
{
	nCurrentLang=nLang;
	var now=new Date();
	now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
	setCookie("language", nCurrentLang, now);
}

function rootPath(sFile)
{ return sRootPath+"/"+sFile; }

function imgPath(sFile)
{ return sRootPath+"/images/"+sFile; }

function fotoPath(sFile)
{ return sRootPath+"/fotos/"+sFile; }	

function headerPath(sFile)
{
	var sdir="cat";
	
	switch (nCurrentLang) {
	case 0:
		sdir="cat";break;
	case 1:
		sdir="es";break;
	case 2:
		sdir="uk";break;
	}

	return sRootPath+"/images/capcaleres/"+sdir+"/"+sFile;
}
function headerImage(file, iwid, ihgt)
{
	document.write('<img border=0 src="'+headerPath(file)+'" width='+iwid+' height='+ihgt+'>');
}


function navPath(sFile)
{
	var sdir="cat";
	
	switch (nCurrentLang) {
	case 0:
		sdir="cat";break;
	case 1:
		sdir="es";break;
	case 2:
		sdir="uk";break;
	}
	
	return sRootPath+"/images/botomovil/"+sdir+"/"+sFile;
}

function navPath2(sFile)
{
	return sRootPath+"/images/botomovil/"+sFile;
}

function navLink(link, name, file)
{
	var parms ="'"+name+"','"+file+"'";
	document.write('<a href="'+link+'" onMouseOver="navSobre('+parms+',true)"');
	document.write(' onMouseOut="navSobre('+parms+',false)">');
	document.write('<img Name="'+name+'" border=0 src="'+navPath(file+".gif")+'" width=99 height=60>');
	document.write('</a>');
}

function navSobre(imgNom,file,sobre) {
	if (!document.images) {return};
    Quina=document.images[imgNom];
	if (sobre) { 
		Quina.src = navPath("ani_" + file + ".gif"); 
	}
   	else { 
   		Quina.src = navPath(""+file + ".gif");
   	}
}

function aniLink(link, name, file, iwid, ihgt)
{
	var parms ="'"+name+"','"+file+"'";
	document.write('<a href="'+link+'" target=_self onMouseOver="navSobreLink('+parms+',true)"');
	document.write(' onMouseOut="navSobreLink('+parms+',false)">');
	document.write('<img Name="'+name+'" border=0 src="'+navPath2(file+".gif")+'" width='+iwid+' height='+ihgt+'>');
	document.write('</a>');
}

function navSobreLink(imgNom,file,sobre) {
	if (!document.images) {return};
    Quina=document.images[imgNom];
	if (sobre) { 
		Quina.src = navPath2("ani_" + file + ".gif"); 
	}
   	else { 
   		Quina.src = navPath2(""+file + ".gif");
   	}
}