function loga()
{
document.getElementById('logo').innerHTML='<img src="http://www.bracegirdle.it/images/bannerino2.jpg" align="absmiddle" alt="logo sito" title="logo sito">';
}
function howe()
{
document.getElementById('logo').innerHTML='<div align="center" id="logo2"><br>Immagine di John Howe.<br><a href="http://www.john-howe.com/" target="new"><img src="http://www.bracegirdle.it/images/howe/1.jpg" alt="visita il sito di John Howe" title="visita il sito di John Howe" border="0"></a><br><br>Clicca sul banner per visitare il suo sito!<br>';
}
function tempo(){
var formcontent=document.getElementById('descrizione').innerHTML;
formcontent=formcontent.split(' ');
var tot=formcontent.length;
var effe=0;
for(i=0;i<tot;i++){
	  if (formcontent[i].indexOf("<")==-1 || formcontent[i].indexOf(">")==-1){
			  effe++;
		}
}
var media=effe/250;
document.getElementById('tempomedio').innerHTML='Tempo di lettura stimato: '+media+'minuti.';
}
function cercanelsito()
{
document.getElementById('boxsearch').innerHTML='<br><br><br><br><div id="boxino" align="right"><table width="376" border="0" cellpadding="0" cellspacing="0" background="http://www.bracegirdle.it/images/boxsearch.jpg"><tr><td width="188" height="44" align="center"><font face="Optimum">Cerca nel sito</font></td><td width="188" height="44" align="right"><a href="#aiuto" onClick="aiuto(); return false;"><img src="http://www.bracegirdle.it/images/aiuto.gif" alt="aiuto" title="aiuto" border="0"></a>&nbsp;<a href="#centra" onClick="centra(); return false;"><img src="http://www.bracegirdle.it/images/centra.gif" alt="centra" title="centra" border="0"></a>&nbsp;<a href="#chiudi" onClick="richiudi(\'boxsearch\',\'trova\'); return false;"><img src="http://www.bracegirdle.it/images/chiudi.gif" alt="chiudi" title="chiudi" border="0"></a>&nbsp;&nbsp;&nbsp;</td></tr><tr><td height="44" width="376" valign="top" align="center" colspan="2"><form method="get" name="search_form" action="http://www.bracegirdle.it/ricerca.php"><input type="text" name="q" maxlength="100" size="28" onkeyup="controllaCaratteri(this)" onchange="controllaCaratteri(this);">&nbsp; <input type="submit" value="Cerca" onclick="controllabox(); return false;"></form><div id="attesabox" align="center" class="boxricerca" style="display:none;"><br>Ricerca in corso...<br><br><img src="http://www.bracegirdle.it/images/loading.gif"><br></div></td></tr></table>';
if(document.getElementById('trova').innerHTML!='')
{
document.getElementById('divisore').innerHTML='<br>';
}
}
function bottona(div1,div2)
{
if (document.getElementById(div1).value=='nascondi') {
	 document.getElementById(div1).value='mostra';
	 document.getElementById(div2).style.display='none';
	 document.getElementById(div1).className = 'bottavv1';
	 }
else {
	 document.getElementById(div1).value='nascondi';
	 document.getElementById(div2).style.display='block';
	 document.getElementById(div1).className = 'bottavv2';
	 }
}
function bottona2(div1,div2)
{
if (document.getElementById(div1).value=='X') {
	 document.getElementById(div1).value='v';
	 document.getElementById(div2).style.display='none';
	 document.getElementById(div1).className = 'bottavv1';
	 document.getElementById(div1).title = 'mostra';
	 }
else {
	 document.getElementById(div1).value='X';
	 document.getElementById(div2).style.display='block';
	 document.getElementById(div1).className = 'bottavv2';
	 document.getElementById(div1).title = 'nascondi';
	 }
}
function richiudi(dachiudere,daverificare)
{
if (dachiudere=="trova" && document.getElementById('s0').innerHTML!='Parole cercate: 0') {
	alert('Operazione non consentita.');
}
else {
document.getElementById(dachiudere).innerHTML='';
	if(document.getElementById(daverificare).innerHTML!==''){
		if(daverificare=="trova") {
			document.getElementById('divisore').innerHTML='<br><br><br><br><br>';
			}
		else {
			document.getElementById('divisore').innerHTML='';
				 }
	 }
	}
}

