// Newsky Group (c) 2007 - Tutti i diritti riservati
// Ultima revisione: 10/10/2005

here = document.location.toString()
base = ( here.indexOf("www.cartolinedelcuore.it") == -1 ? ( section == 'h' ? "" : here.substring(0,here.indexOf("/"+section)+1) ) : "/" )

upDate = "20/01/2008"
// mNews = "Aggiunte <a href='"+base+"musica/citazioni/index.htm'>4 citazioni musicali</a>."
pNews = "Vostre poesie aggiunte: 6 di <a href='"+base+"poesia/vostre/_ac/belladinotte.htm'>Bella di Notte</a>, 2 di <a href='"+base+"poesia/vostre/_ac/chiere.htm'>Chiere</a>, una di <a href='"+base+"poesia/vostre/_df/da.htm'>Dà...</a>, 3 di <a href='"+base+"poesia/vostre/_gi/gberry.htm'>GBerry</a>, 8 di <a href='"+base+"poesia/vostre/_jm/leopoldoaversente2.htm'>Leopoldo Aversente</a>, 2 di <a href='"+base+"poesia/vostre/_jm/lucia52.htm'>Lucia52</a>, una di <a href='"+base+"poesia/vostre/_np/novruzlika.htm'>Novruz Lika</a>, 3 di <a href='"+base+"poesia/vostre/_qs/russo.htm'>Antonio Russo</a>, 4 di <a href='"+base+"poesia/vostre/_qs/stellacic.htm'>Stellacic</a>."
dNews = "6 nuovi testamenti tra le <a href='"+base+"deathclock/volonta/pagina7.htm'>Ultime volontà</a>."
gNews = mNews = uNews = tNews = "Aggiunte 30 vostre poesie. (<a href='"+base+"novita.htm'>Dettagli</a>)"

/* SYSTEM */

IE = navigator.userAgent.indexOf("MSIE ") != -1
n = 1
window.offscreenBuffering = true
switch ( section )
{
case 'm': bcol = "004400" ; break
case 'p': bcol = "880000" ; break
case 'u': bcol = "000066" ; break
case 't': bcol = "663300" ; break
case 'd': bcol = "550055" ; break
case 's': bcol = "222222" ; break
default: bcol = "004444"
}

if ( IE && navigator.userAgent.indexOf("MSIE 5") != -1 )
{
setLowerCase("h1")
setLowerCase("h4")
setLowerCase("#subt")
setLowerCase("#rightint a")
setLowerCase("#menubar a")
setLowerCase(".mid a")
setLowerCase(".lbub a")
setLowerCase(".rbub a")
}

function setLowerCase(item)
{
document.styleSheets(0).addRule(item,"font-variant: normal!important")
}

/* DYNAMIC PAGE BUILD */

function writeLeftint(sect)
{
if ( screen.width > 800 )
{
IE ? document.styleSheets(1).addRule("#leftint","width: 80px; background-image: url('../intestazioni/" + sect + "2.jpg')") : document.styleSheets[1].insertRule("#leftint { width: 80px; background-image: url('../intestazioni/" + sect + "2.jpg') }",document.styleSheets[1].cssRules.length)
if ( sect == "hp" && document.location.toString().indexOf("forum") != -1 ) { sect = "forum" }
document.getElementById("leftint").innerHTML = "<a href='" + base + ( sect == "hp" ? "" : sect + "/" ) + "index.htm' title='Indice di sezione'><img src='" + base + "_/icone/" + sect + ".jpg' width='70' height='105' border='1'></a>"
}
}

function writeHpButton()
{
if ( screen.width > 800 )
{
document.write("<td id='butth'><p><a href='" + base + "index.htm' onmouseover='openMenu(\"x\")' onmouseout='closeMenu(\"x\")'>Home page</a></td>")
IE ? document.styleSheets(0).addRule("#bottint","width: 824px") : document.styleSheets[0].insertRule("#bottint { width: 824px }",document.styleSheets[0].cssRules.length)
}
}

