function homedainome(){
	login = 0;
	var utente = GetCookie('ricordautente');
	if (utente != "" && utente != "null" && utente != null){login = 1;
	document.getElementById("mynome").innerHTML = utente;}
	var username = GetCookie('username');
	if (username != "" && username != "null" && username != null){
	document.getElementById("mynome").innerHTML = username;} 
	var nickname = GetCookie('nickname');
	if (nickname != "" && nickname != "null" && nickname != null){
	document.getElementById("mynome").innerHTML = nickname;}
	if (login == 0){
	document.getElementById("mynome").innerHTML = "";
	document.getElementById("mypost").innerHTML = "<b><font size=-1>Login Aziende</font></b>";
	document.getElementById("mypost3").innerHTML = "<table cellspacing=0><tr><td></td></tr></table>Accedi ai servizi Tienne.iT";}
}


function leggiposta(){
	var ricordautente = GetCookie('ricordautente');
	document.location = "/contacts/"+ricordautente;
}


function disconnetti(){
	login = 0;
	var expdate = new Date();
	expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365));
	SetCookie("userazie","", expdate, "/", null, false);
	SetCookie("userpost","", expdate, "/", null, false);
	SetCookie("username","", expdate, "/", null, false);
	SetCookie("ricordautente","", expdate, "/", null, false);
	SetCookie("userweb","", expdate, "/", null, false);
	SetCookie("ricordapvd", "", expdate, "/", null, false);
	SetCookie("nickname","", expdate, "/", null, false);
	document.getElementById("mynome").innerHTML = "<b>Arrivederci</font></b>";
	document.getElementById("mypost2").innerHTML = "";
	document.getElementById("mypost3").innerHTML = "";
	document.getElementById("mypost").innerHTML = "";
	document.getElementById("tnmessaggiric").innerHTML = "";
	top.location= "/";
}


function homedaiposta(){
	if (login == 1){
	var userpost = GetCookie('userpost');
	userposthome = userpost;
	if (userpost == ""){userposthome=''} 
	if (userpost == null){userposthome=''} 
	if (userpost == "null"){userposthome=''} 
	document.getElementById("tnmessaggiric").innerHTML = '<table cellpadding=0 cellspacing=0><tr><td></td></tr></table>'+userposthome;
	document.getElementById("mypost2").innerHTML = '<table cellspacing=0><tr><td></td></tr></table>Disconnetti';}
}


function scrivinodo(){
	var nodo = GetCookie('nodo');
	dainodo='<font size=-1><i><b>'+nodo+'</b>'
	nessuno="</B>Puoi usare questo spazio per scrivere i Tuoi appunti su Tienne.iT<BR>All'interno delle inserzioni clicca l'icona nodo al fazzoletto per scrivere qui.<br><br><a href=\"javascript:homeposta('nodo')\">Scrivi ora qui.</a>";
	if (nodo == ""){dainodo=nessuno} 
	if (nodo == null){dainodo=nessuno} 
	if (nodo == "null"){dainodo=nessuno} 
	if(dainodo != nessuno){window.status =('Nodo al fazzoletto: '+nodo);}
	document.getElementById("mynodo").innerHTML = dainodo;
}

homedainome();
homedaiposta();
writenodo = setInterval ("scrivinodo('')",1000)

function makeStatic() {
	if (document.all) {layerposta.style.marginTop=document.body.scrollTop-125}
	else if (document.getElementById){document.getElementById("layerposta").style.marginTop=eval(window.pageYOffset-125);}}


var cosaora;
var txtpop;
var winpop;


function homeposta(cosa){

	if (cosa == ""){cosa = cosaora;}
	if (cosa == "nodo"){
	winpop = "<IFRAME SRC=\"../documenti/nodo.html\" NAME=NODO FRAMEBORDER=0 SCROLLING=NO FRAMESPACING=0 FRAMEPADDING=0 height=\"150\" width=\"310\"></iframe>";
	txtpop = "<img src='/bottoni7/tipo/"+top.name+"nodo.gif' width=16 height=12 align=left border=0></a><b>Nodo al Fazzoletto</b>";}

	else if (cosa == "login"){
	winpop = "<IFRAME SRC=\"../cgi-bin/entra.pl\" NAME=LOGIN FRAMEBORDER=0 SCROLLING=NO FRAMESPACING=0 FRAMEPADDING=0 height=\"150\" width=\"310\"></iframe>"
	txtpop = "<img src='/bottoni7/tipo/"+top.name+"key.gif' width=16 height=12 align=left border=0></a><b>Login Aziende</b>";}

	makeStatic()
	txtlai.innerHTML=txtpop;
	winlai.innerHTML=winpop;

	if (document.all){
	if (layerposta.style.visibility=="hidden"){mostrastrumenti('layerposta');}
	else if (layerposta.style.visibility=="visible" && cosa == cosaora)
	chiudistrumenti('layerposta');}

	else if (document.getElementById){if (document.getElementById("layerposta").style.visibility=="hidden"){mostrastrumenti('layerposta');}
	else if (document.getElementById("layerposta").style.visibility=="visible" && cosa == cosaora)
	chiudistrumenti('layerposta');}

cosaora = cosa;
}