function centra() {
document.getElementById('boxsearch').innerHTML='<br><br><br><br><div id="boxino" align="center"><table width="376" border="0" cellpadding="0" cellspacing="0" background="http://www.bracegirdle.it/images/boxsearch.jpg"><tr><td width="188" height="44" align="center"><font face="Optimum">Cerca nel sito</font></td><td width="188" height="44" align="right"><a href="#aiuto" onClick="aiuto(); return false;"><img src="http://www.bracegirdle.it/images/aiuto.gif" alt="aiuto" title="aiuto" border="0"></a>&nbsp;<a href="#destra" onClick="cercanelsito(); return false;"><img src="http://www.bracegirdle.it/images/destra.gif" alt="a destra" title="a destra" border="0"></a>&nbsp;<a href="#chiudi" onClick="richiudi(\'boxsearch\',\'trova\'); return false;"><img src="http://www.bracegirdle.it/images/chiudi.gif" alt="chiudi" title="chiudi" border="0"></a>&nbsp;&nbsp;&nbsp;</td></tr><tr><td height="44" width="376" valign="top" align="center" colspan="2"><form method="get" name="search_form" action="http://www.bracegirdle.it/ricerca.php"><input type="text" name="q" maxlength="100" size="28" onkeyup="controllaCaratteri(this)" onchange="controllaCaratteri(this);">&nbsp; <input type="submit" value="Cerca" onclick="controllabox(); return false;"></form><div id="attesabox" align="center" class="boxricerca" style="display:none;"><br>Ricerca in corso...<br><br><img src="http://www.bracegirdle.it/images/loading.gif"><br></div></td></tr></table>';
}
function controllabox()
{
x=document.search_form.q.value;
toglispazi(x);
document.search_form.q.value=x;
x=x.toString().replace(/^[ \t\r\n]+/,'').replace(/[ \t\r\n]+$/,'');
document.search_form.q.value=x;
if (x == '' || x == ' ' || x == '   ') {
alert ('Ricerca di soli spazi non consentita.'); return false; ok=0;
}
if (x.length < 3) {
alert ('La stringa deve essere almeno di 3 caratteri.'); return false; ok=0;
}
;
document.getElementById('attesabox').style.display = "block";
window.setTimeout("cercavoce(x)", 1000);
}
function cercavoce(voce) {
location.href="http://www.bracegirdle.it/ricerca.php?q=" + voce;
}
function toglispazi(str) {
var out = "", flag = 0;
for (i = 0; i < str.length; i++) {
if (str.charAt(i) != " ") {
out += str.charAt(i);
flag = 0;
}
else {
if(flag == 0) {
out += " ";
flag = 1;
}
}
}
x=out;
}
function controllaCaratteri(txt){
re = /[\+\.:\"\;,<\|"£$%&\/\^\*ē°§_>\[\]@]/g
if(re.test(txt.value)){
alert('Hai inserito un carattere non consentito!\nI caratteri non consentiti sono + . ; : , < | " £ $ % & / ^ * ē ° § _ > [ ] @')
txt.value = txt.value.replace(re,'')
ok=0;
}
}
function espandi()
{
if(document.getElementById('boxsearch').innerHTML=='')
document.getElementById('espansore').innerHTML='<br><br><br><br><br><br><br>';
}
function riduci()
{
document.getElementById('espansore').innerHTML='<br>';
}
function chiudinews()
{
document.getElementById('blognews').style.display = "none";
document.getElementById('comandi').innerHTML='<font size="-1">News dal <a href="http://www.bracegirdle.it/blog/" title="vai al Blog" target="new">Blog</a> - [<a href="javascript:aprinews();" title="mostra finestra news">mostra news</a>] - [<a href="javascript:elimina(\'controlli\');" title="elimina controlli finestra">elimina controlli</a>] - [<a href="javascript:elimina(\'news\');" title="elimina finestra definitivamente">non mostrare pił</a>]</font>';
}

function aprinews()
{
document.getElementById('blognews').style.display = "block";
document.getElementById('comandi').innerHTML='<font size="-1">News dal <a href="http://www.bracegirdle.it/blog/" title="vai al Blog" target="new">Blog</a> - [<a href="javascript:chiudinews();" title="nascondi finestra news">x</a>] - [<a href="javascript:elimina(\'controlli\');" title="elimina controlli finestra">elimina controlli</a>] - [<a href="javascript:elimina(\'news\');" title="elimina finestra definitivamente">non mostrare pił</a>]</font>';
}


function settaCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}