function writeNews()
{
news = "<b>" + upDate + "</b> » "
switch ( section )
{
case 'm': news += mNews ; break
case 'p': news += pNews ; break
case 'u': news += uNews ; break
case 't': news += tNews ; break
case 'd': news += dNews ; break
default: news += gNews ; break
}
document.getElementById("newsbar").innerHTML = "<marquee scrollamount='2' scrolldelay='25'>" + news + "</marquee>"
}

function writeMenus()
{
xx = xm = xp = xu = xt = xd = xs = xh = 0
if ( screen.width > 800 )
{ document.getElementById("menubar").innerHTML = "<div id='menum' style='left: 193px'></div><div id='menup' style='left: 296px'></div><div id='menuu' style='left: 399px'></div><div id='menut' style='left: 502px'></div><div id='menud' style='left: 605px'></div><div id='menus' style='left: 708px'></div><div id='menuh' style='left: 811px'></div>" }
else
{ document.getElementById("menubar").innerHTML = "<div id='menum' style='left: 22px'></div><div id='menup' style='left: 125px'></div><div id='menuu' style='left: 228px'></div><div id='menut' style='left: 331px'></div><div id='menud' style='left: 434px'></div><div id='menus' style='left: 537px'></div><div id='menuh' style='left: 640px'></div>" }
}

function writePath(text)
{
document.getElementById("endpath").innerHTML = "&nbsp;» <a href='index.htm' title='Indice di sottosezione'>" + text
if ( section == 'd' && screen.width > 800 ) { IE ? document.styleSheets(1).addRule("#leftint","background-image: url('../intestazioni/deathclockx2.jpg')") : document.styleSheets[1].insertRule("#leftint { background-image: url('../intestazioni/deathclockx2.jpg') }",document.styleSheets[1].cssRules.length) }
}

function writePath2(text)
{
document.getElementById("endpath").innerHTML = "&nbsp;» " + text
}

/* MENUS */

function openMenu(sect)
{
switch ( sect )
{
case 'm': if ( xm != 0 ) { clearTimeout(xm) ; xm = 0 } else { xm = setTimeout("clearTimeout(xm);drawMenu('m');xm=0",200) } ; break
case 'p': if ( xp != 0 ) { clearTimeout(xp) ; xp = 0 } else { xp = setTimeout("clearTimeout(xp);drawMenu('p');xp=0",200) } ; break
case 'u': if ( xu != 0 ) { clearTimeout(xu) ; xu = 0 } else { xu = setTimeout("clearTimeout(xu);drawMenu('u');xu=0",200) } ; break
case 't': if ( xt != 0 ) { clearTimeout(xt) ; xt = 0 } else { xt = setTimeout("clearTimeout(xt);drawMenu('t');xt=0",200) } ; break
case 'd': if ( xd != 0 ) { clearTimeout(xd) ; xd = 0 } else { xd = setTimeout("clearTimeout(xd);drawMenu('d');xd=0",200) } ; break
case 's': if ( xs != 0 ) { clearTimeout(xs) ; xs = 0 } else { xs = setTimeout("clearTimeout(xs);drawMenu('s');xs=0",200) } ; break
default: xx = setTimeout("drawMenu('x')",200) ; break
}
}

