//Version 3.2 Rich Media
var pageid=Math.floor(Math.random() * 19031982);
function makeAD(sito, tags, dimw, dimh) {
    var now = new Date();
    var magic=now.getTime();
    document.write('<sc'+'ript language="JavaScript1.2" src="'+sito+'/jserver' + tags + '/ACC_RANDOM='+magic+'/PAGEID='+pageid+'"> </sc'+'ript>');
}
var isMacIE=(navigator.userAgent.indexOf('MSIE') > -1 && navigator.userAgent.indexOf('Mac') > -1)?1:0;

function moveBanner(w,h,p,a,k,c){
	content=document.getElementById('banner'+w+'x'+h+p).innerHTML=isMacIE?'<scr'+'ipt>makeAD("http://ad.tiscali.com","/SITE=IT.TISCALI/AREA='+a+((k!='')?'/KEYWORD='+k:'')+'/POS='+p+'/LANG=IT/AAMSZ='+w+'x'+h+'");</scr'+'ipt>':document.getElementById('banner'+w+'x'+h+p+'hide').innerHTML;
	if (c==1){
		trova=(content.indexOf('param')!=-1 || content.indexOf('IFRAME')!=-1)?"height=60":"468x60";		
		size_banner(trova,content);
		}
}

function WebDate() {
	var now = new Date();
	var year= now.getYear();if (year < 1000) year += 1900;
	nameDay = new Array('Domenica','Lunedi','Martedi','Mercoledi','Giovedi','Venerdi','Sabato');
	nameMth = new Array('Gennaio','Febbraio','Marzo','Aprile','Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre','Dicembre');
	document.write('<p> '+nameDay[now.getDay()]+ ' ' + now.getDate() + " " + nameMth[now.getMonth()] + " " + year+'</p>');
	
}


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;
}

function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
var expdate = new Date();
var conta;
expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365)); 
if(!(conta = GetCookie("conta"))) 
conta = 0;
conta++;
SetCookie("conta", conta, expdate, "/", null, false);




function size_banner(trova,content)
{
var id=new Array('banner120x180L1','banner120x180R1');
if (content.indexOf(trova)!=-1){
	//document.debug.contenuto.value=test;
	for (i in id){
		document.getElementById(id[i]).style.padding = '15px 12px 15px 12px';
		}
	}else{
	//document.debug.contenuto.value=test;
	for (i in id){
		document.getElementById(id[i]).style.padding = '45px 12px 45px 12px';
		}
	}
}




//cookie
function setCookie(cookieName, cookieValue, expires, path, domain, secure) {
	document.cookie = escape(cookieName) + '=' + cookieValue
		+ (expires ? '; EXPIRES=' + expires.toGMTString() : '')
		+ (path ? '; PATH=' + path : '')
		+ (domain ? '; DOMAIN=' + domain : '')
		+ (secure ? '; 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;
}
var tempo=new Date(new Date().getFullYear()+5,0,1);
var cookienames= new Array('srclng','srcdmn','srctrg','srcbld','srcauto','srcclp','srcsct');
var cookievals= new Array('it','it','_blank','y','on','on','web');
if(GetCookie('srcsct')==null){
for (var jj in cookienames){
setCookie(cookienames[jj],cookievals[jj],tempo,'/','tiscali.it');
}
}

// cookie
function CheckT10()
{
 if (GetCookie("ssosession")!=null)
 	{
	return true;
	}
	else return null; 	
};
function GetStatusT10()
	{
	if (CheckT10()!= null)
		{
		document.write('<style type=text/css>#TisLogOut{display : none;}#last-menu-out{display:none;}</style>');
		}
	else
		{
		document.write('<style type=text/css>#TisLogIn {display : none;}#esci{display:none;}#last-menu-in{display:none;}</style>');
		}
	};
function IdentityT10()
	{
	if (CheckT10()!= null)
		{
		document.write(base64decode(GetCookie("whoiswho")));
	}
	else	{
		document.write('');
		}
	};
//cookie
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;
}
function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}
function DeleteCookie (name,path,domain) {
  if (GetCookie(name)) {
    document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}
// tisheader
function IeCheck(){var agt=navigator.userAgent.toLowerCase();var nIE = (agt.indexOf("msie") != -1);return nIE;};
function WinCheck(){var agt=navigator.userAgent.toLowerCase();var nWin   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );return nWin;};
var tiscali_browser;
function fnInit(){
if (IeCheck()&&WinCheck()){
if (window.external != null){
tiscali_browser = window.external.tiscalibrowser;
if ( tiscali_browser == "it" ) {document.write('<style type=text/css>#TisHeader {display : none;}</style>');}
}}}
fnInit();
//menu


parametro=location.search.substring(1)
url=location.protocol+"//"+location.host+location.pathname



