function LoadUsername()
{
	var username="";
//	return username;
	var test = document.cookie.split('; ');
	for( i = 0 ; i < test.length ; i++ )
	{
		var app = test[i].split('=');
		if( app[0] == 'supereva' && app[1])
		{
			var appsupereva = app[1].split('%2C');
			username = appsupereva[0];
			var userpart = username.split('.');
			if (userpart[1]) {
				if (userpart[1] == 'incontri'){
					username = userpart[0];
				}else{
					username = userpart[0] + "@" + userpart[1];
				}
			}
			break;
		}
	}
	return username;
}

function WriteData()
	{
	var username = LoadUsername();
	if( username.length > 0 )
		{
		myusername = username;
		if( username.length > 12 )
			{
			myusername = username.substr(0, 12);
		}
		//winwin cookie dropping document.write('<IMG SRC="http://winwin.supereva.it/cd?ex_id='+username+'&au_id=543922" HEIGHT=1 WIDTH=1>');
		document.write( '<span class=nero>Ciao <b>'+myusername+'</b> |');
		//document.write( '[ <a href="http://mia.supereva.it/cgi-bin/portal/scheda_personale.cgi" target=_top><img src=http://vai.supereva.it/general/img/lucchet.gif border=0></a> <a class=nero href=/sp target=_top>Dati personali</a> ] '); // questa parte sarà custommmmizzzzabile
		//document.write( '<a class=nero href="http://mia.supereva.it/cgi-bin/portal/logout.cgi?ud='+escape(window.location.href)+'" target=_parent>Chiudi sessione</a> ');
		//modifca incontri
		var ind = location.href.indexOf("http://incontri");
			if (ind != -1){
				document.write( '&nbsp; <a class=nero href="http://incontri.supereva.it/cgi-bin/logout.cgi?ud=http://it.supereva.com" target=_parent>Chiudi Sessione</a>&nbsp;');
			}else{
				document.write( '&nbsp; <a class=nero href="http://mia.supereva.it/cgi-bin/portal/logout.cgi?ud=http://it.supereva.com" target=_parent>Chiudi sessione</a>&nbsp;');
			}
		}
	else
		{
		document.write( '<a class=nero href=/mo target=_parent><b>Gratis per te una casella di posta</b><a> | <a class=nero href=http://life.dada.net>Life</a> ');
		}

		var ind = location.href.indexOf("http://incontri");
		if (ind != -1){
			document.write( '| <a class=nero href=http://incontri.supereva.it/cgi-bin/help_new.chm>Help</a>&nbsp;');
		}else{
			document.write( '| <a class=nero href=http://help.supereva.it>Help</a>&nbsp;');
		}
	}
WriteData();