function drawMenu(sect)
{
if ( document.location.toString().indexOf("forum/_intx.htm") != -1 ) return
if ( xm != 0 ) { document.getElementById("menum").innerHTML= "" ; clearTimeout(xm) ; xm = 0 }
if ( xp != 0 ) { document.getElementById("menup").innerHTML= "" ; clearTimeout(xp) ; xp = 0 }
if ( xu != 0 ) { document.getElementById("menuu").innerHTML= "" ; clearTimeout(xu) ; xu = 0 }
if ( xt != 0 ) { document.getElementById("menut").innerHTML= "" ; clearTimeout(xt) ; xt = 0 }
if ( xd != 0 ) { document.getElementById("menud").innerHTML= "" ; clearTimeout(xd) ; xd = 0 }
if ( xs != 0 ) { document.getElementById("menus").innerHTML= "" ; clearTimeout(xs) ; xs = 0 }
switch ( sect )
{
case 'm': menu = "<p onmouseover='if(xm!=0){clearTimeout(xm);xm=0}' onmouseout='closeMenu(\"m\")'>"
menu += "» <a href='" + base + "musica/biografie/index.htm'>Biografie di cantanti e gruppi</a><br>"
menu += "» <a href='" + base + "musica/citazioni/index.htm'>Citazioni musicali</a><br>"
menu += "» <a href='" + base + "musica/1song4you/index.htm'>1song4you</a>"
break
case 'p': menu = "<p onmouseover='if(xp!=0){clearTimeout(xp);xp=0}' onmouseout='closeMenu(\"p\")'>"
menu += "» <a href='" + base + "poesia/autori/index.htm'>Poesie per autore</a><br>"
menu += "» <a href='" + base + "poesia/titoli/index.htm'>Poesie per titolo</a><br>"
menu += "» <a href='" + base + "poesia/biografie/index.htm'>Biografie di poeti</a><br>"
menu += "» <a href='" + base + "poesia/citazioni/index.htm'>Citazioni e aforismi</a><br>"
menu += "» <a href='" + base + "poesia/vostre/index.htm'>Le vostre poesie</a>"
break
case 'u': menu = "<p onmouseover='if(xu!=0){clearTimeout(xu);xu=0}' onmouseout='closeMenu(\"u\")'>"
menu += "» <a href='" + base + "umorismo/cazzate/index.htm'>Cazzate varie</a><br>"
menu += "» <a href='" + base + "umorismo/barzellette/index.htm'>Barzellette</a><br>"
menu += "» <a href='" + base + "umorismo/sessi/index.htm'>Uomini e donne</a><br>"
menu += "» <a href='" + base + "umorismo/dubbi/index.htm'>Dubbi sul sesso</a><br>"
menu += "» <a href='" + base + "umorismo/affinita/index.htm'>Affinità di coppia</a><br>"
menu += "» <a href='" + base + "umorismo/leggende/index.htm'>Leggende metropolitane</a><br>"
menu += "» <a href='" + base + "umorismo/indovinelli/index.htm'>Indovinelli</a>"
break
case 't': menu = "<p onmouseover='if(xt!=0){clearTimeout(xt);xt=0}' onmouseout='closeMenu(\"t\")'>"
menu += "» <a href='" + base + "trash/presentazioni/index.htm'>Presentazioni PowerPoint</a><br>"
menu += "» <a href='" + base + "trash/ppssexy/index.htm'>Presentazioni sexy</a><br>"
menu += "» <a href='" + base + "trash/immagini/index.htm'>Immagini varie</a><br>"
menu += "» <a href='" + base + "trash/fotosexy/index.htm'>Foto sexy</a><br>"
menu += "» <a href='" + base + "trash/sbronzometro/index.htm'>Sbronzometro</a><br>"
menu += "» <a href='" + base + "trash/motori/index.htm'>Motori di perdizione</a>"
break
case 'd': menu = "<p onmouseover='if(xd!=0){clearTimeout(xd);xd=0}' onmouseout='closeMenu(\"d\")'>"
menu += "» <a href='" + base + "deathclock/introduzione/index.htm'>Introduzione e istruzioni</a><br>"
menu += "» <a href='" + base + "deathclock/studentclock/index.htm'>Studentclock</a><br>"
menu += "» <a href='" + base + "deathclock/socialclock/index.htm'>Socialclock</a><br>"
menu += "» <a href='" + base + "deathclock/deathclock/index.htm'>Deathclock</a><br>"
menu += "» <a href='" + base + "deathclock/destinyclock/index.htm'>Destinyclock</a><br>"
menu += "» <a href='" + base + "deathclock/volonta/index.htm'>Ultime volontà</a><br>"
menu += "<span style='color: #550055'>-----------------------------------</span><br>"
menu += "» <a href='http://www.longagony.com' target='_blank'>English version</a> <span style='font: 8px Verdana,Tahoma,Arial'>(LongAgony.com)</span>"
break
case 's': menu = "<p onmouseover='if(xs!=0){clearTimeout(xs);xs=0}' onmouseout='closeMenu(\"s\")'>"
menu += "» <a href='" + base + "sito/note/index.htm'>Note legali e tecniche</a><br>"
menu += "» <a href='" + base + "sito/scrivici/index.htm'>Scrivici e collabora con noi!</a>"
break
default: return
}
document.getElementById("menu"+sect).innerHTML = menu + "</p>"
}