function elimina(cosa) {

function setCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function getCookie(name) {

	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;

}

if (cosa == 'news') {
setCookie('nonews','attivo','30');
if (getCookie("nonews") != null) {
alert('Opzione attivata:\nle news non verranno mostrate per 30 giorni.\nPer ripristinare le news, eliminare il cookie "nonews" impostato da questo sito.');
}
window.location.reload();
}

if (cosa == 'controlli') {
setCookie('nocontrolli','attivo','30');
if (getCookie("nocontrolli") != null) {
alert('Opzione attivata:\ni controlli per le news non verranno mostrati per 30 giorni.\nPer ripristinare i controlli, eliminare il cookie "nocontrolli" impostato da questo sito.');
}
window.location.reload();
}

}
function creamenu()
{
function gettaCookie(name)
{
var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
var utet=gettaCookie('utente');
if (utet==null) { 
    var utenza='<li><a href="http://www.bracegirdle.it/utenti/login.php" title="login"><img src="http://www.bracegirdle.it/images/login_icon.jpg" alt="login" title="login" vspace="4" border="0" align="absmiddle"></a></li>';
}
else {
			var utenza='<li><a href="http://www.bracegirdle.it/utenti/home.php?u=' + utet + '" title="homepage profilo"><img src="http://www.bracegirdle.it/images/profilo_icon.jpg" alt="homepage profilo" title="homepage profilo" vspace="4" border="0" align="absmiddle"></a></li>';
}       
document.getElementById('nav').innerHTML='<li id="first"><div><img src="http://www.bracegirdle.it/images/homepage_icon.jpg" alt="hompage" title="homepage" width="35" height="35" vspace="4">  <strong>HOME</strong></div><ul><li><a href="http://www.bracegirdle.it/" title="homepepage di www.bracegirdle.it"><img src="http://www.bracegirdle.it/images/home_icon.jpg" alt="homepage" title="homepage" vspace="4" border="0" align="absmiddle"></a></li>' + utenza + '<li><a href="http://www.bracegirdle.it/blog/" title="blog di www.bracegirdle.it"><img src="http://www.bracegirdle.it/images/blog_icon.jpg" alt="blog" title="blog" vspace="4" border="0" align="absmiddle"></a></li></ul></li><li id="doc"><div class="Stile4x"><img src="http://www.bracegirdle.it/images/documento1.jpg" alt="documenti" title="documenti" width="32" height="39" vspace="2"> DOCUMENTI</div><ul><li><a href="http://www.bracegirdle.it/Documenti.php" title="documenti su Tolkien" class="Stile1x"><img src="http://www.bracegirdle.it/images/indice2.jpg" border="0" align="absmiddle" alt="indice documenti" title="indice documenti"></a></li><li><a href="http://www.bracegirdle.it/saggi.php" title="saggi su Tolkien"><img src="http://www.bracegirdle.it/images/saggi.jpg" border="0" align="absmiddle" alt="saggi su Tolkien" title="saggi su Tolkien"></a></li><li><a href="http://www.bracegirdle.it/articoli.php" title="articoli su Tolkien"><img src="http://www.bracegirdle.it/images/articolo.jpg" border="0" align="absmiddle" alt="articoli su Tolkien" title=articoli su Tolkien"></a></li><li><a href="http://www.bracegirdle.it/varie.php" title="varie"><img src="http://www.bracegirdle.it/images/varie.jpg" border="0" align="absmiddle" alt="varie" title="varie"></a></li></ul></li><li id="enc"><div class="Stile5x"><img src="http://www.bracegirdle.it/images/ency.jpg" alt="Enciclopedia Tolkieniana" vspace="4" title="Enciclopedia Tolkieniana"> ENCICLOPEDIA</div><ul><li><a href="http://www.bracegirdle.it/Arda/index.php" title="Enciclopedia Tolkieniana" class="Stile2x"><img src="http://www.bracegirdle.it/images/indice.jpg" border="0" align="absmiddle" alt="indice enciclopedia" title="indice enciclopedia"></a></li><li><a href="http://www.bracegirdle.it/Arda/elenco_vocaboli.php" title="elenco vocaboli enciclopedia"><img src="http://www.bracegirdle.it/images/vocab1.jpg" border="0" align="absmiddle" alt="elenco vocaboli enciclopedia" title="elenco vocaboli enciclopedia"></a></li><li><a href="http://www.bracegirdle.it/Arda/categorie.php" title ="categorie vocaboli enciclopedia"><img src="http://www.bracegirdle.it/images/categ.jpg" border="0" align="middle" alt="categorie vocaboli" title="categorie vocaboli"></a></li><li><a href="http://www.bracegirdle.it/Arda/faq_tolkien.php" title="FAQ enciclopedia"><img src="http://www.bracegirdle.it/images/faq1.jpg" border="0" align="absmiddle" alt="FAQ enciclopedia" title="FAQ enciclopedia"></a></li></ul></li><li id="cerc"><div class="Stile6x">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="http://www.bracegirdle.it/images/lente2.gif" width="29" height="29" vspace="7" alt="ricerca" title="ricerca">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CERCA</div><ul><li><a href="http://www.bracegirdle.it/ricerca.php" title="cerca nel sito" onclick="cercanelsito(); return false;"><img src="http://www.bracegirdle.it/images/sito.jpg" alt="cerca nel sito" title="cerca nel sito" border="0" align="absmiddle"></a></li><li><a href="#pagina" title="cerca nel sito" onclick="trovap(); return false;">nella pagina</a></li><li><a href="http://www.bracegirdle.it/Arda/ricerca.php" title="cerca vocaboli nell\'Eniclopedia">nell\'Enciclopedia</a></li><li><a href="http://www.bracegirdle.it/occorrenze_signore_degli_anelli.php" title="frasi signore degli anelli">nel Signore degli Anelli</a></li><li><a href="http://www.bracegirdle.it/ricerca_signore_degli_anelli.php" title="occorrenze signore degli anelli">nel Signore degli Anelli (2)</a></li></ul></li><li id="cont"><div class="Stile7x"><img src="http://www.bracegirdle.it/images/contatti.jpg" alt="contatti" title="contatti" vspace="4">&nbsp;&nbsp;&nbsp; CONTATTI</div><ul><li><a href="http://www.bracegirdle.it/segnalazione.php" title="segnalazione al sito"><img src="http://www.bracegirdle.it/images/segnalazione.jpg" border="0" align="absmiddle" alt="segnalazione" title="segnalazione"></a></li><li><a href="http://www.bracegirdle.it/guestbook/signGuestbook.php" title="firma guestbook"><img src="http://www.bracegirdle.it/images/scrivi.jpg" border="0" align="absmiddle" alt="scrivi messaggio" title="scrivi messaggio"></a></li><li><a href="http://www.bracegirdle.it/guestbook/main.php" title="leggi guestbook"><img src="http://www.bracegirdle.it/images/leggi.jpg" border="0" align="absmiddle" alt="leggi messaggi" title="leggi messaggi"></a></a></li><li><a href="http://www.bracegirdle.it/Note.php" title="proponi sito"><img src="http://www.bracegirdle.it/images/proponi.jpg" border="0" align="absmiddle" alt="proponi sito" title="proponi sito"></a></li><li><a href="mailto:webmaster@bracegirdle.it" title="e-mail" target="new"><img src="http://www.bracegirdle.it/images/mail.jpg" border="0" align="absmiddle" alt="invia e-mail" title="invia e-mail"></a></li></ul></li><li id="plug"><div class="Stile8x">&nbsp;<img src="http://www.bracegirdle.it/images/firefox_icon.jpg" alt="plugin Firefox" title="plugin Firefox" width="35" height="35" vspace="4">&nbsp; PLUGIN</div><ul><li><a href="http://www.bracegirdle.it/plugin/" title="plugin"><img src="http://www.bracegirdle.it/images/indice3.jpg" border="0" align="absmiddle" alt="indice plugin" title="indice plugin"></a></li><li><a href="http://www.bracegirdle.it/plugin/bracegirdle.php" title="plugin sito"><img src="http://www.bracegirdle.it/images/sito2.jpg" alt="plugin sito" title="plugin sito" border="0" align="absmiddle"></a></li><li><em><a href="http://www.bracegirdle.it/plugin/signore_degli_anelli.php" title="signore degli anelli plugin">Signore degli Anelli</a></em></li></ul></li><li id="last"><div class="Stile9x">&nbsp;&nbsp;<img src="http://www.bracegirdle.it/images/links.jpg" alt="links" title="links" width="35" height="33" vspace="5">&nbsp;&nbsp; LINKS</div><ul><li><a href="http://www.bracegirdle.it/Links.php" title="link su Tolkien">Su Tolkien</a></li><li><a href="http://www.bracegirdle.it/altri_link.php" title="link vari">Altro</a></li></ul></li><div id="boxsearch"></div><div id="divisore" align="center"></div><div id="trova" align="center"></div>';
}
function valuta2(voce, num, score, mess, comm, news, controlli)
{

switch (mess){
case "2":
mess2='Grazie per aver votato :)';
break;
case "3":
mess2='Seleziona le stelle e vota la pagina!';
break;
case "1":
mess2='Hai gią votato questa pagina <img src="http://www.bracegirdle.it/images/alreadyvoted.gif" align="absmiddle">';
break;
}


document.write('<div id="espansore"></div><table width="99%" border="0" cellpadding="0"><tr><td height="24" colspan="2" align="left" valign="bottom" bordercolor="#FFFFFF"><div align="center"><strong>VOTO PAGINA</strong></div></td><td width="4%" align="center"></td><td width="50%" rowspan="3" align="center" valign="top">');
if (news=="1") {
document.write('<div align="left" id="comandi"><font size="-1">News dal <a href="http://www.bracegirdle.it/blog/" title="vai al Blog" target="new">Blog</a>');
if (controlli=="1") {
document.write(' - [<a href="javascript:chiudinews();" title="chiudi finestra news">x</a>] - [<a href="javascript:elimina(\'controlli\');" title="elimina controlli finestra">elimina controlli</a>] - [<a href="javascript:elimina(\'news\');" title="elimina finestra definitivamente">non mostrare pił</a>]');
}
document.write('</font></div><div id="blognews" align="left">');
new rsspausescroller("blog", "pscroller2", "rssclass", 3000, "_blank", "date+description");
}
else {
document.write('<div align="left" id="comandi">&nbsp;');
}
document.write('</div></td><td width="21%" rowspan="3" align="center"><img src="http://www.bracegirdle.it/images/icon_comment.jpg" alt="commenti" title="commenti" align="absmiddle"><br>[<a href="http://www.bracegirdle.it/Arda/comment.php?comment_id='+voce+'" class="riass" rel="nofollow">Commenta la pagina</a>]<br><font size="-1"><div id="commenti">');

if (comm==1)
comm2=' commento';
else comm2=' commenti';

document.write("[ <span class=\"riass\"><a href=\"javascript:comment('"+voce+"')\" title=\"Leggi o scrivi commenti\">"+comm+comm2+"</a></span> ]");
document.write('</div></font></td></tr><tr bordercolor="#FFFFFF"><td width="2%" align="left"><div align="center">&nbsp;</div></td><td width="23%" height="36" align="left" valign="bottom"><ul class="star-rating"><li class="current-rating" style="width:'+score+'px;"></li><li><a href="?rating_'+num+'[]=1&rs_id='+num+'&rate'+num+'=Vota!" rel="nofollow" title="1 stella su 5" class="one-star">1</a></li><li><a href="?rating_'+num+'[]=2&rs_id='+num+'&rate'+num+'=Vota!" rel="nofollow" title="2 stelle su 5" class="two-stars">2</a></li><li><a href="?rating_'+num+'[]=3&rs_id='+num+'&rate'+num+'=Vota!" rel="nofollow" title="3 stelle su 5" class="three-stars">3</a></li><li><a href="?rating_'+num+'[]=4&rs_id='+num+'&rate'+num+'=Vota!" rel="nofollow" title="4 stelle su 5" class="four-stars">4</a></li><li><a href="?rating_'+num+'[]=5&rs_id='+num+'&rate'+num+'=Vota!" rel="nofollow" title="5 stelle su 5" class="five-stars">5</a></li></ul></ul></td></tr><tr bordercolor="#FFFFFF"><td height="18" colspan="2" align="left" valign="top"><div align="center"><font size="-1">'+mess2+'</font></div></td></tr></table>');

}

/* Nifty Corners Cube - rounded corners with CSS and Javascript
Copyright 2006 Alessandro Fulciniti (a.fulciniti@html.it)

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

var niftyOk=(document.getElementById && document.createElement && Array.prototype.push);
var niftyCss=false;

String.prototype.find=function(what){
return(this.indexOf(what)>=0 ? true : false);
}

var oldonload=window.onload;
if(typeof(NiftyLoad)!='function') NiftyLoad=function(){};
if(typeof(oldonload)=='function')
    window.onload=function(){oldonload();AddCss();NiftyLoad()};
else window.onload=function(){AddCss();NiftyLoad()};

function AddCss(){
niftyCss=true;
var l=CreateEl("link");
l.setAttribute("type","text/css");
l.setAttribute("rel","stylesheet");
l.setAttribute("href","../niftyCorners.css");
l.setAttribute("media","screen");
document.getElementsByTagName("head")[0].appendChild(l);
}

function Nifty(selector,options){
if(niftyOk==false) return;
if(niftyCss==false) AddCss();
var i,v=selector.split(","),h=0;
if(options==null) options="";
if(options.find("fixed-height"))
    h=getElementsBySelector(v[0])[0].offsetHeight;
for(i=0;i<v.length;i++)
    Rounded(v[i],options);
if(options.find("height")) SameHeight(selector,h);
}

function Rounded(selector,options){
var i,top="",bottom="",v=new Array();
if(options!=""){
    options=options.replace("left","tl bl");
    options=options.replace("right","tr br");
    options=options.replace("top","tr tl");
    options=options.replace("bottom","br bl");
    options=options.replace("transparent","alias");
    if(options.find("tl")){
        top="both";
        if(!options.find("tr")) top="left";
        }
    else if(options.find("tr")) top="right";
    if(options.find("bl")){
        bottom="both";
        if(!options.find("br")) bottom="left";
        }
    else if(options.find("br")) bottom="right";
    }
if(top=="" && bottom=="" && !options.find("none")){top="both";bottom="both";}
v=getElementsBySelector(selector);
for(i=0;i<v.length;i++){
    FixIE(v[i]);
    if(top!="") AddTop(v[i],top,options);
    if(bottom!="") AddBottom(v[i],bottom,options);
    }
}

function AddTop(el,side,options){
var d=CreateEl("b"),lim=4,border="",p,i,btype="r",bk,color;
d.style.marginLeft="-"+getPadding(el,"Left")+"px";
d.style.marginRight="-"+getPadding(el,"Right")+"px";
if(options.find("alias") || (color=getBk(el))=="transparent"){
    color="transparent";bk="transparent"; border=getParentBk(el);btype="t";
    }
else{
    bk=getParentBk(el); border=Mix(color,bk);
    }
d.style.background=bk;
d.className="niftycorners";
p=getPadding(el,"Top");
if(options.find("small")){
    d.style.marginBottom=(p-2)+"px";
    btype+="s"; lim=2;
    }
else if(options.find("big")){
    d.style.marginBottom=(p-10)+"px";
    btype+="b"; lim=8;
    }
else d.style.marginBottom=(p-5)+"px";
for(i=1;i<=lim;i++)
    d.appendChild(CreateStrip(i,side,color,border,btype));
el.style.paddingTop="0";
el.insertBefore(d,el.firstChild);
}

function AddBottom(el,side,options){
var d=CreateEl("b"),lim=4,border="",p,i,btype="r",bk,color;
d.style.marginLeft="-"+getPadding(el,"Left")+"px";
d.style.marginRight="-"+getPadding(el,"Right")+"px";
if(options.find("alias") || (color=getBk(el))=="transparent"){
    color="transparent";bk="transparent"; border=getParentBk(el);btype="t";
    }
else{
    bk=getParentBk(el); border=Mix(color,bk);
    }
d.style.background=bk;
d.className="niftycorners";
p=getPadding(el,"Bottom");
if(options.find("small")){
    d.style.marginTop=(p-2)+"px";
    btype+="s"; lim=2;
    }
else if(options.find("big")){
    d.style.marginTop=(p-10)+"px";
    btype+="b"; lim=8;
    }
else d.style.marginTop=(p-5)+"px";
for(i=lim;i>0;i--)
    d.appendChild(CreateStrip(i,side,color,border,btype));
el.style.paddingBottom=0;
el.appendChild(d);
}

function CreateStrip(index,side,color,border,btype){
var x=CreateEl("b");
x.className=btype+index;
x.style.backgroundColor=color;
x.style.borderColor=border;
if(side=="left"){
    x.style.borderRightWidth="0";
    x.style.marginRight="0";
    }
else if(side=="right"){
    x.style.borderLeftWidth="0";
    x.style.marginLeft="0";
    }
return(x);
}

function CreateEl(x){
return(document.createElement(x));
}

function FixIE(el){
if(el.currentStyle!=null && el.currentStyle.hasLayout!=null && el.currentStyle.hasLayout==false)
    el.style.display="inline-block";
}

function SameHeight(selector,maxh){
var i,v=selector.split(","),t,j,els=[],gap;
for(i=0;i<v.length;i++){
    t=getElementsBySelector(v[i]);
    els=els.concat(t);
    }
for(i=0;i<els.length;i++){
    if(els[i].offsetHeight>maxh) maxh=els[i].offsetHeight;
    els[i].style.height="auto";
    }
for(i=0;i<els.length;i++){
    gap=maxh-els[i].offsetHeight;
    if(gap>0){
        t=CreateEl("b");t.className="niftyfill";t.style.height=gap+"px";
        nc=els[i].lastChild;
        if(nc.className=="niftycorners")
            els[i].insertBefore(t,nc);
        else els[i].appendChild(t);
        }
    }
}

function getElementsBySelector(selector){
var i,j,selid="",selclass="",tag=selector,tag2="",v2,k,f,a,s=[],objlist=[],c;
if(selector.find("#")){ //id selector like "tag#id"
    if(selector.find(" ")){  //descendant selector like "tag#id tag"
        s=selector.split(" ");
        var fs=s[0].split("#");
        if(fs.length==1) return(objlist);
        f=document.getElementById(fs[1]);
        if(f){
            v=f.getElementsByTagName(s[1]);
            for(i=0;i<v.length;i++) objlist.push(v[i]);
            }
        return(objlist);
        }
    else{
        s=selector.split("#");
        tag=s[0];
        selid=s[1];
        if(selid!=""){
            f=document.getElementById(selid);
            if(f) objlist.push(f);
            return(objlist);
            }
        }
    }
if(selector.find(".")){      //class selector like "tag.class"
    s=selector.split(".");
    tag=s[0];
    selclass=s[1];
    if(selclass.find(" ")){   //descendant selector like tag1.classname tag2
        s=selclass.split(" ");
        selclass=s[0];
        tag2=s[1];
        }
    }
var v=document.getElementsByTagName(tag);  // tag selector like "tag"
if(selclass==""){
    for(i=0;i<v.length;i++) objlist.push(v[i]);
    return(objlist);
    }
for(i=0;i<v.length;i++){
    c=v[i].className.split(" ");
    for(j=0;j<c.length;j++){
        if(c[j]==selclass){
            if(tag2=="") objlist.push(v[i]);
            else{
                v2=v[i].getElementsByTagName(tag2);
                for(k=0;k<v2.length;k++) objlist.push(v2[k]);
                }
            }
        }
    }
return(objlist);
}

function getParentBk(x){
var el=x.parentNode,c;
while(el.tagName.toUpperCase()!="HTML" && (c=getBk(el))=="transparent")
    el=el.parentNode;
if(c=="transparent") c="#FFFFFF";
return(c);
}

function getBk(x){
var c=getStyleProp(x,"backgroundColor");
if(c==null || c=="transparent" || c.find("rgba(0, 0, 0, 0)"))
    return("transparent");
if(c.find("rgb")) c=rgb2hex(c);
return(c);
}

function getPadding(x,side){
var p=getStyleProp(x,"padding"+side);
if(p==null || !p.find("px")) return(0);
return(parseInt(p));
}

function getStyleProp(x,prop){
if(x.currentStyle)
    return(x.currentStyle[prop]);
if(document.defaultView.getComputedStyle)
    return(document.defaultView.getComputedStyle(x,'')[prop]);
return(null);
}

function rgb2hex(value){
var hex="",v,h,i;
var regexp=/([0-9]+)[, ]+([0-9]+)[, ]+([0-9]+)/;
var h=regexp.exec(value);
for(i=1;i<4;i++){
    v=parseInt(h[i]).toString(16);
    if(v.length==1) hex+="0"+v;
    else hex+=v;
    }
return("#"+hex);
}

function Mix(c1,c2){
var i,step1,step2,x,y,r=new Array(3);
if(c1.length==4)step1=1;
else step1=2;
if(c2.length==4) step2=1;
else step2=2;
for(i=0;i<3;i++){
    x=parseInt(c1.substr(1+step1*i,step1),16);
    if(step1==1) x=16*x+x;
    y=parseInt(c2.substr(1+step2*i,step2),16);
    if(step2==1) y=16*y+y;
    r[i]=Math.floor((x*50+y*50)/100);
    r[i]=r[i].toString(16);
    if(r[i].length==1) r[i]="0"+r[i];
    }
return("#"+r[0]+r[1]+r[2]);
}


function vota(v)
{
document.getElementById('vota').innerHTML='<ul class="star-rating"><li class="current-rating" style="width:105px;"></li><li><a href="?rating_' + v + '[]=1&rs_id=' + v + '&rate' + v + '=Vota!" rel="nofollow" title="1 stella su 5" class="one-star">1</a></li><li><a href="?rating_' + v + '[]=2&rs_id=' + v + '&rate' + v + '=Vota!" rel="nofollow" title="2 stelle su 5" class="two-stars">2</a></li><li><a href="?rating_' + v + '[]=3&rs_id=' + v + '&rate' + v + '=Vota!" rel="nofollow" title="3 stelle su 5" class="three-stars">3</a></li><li><a href="?rating_' + v + '[]=4&rs_id=' + v + '&rate' + v + '=Vota!" rel="nofollow" title="4 stelle su 5" class="four-stars">4</a></li><li><a href="?rating_' + v + '[]=5&rs_id=' + v + '&rate' + v + '=Vota!" rel="nofollow" title="5 stelle su 5" class="five-stars">5</a></li></ul></ul>';
}

function conv(str) {
var out = "", flag = 0;
for (i = 0; i < str.length; i++) {
if (str.charAt(i) != " ") {
out += str.charAt(i);
flag = 0;
}
else {
if(flag == 0) {
out += " ";
flag = 1;
}
}
}
x=out;
}
function Trim(StrToTrim)
{
    if (typeof StrToTrim != "string")
    {
        return StrToTrim;
    }
    var StrBlank = StrToTrim.substring(0, 1);
    while (StrBlank == " ")
    {
        StrToTrim = StrToTrim.substring(1, StrToTrim.length);
        StrBlank = StrToTrim.substring(0, 1);
    }
    StrBlank = StrToTrim.substring(StrToTrim.length - 1, StrToTrim.length);
    while (StrBlank == " ")
    {
        StrToTrim = StrToTrim.substring(0, StrToTrim.length-1);
        StrBlank = StrToTrim.substring(StrToTrim.length-1, StrToTrim.length);
    }
    while (StrToTrim.indexOf("  ") != -1)
    {
        StrToTrim = StrToTrim.substring(0, StrToTrim.indexOf("  "));
        StrToTrim += StrToTrim.substring(StrToTrim.indexOf("  ") + 1, StrToTrim.length);
    }
    return StrToTrim;
}

function doHighlight(bodyText, searchTerm, highlightStartTag, highlightEndTag) 
{

gy=document.getElementById('s0').innerHTML;
if (gy=='Parole cercate: 0') {
colore="yellow";
} 
else if (gy=='Parole cercate: 1') {
colore="orange";
} 
else if (gy=='Parole cercate: 2') {
colore="LIME";
} 
else if (gy=='Parole cercate: 3') {
colore="AQUAMARINE";
} 
else if (gy=='Parole cercate: 4') {
colore="LIGHTPINK";
} 

// the highlightStartTag and highlightEndTag parameters are optional
if ((!highlightStartTag) || (!highlightEndTag)) {
highlightStartTag = "<span style=\"background-color:" + colore + ";\">";
highlightEndTag = "</span>";
}
var newText = "";
var i = -1;
var lcSearchTerm = searchTerm.toLowerCase();
var lcBodyText = bodyText.toLowerCase();
while (bodyText.length > 0) {
i = lcBodyText.indexOf(lcSearchTerm, i+1);
if (i < 0) {
newText += bodyText;
bodyText = "";
} else {
// skip anything inside an HTML tag
if (bodyText.lastIndexOf(">", i) >= bodyText.lastIndexOf("<", i)) {
// skip anything inside a <script> block
if (lcBodyText.lastIndexOf("/script>", i) >= lcBodyText.lastIndexOf("<script", i)) {
newText += bodyText.substring(0, i) + highlightStartTag + bodyText.substr(i, searchTerm.length) + highlightEndTag;
bodyText = bodyText.substr(i + searchTerm.length);
lcBodyText = bodyText.toLowerCase();
i = -1;
}
}
}
}
return newText;
}
function highlightSearchTerms(searchText, treatAsPhrase, warnOnFailure, highlightStartTag, highlightEndTag)
{
if (treatAsPhrase) {
searchArray = [searchText];
} else {
searchArray = [searchText];
}
if (!document.body || typeof(document.body.innerHTML) == "undefined") {
if (warnOnFailure) {
alert("Sorry, for some reason the text of this page is unavailable. Searching will not work.");
}
return false;
}
var bodyText = document.getElementById('descrizione').innerHTML;
for (var i = 0; i < searchArray.length; i++) {
bodyText = doHighlight(bodyText, searchArray[i], highlightStartTag, highlightEndTag);
}
document.getElementById('descrizione').innerHTML = bodyText;
}

function strong(searchText, treatAsPhrase, warnOnFailure, highlightStartTag, highlightEndTag)
{
if (treatAsPhrase) {
searchArray = [searchText];
} else {
searchArray = [searchText];
}
if (!document.body || typeof(document.getElementById('descrizione').innerHTML) == "undefined") {
if (warnOnFailure) {
alert("Sorry, for some reason the text of this page is unavailable. Searching will not work.");
}
return false;
}
var bodyText = document.getElementById('descrizione').innerHTML;
for (var i = 0; i < searchArray.length; i++) {
bodyText = doHighlight(bodyText, searchArray[i], highlightStartTag, highlightEndTag);
}
document.getElementById('descrizione').innerHTML = bodyText;
}


function trovap()
{
oncli="x=document.evid.stringa.value; conv(x); x=Trim(x); if (x.length < 3){ alert ('La stringa deve essere almeno di 3 caratteri.'); document.evid.stringa.value=''; return false; } else { document.evid.stringa.value=x; y=document.getElementById('s0').innerHTML; if (y=='Parole cercate: 0') { strong(x,'s'); document.evid.stringa.value=x; document.getElementById('s0').innerHTML='Parole cercate: 1'; document.getElementById('s1').innerHTML='<span style=background-color:yellow>' + x + '</span>'; return false;} else { if (y=='Parole cercate: 1') { strong(x,'s'); document.evid.stringa.value=x; document.getElementById('s0').innerHTML='Parole cercate: 2'; document.getElementById('s2').innerHTML='<span style=background-color:orange>' + x + '</span>'; return false; } if (y=='Parole cercate: 2') { strong(x,'s'); document.evid.stringa.value=x; document.getElementById('s0').innerHTML='Parole cercate: 3'; document.getElementById('s3').innerHTML='<span style=background-color:LIME>' + x + '</span>'; return false; } if (y=='Parole cercate: 3') { strong(x,'s'); document.evid.stringa.value=x; document.getElementById('s0').innerHTML='Parole cercate: 4'; document.getElementById('s4').innerHTML='<span style=background-color:AQUAMARINE>' + x + '</span>'; return false; } if (y=='Parole cercate: 4') { strong(x,'s'); document.evid.stringa.value=x; document.getElementById('s0').innerHTML='Parole cercate: 5'; document.getElementById('s5').innerHTML='<span style=background-color:LIGHTPINK>' + x + '</span>'; return false;} if (y=='Parole cercate: 5') { alert('Limite ricerche consentite raggiunto. Ricaricare la pagina per effettuare altre ricerche.'); return false; } } }";

if(document.getElementById('boxsearch').innerHTML == "")
{
document.getElementById('divisore').innerHTML='<br><br><br><br>';
document.getElementById('trova').innerHTML='<table class="boxricerca" width="376" border="0" cellpadding="0" cellspacing="0" background="http://www.bracegirdle.it/images/boxsearch2.jpg"><tr><td width="188" height="44" align="center"><font face="Optimum">Cerca nella pagina</font></td><td width="188" height="44" align="right"><a href="#aiuto" onClick="aiuto(); return false;"><img src="http://www.bracegirdle.it/images/aiuto.gif" alt="aiuto" title="aiuto" border="0"></a>&nbsp;<a href="#chiudi" onClick="richiudi(\'trova\',\'boxsearch\'); return false;"><img src="http://www.bracegirdle.it/images/chiudi.gif" alt="chiudi" title="chiudi" border="0"></a>&nbsp;&nbsp;&nbsp;</td></tr><tr><td height="44" width="376" valign="top" align="center" colspan="2"><form method="post" name="evid" action="evidenzia.php"><input type="text" name="stringa"> <input type="submit" value="cerca" onclick="' + oncli + '"></form><br><div id="s0" class="piccola">Parole cercate: 0</div></td></tr><tr><td bgcolor="#F8F8F8" align="center" colspan="2"><div id="s1"></div><div id="s2"></div><div id="s3"></div><div id="s4"></div><div id="s5"></div></td></tr></table>';
}
else 
{
document.getElementById('divisore').innerHTML='<br>';
document.getElementById('trova').innerHTML='<table width="376" border="0" cellpadding="0" cellspacing="0" background="http://www.bracegirdle.it/images/boxsearch2.jpg"><tr><td width="188" height="44" align="center"><font face="Optimum">Cerca nella pagina</font></td><td width="188" height="44" align="right"><a href="#aiuto" onClick="aiuto(); return false;"><img src="http://www.bracegirdle.it/images/aiuto.gif" alt="aiuto" title="aiuto" border="0"></a>&nbsp;<a href="#chiudi" onClick="richiudi(\'trova\',\'boxsearch\'); return false;"><img src="http://www.bracegirdle.it/images/chiudi.gif" alt="chiudi" title="chiudi" border="0"></a>&nbsp;&nbsp;&nbsp;</td></tr><tr><td height="44" width="376" valign="top" align="center" colspan="2"><form method="post" name="evid" action="evidenzia.php"><input type="text" name="stringa"> <input type="submit" value="cerca" onclick="' + oncli + '"></form><div id="s0" class="piccola"">Parole cercate: 0</div><div id="s1"></div><div id="s2"></div><div id="s3"></div><div id="s4"></div><div id="s5"></div></td></tr></table>';
}

}

function comment(vocina)
{
var page = "http://www.bracegirdle.it/Arda/comment.php?comment_id=" + vocina + "&comment_popup=true";
popwin = window.open(page,"","width=460,height=500,left=175,top=30,scrollbars,resizable")
popwin.focus();
}

function aiuto()
{
var page = "http://www.bracegirdle.it/aiuto_ricerca.php";
popwin = window.open(page,"","width=460,height=500,left=175,top=30,scrollbars,resizable")
popwin.focus();
}


function valuta(voce, num, score, mess, comm)
{

switch (mess){
case "1":
mess2='Grazie per aver votato :)';
break;
case "3":
mess2='Seleziona le stelle e vota la pagina!';
break;
case "2":
mess2='Hai gią votato questa pagina <img src="http://www.bracegirdle.it/images/alreadyvoted.gif" align="absmiddle">';
break;
}


document.getElementById('bar').innerHTML='<table width="99%" border="0" cellpadding="0"><tr><td height="24" colspan="2" align="left" valign="bottom" bordercolor="#FFFFFF"><div align="center"><strong>VOTO PAGINA</strong></div></td><td width="54%" rowspan="3" align="center"> </td><td width="21%" rowspan="3" align="center"><img src="http://www.bracegirdle.it/images/icon_comment.jpg" alt="commenti" title="commenti" align="absmiddle"><br>[<a href="http://www.bracegirdle.it/Arda/comment.php?comment_id='+voce+'" class="Stile96" rel="nofollow">Commenta la pagina</a>]<br><font size="-1"><div id="commenti"></div></font></td></tr><tr bordercolor="#FFFFFF"><td width="2%" align="left"><div id="notizie" align="center">&nbsp;</div></td><td width="23%" height="36" align="left"><ul class="star-rating"><li class="current-rating" style="width:'+score+'px;"></li><li><a href="?rating_'+num+'[]=1&rs_id='+num+'&rate'+num+'=Vota!" rel="nofollow" title="1 stella su 5" class="one-star">1</a></li><li><a href="?rating_'+num+'[]=2&rs_id='+num+'&rate'+num+'=Vota!" rel="nofollow" title="2 stelle su 5" class="two-stars">2</a></li><li><a href="?rating_'+num+'[]=3&rs_id='+num+'&rate'+num+'=Vota!" rel="nofollow" title="3 stelle su 5" class="three-stars">3</a></li><li><a href="?rating_'+num+'[]=4&rs_id='+num+'&rate'+num+'=Vota!" rel="nofollow" title="4 stelle su 5" class="four-stars">4</a></li><li><a href="?rating_'+num+'[]=5&rs_id='+num+'&rate'+num+'=Vota!" rel="nofollow" title="5 stelle su 5" class="five-stars">5</a></li></ul></ul></td></tr><tr bordercolor="#FFFFFF"><td height="18" colspan="2" align="left" valign="top"><div align="center"><font size="-1">'+mess2+'</font></div></td></tr></table>';

if (comm==1)
comm2=' commento';
else comm2=' commenti';

document.getElementById('commenti').innerHTML="[ <span class=\"Stile96\"><a href=\"javascript:comment('"+voce+"')\" title=\"Leggi o scrivi commenti\">"+comm+comm2+"</a></span> ]";


}

/*
======================================================================
Pausing RSS scroller JavaScript engine- © Dynamic Drive (http://www.dynamicdrive.com)
Docs: http://www.dynamicdrive.com/dynamicindex17/rsspausescroller/
Last modified: March 16th, 2006.
======================================================================
*/

//URL to "scrollerbridge.php" on your server:
var bridgepath="http://www.bracegirdle.it/scrollerbridge.php"

//Advanced users: Edit below function to format the RSS feed output as desired
//formatrssmessage(divid, message_index_within_array, linktarget, logicswitch)

function formatrssmessage(divid, msgnumber, linktarget, logicswitch){
var rsscontent=rsscontentdata[divid][msgnumber]
var linktitle='<span class="rsstitle"><a href="'+unescape(rsscontent.link)+'" target="'+linktarget+'" title="vai alla notizia">'+unescape(rsscontent.title)+'</a></span>'
var description='<div class="rssdescription">'+unescape(rsscontent.description)+'</div>'
var feeddate='<span class="rssdate">'+unescape(rsscontent.date)+'</span>'
if (logicswitch.indexOf("description")!=-1 && logicswitch.indexOf("date")!=-1) //Logic switch- Show description and date
return linktitle+"<br />"+feeddate+description
else if (logicswitch.indexOf("description")!=-1) //Logic switch- Show just description
return linktitle+"<br />"+description
else if (logicswitch.indexOf("date")!=-1) //Logic switch- Show just date
return linktitle+"<br />"+feedate
else
return linktitle //Default- Just return hyperlinked RSS title
}

//////NO NEED TO EDIT BEHIND HERE///////////////////////////

var rsscontentdata=new Array() //global array to hold RSS feeds contents

//rsspausescroller(RSS_id, divId, divClass, delay, linktarget, optionalswitch)

function rsspausescroller(RSS_id, divId, divClass, delay, linktarget, logicswitch){
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.linktarget=(typeof linktarget!="undefined")? linktarget : ""
this.logicswitch=(typeof logicswitch!="undefined")? logicswitch : ""
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
this.js_is_loaded=0
this.number_of_tries=0
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1"><span style="position: absolute">Caricamento news...</span></div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2"></div></div>')
if (document.getElementById){ //perform basic DOM browser support
var parameters="id="+encodeURIComponent(RSS_id)+"&divid="+divId+"&bustcache="+new Date().getTime()
rsspausescroller.getRSScontentJS(bridgepath+"?"+parameters)
this.do_onjsload()
}
}

// -------------------------------------------------------------------
// do_onjsload()- Checks if external JS containing RSS feed is loaded yet
// -If not, continue to check until yes, or abort after certain tries.
// -------------------------------------------------------------------

rsspausescroller.prototype.do_onjsload=function(){
var scrollerinstance=this
if (typeof rsscontentdata[this.tickerid]=="undefined" && this.number_of_tries<40){ //if JS array holding RSS content not yet loaded
this.number_of_tries++
setTimeout(function(){scrollerinstance.do_onjsload()}, 200) //recheck
}
else if (typeof rsscontentdata[this.tickerid]!="undefined"){ //if JS array has loaded
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(rsspausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIV to outer DIV width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.visiblediv.innerHTML=formatrssmessage(this.tickerid, 0, this.linktarget, this.logicswitch)
this.hiddendiv.innerHTML=formatrssmessage(this.tickerid, 1, this.linktarget, this.logicswitch)
this.do_ondivsinitialized()
}
else
document.getElementById(this.tickerid).innerHTML=rsscontentdata+"Limite di attesa superato per accedere al feed RSS. <a href='javascript:window.location.reload();'>Ricaricare</a> la pagina."
}

// -------------------------------------------------------------------
// do_ondivsinitialized()- Checks if two divs of scroller is each populated with RSS message yet
// -If not, continue to check until yes, or abort after certain tries.
// -------------------------------------------------------------------

rsspausescroller.prototype.do_ondivsinitialized=function(){
var scrollerinstance=this
if (parseInt(this.visiblediv.offsetHeight)==0 || parseInt(this.hiddendiv.offsetHeight)==0)
setTimeout(function(){scrollerinstance.doondivsinitialized()}, 100)
else
this.initialize()
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

rsspausescroller.prototype.initialize=function(){
var scrollerinstance=this
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.tickerdiv.onmouseover=function(){scrollerinstance.mouseoverBol=1}
this.tickerdiv.onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------


rsspausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.rotatemessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

rsspausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

rsspausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// rotatemessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

rsspausescroller.prototype.rotatemessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.rotatemessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=rsscontentdata[this.tickerid].length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=formatrssmessage(this.tickerid, this.hiddendivpointer, this.linktarget, this.logicswitch)
this.animateup()
}
}

// -------------------------------------------------------------------
// getRSScontentJS()- Fetch RSS feed as external JavaScript
// -------------------------------------------------------------------

rsspausescroller.getRSScontentJS=function(scripturl){
var scriptref=document.createElement('script')
scriptref.setAttribute("type","text/javascript")
scriptref.setAttribute("src", scripturl)
document.getElementsByTagName("head").item(0).appendChild(scriptref)
}


rsspausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}

function creanews()
{
document.getElementById('noti').innerHTML='<script type="text/javascript">\nnew rsspausescroller("blog", "pscroller2", "rssclass", 3000, "_blank", "date+description");\n</script>';
}
function addSmilie(smilie) {
	document.form1.testo.value += (smilie + " ");
}
