<!--

function desencripta(Str_Message)
{
	Len_Str_Message=Str_Message.length;
	Str_Encrypted_Message="";
	for (Position = 0 ; Position<Len_Str_Message ; Position+=3)
	{
		cadena_num = Str_Message.substring(Position, Position+3);
		Ascii_Num_Byte = 999-cadena_num;
	        caracter=String.fromCharCode(Ascii_Num_Byte);
		Str_Encrypted_Message=Str_Encrypted_Message+caracter;
	} 
	return(Str_Encrypted_Message);
}

function nomes_variables(str)
{
	theleft = str.indexOf("?") + 3;
	newstr=str.substring(theleft);
	return(newstr);
}

function troba_email(str)
{
	re=/%20/gi;
	theleft = str.indexOf("b=") + 2;
	theright = str.indexOf("&x=");
	newstr=str.substring(theleft, theright);
	return(newstr.replace(re," "));
}

function troba_p1(str)
{
	re=/%20/gi;
	theleft = str.indexOf("x=") + 2;
	theright = str.indexOf("&y=");
	newstr=str.substring(theleft, theright);
	return(newstr.replace(re," "));
}

function troba_p2(str)
{
	re=/%20/gi;
	theleft = str.indexOf("y=") + 2;
	theright = str.indexOf("&n=");
	newstr=str.substring(theleft, theright);
	return(newstr.replace(re," "));
}

function troba_nom(str)
{
	re=/%20/gi;
	theleft = str.indexOf("n=") + 2;
	theright = str.indexOf("&a=");
	newstr=str.substring(theleft, theright);
	return(newstr.replace(re," "));
}

function troba_cog(str)
{
	re=/%20/gi;
	theleft = str.indexOf("a=") + 2;
	theright = str.indexOf("&c=");
	newstr=str.substring(theleft, theright);
	return(newstr.replace(re," "));
}

function troba_pob(str)
{
	re=/%20/gi;
	theleft = str.indexOf("c=") + 2;
	theright = str.indexOf("&p=");
	newstr=str.substring(theleft, theright);
	return(newstr.replace(re," "));
}

function troba_pai(str)
{
	re=/%20/gi;
	theleft = str.indexOf("p=") + 2;
	theright = str.indexOf("&i=");
	newstr=str.substring(theleft, theright);
	return(newstr.replace(re," "));
}

function troba_inf(str)
{
	re=/%20/gi;
	theleft = str.indexOf("i=") + 2;
	theright = str.indexOf("&t=");
	newstr=str.substring(theleft, theright);
	return(newstr.replace(re," "));
}

function troba_tec(str)
{
	theleft = str.indexOf("t=") + 2;
	theright = str.indexOf("&e=");
	return(str.substring(theleft, theright));
}

function troba_error(str)
{
	theleft = str.indexOf("e=") + 2;
	theright = str.lastIndexOf("&");
	return(str.substring(theleft, theright));

}

var inilocate = window.location
document.joe.burns.value = inilocate
var eltext=document.joe.burns.value

variables_encriptades=nomes_variables(eltext);

if (variables_encriptades.substr(0,24)=="&x=&y=&n=&a=&c=&p=&i=&t=")
{
	// permetem que no estigui encriptat per a que segueixin funcionant els links directes externs a rnu.htm sense encriptar
	variables_no_encriptades="b="+variables_encriptades;
}
else
{		
	variables_no_encriptades=desencripta(variables_encriptades);
}

var ema=troba_email(variables_no_encriptades);
var p1=troba_p1(variables_no_encriptades);
var p2=troba_p2(variables_no_encriptades);
var nom=troba_nom(variables_no_encriptades);
var cog=troba_cog(variables_no_encriptades);
var pob=troba_pob(variables_no_encriptades);
var pai=troba_pai(variables_no_encriptades);
var inf=troba_inf(variables_no_encriptades);
var tec=troba_tec(variables_no_encriptades);
var error=troba_error(variables_no_encriptades);

-->
