function visualizzaDiv(elemento) {
	if (document.getElementById(elemento)) {
		div = document.getElementById(elemento);
		document.getElementById('1').style.display='none';
		document.getElementById('2').style.display='none';
		document.getElementById('3').style.display='none';
		div.style.display='block';
	}
}

/* Text changer - light version.
Let your text's font size customizable.
by Marco Rosella - http://www.centralscrutinizer.it/en/design/js-php/text-changer
                v0.2 - May 18, 2006
*/

window.onload = function() {

    textChanger.init();
    

    
}

var textChanger = {
    cpanel: 'textchanger',  //set here the id of the element (div, p) within you want to insert the control panel
    element: 'corpoRubriche',   	 //set here the id of the element (div, p) within you want to change the text
    cpanel1: 'mstextchanger',  //set here the id of the element (div, p) within you want to insert the control panel
    element1: 'mscorpoRubriche',   	 //set here the id of the element (div, p) within you want to change the text
    defaultFS: 1,         //set here the default font size in 'em'
    init: function() {

        var cpel = document.getElementById(textChanger.cpanel);
        if (cpel == null) {
            var cpel = document.getElementById(textChanger.cpanel1);
        }
        var el = document.getElementById(textChanger.element);
        if (el == null) {
            var el = document.getElementById(textChanger.element1);
        }

        if (cpel == null || el == null) { } else {
            var u = document.createElement('ul');
            cpel.appendChild(u);
            u.innerHTML =
		'<li id="decrease"><a href="#" title="Diminuisci il carattere"> </a></li>' +
		'<li id="increase"><a href="#" title="Aumenta il carattere"> </a></li>';
            var sz = textChanger.getCookie();
            el.style.fontSize = sz ? sz + 'em' : textChanger.defaultFS + 'em';
            var incr = document.getElementById('increase');
            incr.onclick = function() { textChanger.changeSize(1); return false; };
            var decr = document.getElementById('decrease');
            decr.onclick = function() { textChanger.changeSize(0); return false; };
        }
    },

    changeSize: function(val) {
        var el = document.getElementById(textChanger.element);
        if (el == null) {
            var el = document.getElementById(textChanger.element1);
        }
        var size = el.style.fontSize.substring(0, 3);
        var fSize = parseFloat(size, 10);
        if (val == 1) {
            fSize += 0.11;
            if (fSize > 2.0) fSize = 2.0;
        } else {
            fSize -= 0.11;
            if (fSize < 0.5) fSize = 0.5;
        }
        el.style.fontSize = fSize + 'em';
        //	textChanger.updateCookie(fSize);
    },


    getCookie: function() {
        var cname = 'textChangerL=size=';
        var start = document.cookie.indexOf(cname);
        var len = start + cname.length;
        if ((!start) && (cname != document.cookie.substring(0, cname.length))) { return null; }
        if (start == -1) return null;
        var end = document.cookie.indexOf(";", len);
        if (end == -1) end = document.cookie.length;
        return unescape(document.cookie.substring(len, end));
    }
}




function SearchOnGoogle() {

    if (document.getElementById("cerca").value != '') {
        var searchUrl = 'http://www.google.it/search?as_q=' + document.getElementById("cerca").value + '&as_sitesearch=www.avvenire.it';
        window.open(searchUrl, "_blank", "");
    }
}


//	Script per Scroll News
	
var delayb4scroll=1500; //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1; //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1; //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed;
var pausespeed=(pauseit==0)? copyspeed: 0;
var actualheight='';

function scrollmarquee() {
	if (cross_marquee != null) {
	    if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8)) {
		    cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px";
	    } else {
		    cross_marquee.style.top=parseInt(marqueeheight)+8+"px";
	    }
	}
}

function initializemarquee() {
	cross_marquee=document.getElementById("vmarquee");
	
	if (cross_marquee != null) {
	    cross_marquee.style.top=0;
	    marqueeheight=document.getElementById("marqueecontainer").offsetHeight;
	    actualheight=cross_marquee.offsetHeight;
	    if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1) { //if Opera or Netscape 7x, add scrollbars to scroll and exit
		    cross_marquee.style.height=marqueeheight+"px";
		    cross_marquee.style.overflow="scroll";
		    return;
	    }
	    setTimeout('lefttime=setInterval("scrollmarquee()",80)', delayb4scroll);
	}
}

if (window.addEventListener) {
	window.addEventListener("load", initializemarquee, false);
} else if (window.attachEvent) {
	window.attachEvent("onload", initializemarquee);
} else if (document.getElementById) {
	window.onload=initializemarquee;
}

// Fine Scroll News

function update(url,index,isSuper) 
{
        document['PhotoSuppl'].src=url;
}