function closeMenu(sect)
{
switch ( sect )
{
case 'm': if ( xm == 0 ) { xm = setTimeout("document.getElementById('menum').innerHTML='';xm=0",1000) } else { clearTimeout(xm) ; xm = 0 } ; break
case 'p': if ( xp == 0 ) { xp = setTimeout("document.getElementById('menup').innerHTML='';xp=0",1000) } else { clearTimeout(xp) ; xp = 0 } ; break
case 'u': if ( xu == 0 ) { xu = setTimeout("document.getElementById('menuu').innerHTML='';xu=0",1000) } else { clearTimeout(xu) ; xu = 0 } ; break
case 't': if ( xt == 0 ) { xt = setTimeout("document.getElementById('menut').innerHTML='';xt=0",1000) } else { clearTimeout(xt) ; xt = 0 } ; break
case 'd': if ( xd == 0 ) { xd = setTimeout("document.getElementById('menud').innerHTML='';xd=0",1000) } else { clearTimeout(xd) ; xd = 0 } ; break
case 's': if ( xs == 0 ) { xs = setTimeout("document.getElementById('menus').innerHTML='';xs=0",1000) } else { clearTimeout(xs) ; xs = 0 } ; break
default: if ( xx != 0 ) { clearTimeout(xx) ; xx = 0 }
}
}

/* FEATURES */

function setFont(size)
{
if ( IE )
{ document.styleSheets(0).addRule("p","font-size: " + size + "px")
document.styleSheets(0).addRule("td","font-size: " + size + "px")
document.styleSheets(0).addRule("h4","font-size: " + (size+1) + "px") }
else
{ document.styleSheets[0].insertRule("p, td { font-size: " + size + "px }",document.styleSheets[0].cssRules.length)
document.styleSheets[0].insertRule("h4 { font-size: " + (size+1) + "px }",document.styleSheets[0].cssRules.length) }
}

function mail()
{
if ( confirm("Scegli 'OK' per mandarci una mail personale in cui indichi l'inconveniente, o 'Annulla' per essere indirizzato al forum pubblico in cui è possibile segnalare errori o problemi.") )
{ link = "mailto:erigo@newsky.it,nicholas@newsky.it?subject=[Newsky.it] Segnalazione errori&body=Se rilevi problemi, link interrotti, disfunzioni o errori di qualsiasi tipo, indica con precisione l'inconveniente riscontrato. Grazie! [ Pagina " + document.location + " ]"
IE ? window.open(link) : document.location = link }
else
{ window.open("http://forum.newsky.it/viewtopic.php?f=13&t=7") }
}

function item(newN)
{
if ( newN != null ) { n = newN }
document.write("<b>" + n++ + ".</b> ")
}

function getMailAddress(data)
{
address = ""
for ( i = 0 ; i < data.length ; i++ )
{ address += String.fromCharCode(data.charCodeAt(i)+1) }
if ( confirm("L'indirizzo dell'autore/rice è\n"+address+"\nPuoi scrivergli/le direttamente per domande, curiosità, dubbi, scambi di idee o altro, ma NON mandare posta indesiderata e NON diffondere questo indirizzo ad altri senza il suo consenso.") )
{ link = "mailto:"+address+"?subject=A proposito delle tue poesie su Newsky.it..."
IE ? window.open(link) : document.location = link }
}
