/*
*************************************************

Catia Lattanzi
Common Javascript

Created by Bob Schwartz
http://www.fotografics.it

*************************************************
*/
// Onload functions
window.onload = function() {
 initPopupLinks();
 random_content();
}
// Pop Up Windows
var popupLinkConfig = new Array;

// popupLinkConfig["classname"] = new Array ( "targetname", "width=550,height=350,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,location=yes,menubar=yes");
popupLinkConfig["popup"]  = new Array ( "", "width=600,height=450,resizable=yes,scrollbars=yes,menubar=yes,toolbar=yes");
popupLinkConfig["popupsmall"] = new Array ( "", "width=550,height=350,resizable=yes,scrollbars=yes");
popupLinkConfig["popup6"] = new Array ( "", "width=650,height=350,resizable=yes,scrollbars=yes");

function initPopupLinks()
{
 if (!document.getElementsByTagName) return true;
 var pageLinks = document.getElementsByTagName("a");
 for (var i = 0; i < pageLinks.length; i++) 
 {
  if (((pageLinks[i].className != null) && 
     (pageLinks[i].className != "")) ||
    ((pageLinks[i].parentNode.className != null) && 
     (pageLinks[i].parentNode.className != "")))
  {
   var linkClass = " " + pageLinks[i].className + " ";
   if ((linkClass == " ") && (pageLinks[i].parentNode.className != ""))
   {
    linkClass = " " + pageLinks[i].parentNode.className + " ";
   }
   for (var theKey in popupLinkConfig) 
   {
    if (linkClass.indexOf(" " + theKey + " ") > -1)
    {
     if ((pageLinks[i].target == "") || (pageLinks[i].target == null))
     {
      pageLinks[i].target = (popupLinkConfig[theKey][0] != "") ? popupLinkConfig[theKey][0] : theKey;
     }
     pageLinks[i].settings = popupLinkConfig[theKey][1];
     pageLinks[i].onclick = popUp;
    }
   }
  }
 }
 return true;
}

function popUp()
{
 newWin = window.open(this.href, this.target, this.settings);
 newWin.focus();
 return false;
}
/* random quote */
function random_content(){
var quote=new Array()
quote[1]='<p>Non permettete alla lingua di oltrepassare il <span class=\"lastword\">pensiero.</span></p><p><cite>Anton Pavlovic Cechov</cite></p><p class=\"small\">(1860-1904), narratore<br>e drammaturgo russo</p>'
quote[2]='<p>La vostra lingua vi fa dire le parole a cui l\'avete <span class=\"lastword\">abituata.</span></p><p><cite>Hazrat Ali</cite></p><p class=\"small\">(599-661), califfo arabo</p>'
quote[3]='<p>Una parola muore appena detta: dice qualcuno. Io dico che solo in quel momento comincia a <span class=\"lastword\">vivere.</span></p><p><cite>Emily Dickinson</cite></p><p class=\"small\">(1830-1886), poetessa americana</p>'
quote[4]='<p>Chi scrive come parla, anche se parla benissimo, scrive <span class=\"lastword\">male.</span></p><p><cite>Georges-Louis Buffon</cite></p><p class=\"small\">(1707-1788), scienziato francese</p>'
quote[5]='<p>La mente che si apre ad una nuova idea non torna mai alla dimensione <span class=\"lastword\">precedente.</span></p><p><cite>Albert Einstein</cite></p><p class=\"small\">(1879-1955), fisico tedesco</p>'
quote[6]='<p>Ama la cultura, adorala, lusingala. Ti dimostreranno che non serve a niente. E\' quello il momento in cui si mostrerà <span class=\"lastword\">divina.</span></p><p><cite>Anonimo</cite></p>'
quote[7]='<p>E\' strano quante cose bisogna sapere, prima di sapere quanto poco si <span class=\"lastword\">sa.</span></p><p><cite>Winston Churchill</cite></p><p class=\"small\">(1874-1965), statista<br>e politico inglese</p>'
quote[8]='<p>Non importa la quantità di cose che si imparano, ma la loro <span class=\"lastword\">qualità.</span></p><p><cite>Proverbio Cinese</cite></p>'
quote[9]='<p>Dove le parole finiscono, inizia la <span class=\"lastword\">musica.</span></p><p><cite>Heinrich Heine</cite></p><p class=\"small\">(1797-1856), poeta drammaturgo e<br>saggista tedesco</p>'
quote[10]='<p>Una buona organizzazione è alla base di un grande <span class=\"lastword\">successo.</span></p><p><cite>Anonimo</cite></p>'
quote[11]='<p>Le persone che riescono in questo mondo sono quelle che vanno alla ricerca delle condizioni che desiderano, e se non le trovano le <span class=\"lastword\">creano.</span></p><p><cite>George Bernard Shaw</cite></p><p class=\"small\">(1856-1950), commediografo e<br>scrittore irlandese</p>'
quote[12]='<p>La forza non ha luogo dove c\'è bisogno di <span class=\"lastword\">abilità.</span></p><p><cite>Erodoto</cite></p><p class=\"small\">(V sec. a.C.), storico greco</p>'
quote[13]='<p>L\'arte non imita, <span class=\"lastword\">interpreta.</span></p><p><cite>Carlo Dossi</cite></p><p class=\"small\">(1849-1910), scrittore italiano</p>'
quote[14]='<p>Le cose migliori si ottengono solo con il massimo della <span class=\"lastword\">passione.</span></p><p><cite>Johann Wolfgang Goethe</cite></p><p class=\"small\">(1749-1832), poeta tedesco</p>'
quote[15]='<p>Alcune persone vedono un\'impresa privata come una tigre feroce da uccidere subito, altri come una mucca da mungere, pochissimi la vedono com\'è in realtà: un robusto cavallo che traina un carro molto <span class=\"lastword\">pesante.</span></p><p><cite>Winston Churchill</cite></p><p class=\"small\">(1874-1965), statista e<br>politico inglese</p>'
quote[16]='<p>Il mondo è un bel libro, ma poco serve a chi non lo sa <span class=\"lastword\">leggere.</span></p><p><cite>Carlo Goldoni</cite></p><p class=\"small\">(1707-1793), commediografo italiano</p>'
quote[17]='<p>Ogni lavoro, anche filare il cotone, è nobile; il lavoro è l\'unica cosa <span class=\"lastword\">nobile.</span></p><p><cite>Thomas Carlyle</cite></p><p class=\"small\">(1795-1881), storico, biografo e<br>critico scozzese</p>'
quote[18]='<p>Parole e idee possono cambiare il <span class=\"lastword\">mondo.</span></p><p><cite>dal film L\'attimo fuggente</cite></p>';

var ry=Math.floor(Math.random()*quote.length);
if (ry==0)
ry=1;
var container = document.getElementById("quote");
var oldtext = document.getElementById("block");
var bq = document.createElement("blockquote");
container.replaceChild(bq, oldtext);
bq.innerHTML = (quote[ry]);
document.getElementById("quote").appendChild(bq);
}