function mostrastrumenti(nomelvl){
	if (document.all) { document.all[nomelvl].style.visibility="visible";} 
	else if (document.layers){ document.layers[nomelvl].visibility="show";} 
	else if (document.getElementById) {document.getElementById(nomelvl).style.visibility="visible";}
}


function chiudistrumenti(nomelvl) { 
	if (document.all) {document.all[nomelvl].style.visibility="hidden";} 
	else if (document.layers){document.layers[nomelvl].visibility="hide";}
	else if (document.getElementById) {document.getElementById(nomelvl).style.visibility="hidden";} 
}

sondentro = "si";
	
function homedailast(){
	if (document.statvi.entroora.value == "si"){
	visite=GetCookie('visite');
	esplast.innerHTML='<IFRAME width=0 height=0 FRAMEBORDER=0 FRAMESPACING=0 FRAMEPADDING=0 SCROLLING=NO src=/cgi-bin/stathome.cgi></iframe>'+visite;
	document.statvi.lastvis.value = visite;
	if(document.statvi.lastvis.value != document.statvi.lastvisx.value){
	document.statvi.lastvisx.value = document.statvi.lastvis.value;
	var utente = GetCookie('ricordautente')
	if(utente == "" || utente == "null" || utente == null){top.ultimavisita.location="/cgi-bin/home.pl?action=visitato";}
	}}else{clearTimeout(attivo)}
}

function nonricaricare(){document.statvi.entroora.value='ok'}

function avvia(){
	sondentro="si";
	document.statvi.entroora.value = sondentro;
	homedailast()
	chiudistrumenti('Layerpausa');}

function ferma(){
	sondentro="no";
	document.statvi.entroora.value = sondentro;
	mostrastrumenti('Layerpausa');}


function attivo(){
	homedailast()
	setTimeout("attivo()",12000)}

attivo();



sec = 600;
time = 240;
var marqueespeed=2
var ACTUALHEIGHT="2640"
var pauseit=1
 
var marqueewidth=220
var marqueeheight=240
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0 

 
function populate(){
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
actualheigth=document.all? cross_marquee.offsetheight : document.getElementById("temp").offsetheight
window.onload=populate
}

function scrolltime(){
if (time > 0){
time = (time+(-1));
}else{copyspeed=pausespeed;
secpausa=setTimeout("sekpausa()",50)
}scrollisieme();}

function scrollisieme(){
lefttime=setTimeout("scrolltime()",10)
intValue=setTimeout("scrollmarquee()",10)
}

function sekpausa(){
if (sec > 0){
sec = (sec+(-1));
}else{
sec = 500;
time = 240;
copyspeed=2;
clearTimeout(secpausa)
clearTimeout(intValue)
}}

scrolltime()

function scrollmarquee(){
clearTimeout(intValue)
pix = "ns_marquee.top";

 if (parseInt(iemarquee.style.top)>(ACTUALHEIGHT*(-1)+1))
 iemarquee.style.top=parseInt(iemarquee.style.top)-copyspeed
 else
 iemarquee.style.top=marqueeheight+1
}


function segnalasiti(indirizzomail)
{finestra=window.open("http://tienne.it/segnalasiti.shtml","Finestra","toolbar=no,directories=no,menubar=no,width=520,top=100,left=100,height=220,resizable=no");}

function codicefiscale()
{finestra=window.open("http://tienne.it/codicefiscale/","Codicefiscale","toolbar=no,directories=no,menubar=no,width=450,top=100,left=100,height=210,resizable=no");}

function ricerca(){
ricerca=document.ricerca.keywords.value;
var expdate = new Date();
expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365)); 
SetCookie("ricerca", ricerca, expdate, "/", null, false);}

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