function SetCookie (name, value)    {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (2 < argc) ? argv[2] : null;
var path = (3 < argc) ? argv[3] : null;
var domain = (4 < argc) ? argv[4] : null;
var secure = (5 < argc) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");  }

function getCookieVal (offset) 
{var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));}

function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0)break;}  return null;}

colore=GetCookie('quanto');

if(colore == "null"){colore=3};
if(colore == ""){colore=3};
if(colore == null){colore=3};

document.name=colore;
window.name=colore;
top.window.name=colore;


grafica=document.name;


document.write('<HTML>')
document.write('<head>')
document.write('<META Http-Equiv="Cache-Control" Content="no-cache">')
document.write('<META Http-Equiv="Pragma" Content="no-cache">')
document.write('<META Http-Equiv="Expires" Content="0"> ')
document.write('</head>')
document.write("<link rel=\"alternate\" type=\"application/rss+xml\" title=\"TIENNE.IT Aziende del Trentino\" href=\"ultimiaggiornamenti.xml\"/>");

document.write('<font size=-2><br><SCRI'+'PT SRC="/script/grafica'+grafica+'.js"></SCR'+'IPT>')



ilmioindirizzo=String(top.location);
dovevado=ilmioindirizzo;
apriok=(dovevado.lastIndexOf('/'));
aprioks=(dovevado.lastIndexOf('/')+1);

firstpos=(dovevado.lastIndexOf('.'));
firstpospg=(dovevado.lastIndexOf('.it/')+4);

Namer=location.href.substring(apriok,firstpos);
Namerpg=location.href.substring(apriok,firstpospg);
Namespg=location.href.substring(aprioks);

ricordautente = GetCookie('ricordautente');
ricordapvd = GetCookie('ricordapvd');

paginautente = Namerpg;
pagineutente = Namespg;

pagineutente=pagineutente.replace("/","") 



if(pagineutente == ricordautente || paginautente == ricordautente && ricordapvd != "" && ricordapvd != "null" && ricordapvd != null) {messinviaricevi = "</a><a href=http://tienne.it/contacts/"+ricordautente+">Messaggi ricevuti <span id=\"mynumeromessaggi\" style=\"position:relative;\"></span>";}
else{messinviaricevi = "Invia messaggio";}



function vaialsito()
{top.location="http://"+indirizzointernet;}

function cambiagrafica(quanto){

var expdate = new Date();
expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365)); 
SetCookie("quanto", quanto, expdate, "/", null, false);
top.window.name=GetCookie('quanto');
top.location.href=top.location.href;
}


function preferito(){
if(ricordautente != "" && ricordautente != "null" && ricordautente != null && ricordapvd != "" && ricordapvd != "null" && ricordapvd != null) {
top.location=("/strumenti/"+ricordautente);
}
else{
top.location=("/strumenti/"+cliente);
}}


function daidati()
{

document.write("<IFRAME WIDTH=\"0\" HEIGHT=\"0\" SCROLLING=NO FRAMESPAGING=\"0\" FRAMEPADDING=\"0\" FRAMEBORDER=\"0\" NAME=\"stat\" src=\"/cgi-bin/conta.cgi?chile="+cliente+"\"></iframe>");

contapagina=GetCookie('contapagina');
{


contapagina=cliente;
var expdate = new Date();
expdate.setTime(expdate.getTime() + 300000); 
SetCookie("contapagina", contapagina, expdate, "/", null, false);

contapagina=GetCookie('contapagina');
if(contapagina == null){

verifica='no';
document.write("<font color=red><font size=-2><center>COOKYE DISABILITATI, abilita i cookye per navigare pił comodo.</a>");
document.write("<scr"+"ipt src='/script/verificailsito.js'></sc"+"ript>\n");

pagint=document.location;
pegext=top.location;
if(pagint != pegext){
colore=3;

setTimeout("aprimisola()",1500);
}
}

contapagina=cliente;
var expdate = new Date();
expdate.setTime(expdate.getTime() + 300000); 
SetCookie("contapagina", contapagina, expdate, "/", null, false);

var expdate = new Date();
expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365));
SetCookie('ricerca',cliente, expdate, '/', null, false);
}

document.write('<TABLE WIDTH=100% cellspacing=22 border=0><TR><TD>')
{
if(Namer=="mail"){link='<a href="../'+cliente+'/" target="_top" title="Espandi'+Namer+'">'}
else{if(Namer=="statistiche"){link='<a href="../'+cliente+'/" target="_top" title="Visita il profilo">'}
else{if(Namer==".it/statistiche/"){link='<a href="../'+cliente+'/" target="_top" title="Visita il profilo">'}
else{if(Namer=="strumenti"){link='<a href="../'+cliente+'/" target="_top" title="Visita il profilo">'}
else{if(Namer==".it/strumenti/"){link='<a href="../'+cliente+'/" target="_top" title="Visita il profilo">'}
else{if(Namer==".it/mail/"){link='<a href="../'+cliente+'/" target="_top" title="Visita il profilo">'}
else{if(Namer=="indice"){link='<a href="../'+cliente+'/" target="_top" title="Espandi '+nome+'">'}
else{link='<a href="/'+cliente+'/" target="_top" title="Home page di '+nome+'">';}
}}}}}}

document.write(link+'<IMG SRC="../'+cliente+'/logo.gif?nocache='+new Date().getTime()+'" id="globallogo" name="globallogo" height=70 width=100 BORDER=0></a>');}

lungnome=nome.substring(20);

document.write('</TD><TD WIDTH=100%>')
document.write(link+"<font size=+2>"+nome+"</A> <a target=_top href=\"http://trentino.tienne.it/cartina/"+loc+"\">"+loc)

bottsito = '';
if(visusito=="si"){bottsito="<a HREF=\"http://"+indirizzointernet+"\" target=\"_blank\">"}
if(visusito=="tn"){bottsito="<a HREF=\"../"+cliente+"\" target=\"_top\">"}

document.write(bottsito+'<br></font><b><s'+'cript>cambialink()</sc'+'ript>');

if(visusito=="si"){bottsitolink=indirizzointernet+"</a>"}
if(visusito=="tn"){bottsitolink="tienne.it/"+cliente+"</a>"}

document.write(bottsitolink+'</TD></TR></TABLE>');}



function aprimisola()
{if(verifica != 'tienneok'){
dovevado=document.location;
apriok=(dovevado.lastIndexOf('/'));

	if (apriok=='/'+cliente+'/'){gotnt()}
	else{top.location='/';}}}



function addbookmark(chebook){
if (document.all)
bookmarkurl='http://tienne.it/'+chebook;
nomenev="Tienne.iT "+chebook;
window.external.AddFavorite(bookmarkurl,nomenev)}

