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




var t_id = setInterval(animate,20);
var pos=0;
var dir=2;
var len=0;
function animate()
{
var elem = document.getElementById('progress');
if(elem != null) {
if (pos==0) len += dir;
if (len>32 || pos>79) pos += dir;
if (pos>79) len -= dir;
if (pos>79 && len==0) pos=0;
elem.style.left = pos;
elem.style.width = len;
}
}
function remove_loading() {
this.clearInterval(t_id);
var targelem = document.getElementById('loader_container');
targelem.style.display='none';
targelem.style.visibility='hidden';
var t_id = setInterval(animate,60);
}
/*Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact*/
var offsetfrommouse=[15,25]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0; //duration in seconds image should remain visible. 0 for always.
var defaultimageheight = 40;	// maximum image size.
var defaultimagewidth = 40;	// maximum image size.
var timer;
function gettrailobj(){
if (document.getElementById)
return document.getElementById("preview_div").style
}

function gettrailobjnostyle(){
if (document.getElementById)
return document.getElementById("preview_div")
}
function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function hidetrail(){	
	gettrailobj().display= "none";
	document.onmousemove=""
	gettrailobj().left="-500px"
	clearTimeout(timer);
}
function showtrail(imagename,title,width,height){
	i = imagename
	t = title
	w = width
	h = height
	timer = setTimeout("show('"+i+"',t,w,h);",0);
}
function show(imagename,title,width,height){
 
   var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth - offsetfrommouse[0]
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)

	if( (navigator.userAgent.indexOf("Konqueror")==-1  || navigator.userAgent.indexOf("Firefox")!=-1 || (navigator.userAgent.indexOf("Opera")==-1 && navigator.appVersion.indexOf("MSIE")!=-1)) && (docwidth>650 && docheight>500)) {
		( width == 0 ) ? width = defaultimagewidth: '';
		( height == 0 ) ? height = defaultimageheight: '';
			
		width = 452;
		height = 342;
		defaultimageheight = height
		defaultimagewidth = width
	
		document.onmousemove=followmouse; 

		
		newHTML = '<div class="img_preview" style="width:'+  width +'px;height:'+ height +'px"><div id="loader_container"><div id="loader"><div id="loader_bg"><div id="progress"> </div></div></div></div>';
		newHTML = newHTML + '<h2 class="preview">' + ' '+title + '</h2>'
		
    	newHTML = newHTML + '<div class="preview_temp_load"><img onload="javascript:remove_loading();" src="' + imagename + '" border="0"></div>';
		newHTML = newHTML + '</div>'; 
		
		if(navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1 ){
			newHTML = newHTML+'<iframe class="iframe" src="about:blank" scrolling="no" frameborder="0" width="'+width+'" height="'+height+'"></iframe>';
		}		

		gettrailobjnostyle().innerHTML = newHTML;
		gettrailobj().display="block";
	}
}

function followmouse(e){

	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)

	if (typeof e != "undefined"){
		if (docwidth - e.pageX < defaultimagewidth + 2*offsetfrommouse[0]){
			xcoord = e.pageX - xcoord - defaultimagewidth; // Move to the left side of the cursor
		} else {
			xcoord += e.pageX;
		}
		if (docheight - e.pageY < defaultimageheight + 2*offsetfrommouse[1]){
			ycoord += e.pageY - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + e.pageY - docheight - truebody().scrollTop));
		} else {
			ycoord += e.pageY;
		}

	} else if (typeof window.event != "undefined"){
		if (docwidth - event.clientX < defaultimagewidth + 2*offsetfrommouse[0]){
			xcoord = event.clientX + truebody().scrollLeft - xcoord - defaultimagewidth; // Move to the left side of the cursor
		} else {
			xcoord += truebody().scrollLeft+event.clientX
		}
		if (docheight - event.clientY < (defaultimageheight + 2*offsetfrommouse[1])){
			ycoord += event.clientY + truebody().scrollTop - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + event.clientY - docheight));
		} else {
			ycoord += truebody().scrollTop + event.clientY;
		}
	}
	gettrailobj().left=xcoord+"px"
	gettrailobj().top=ycoord+"px"

}



/* marque div X 3 modificato da marquee div da Antonio Leto */



var delay1=1 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var delay2=1 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var delay3=1 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var speed1=1 //Specify marquee scroll speed (larger is faster 1-10)
var speed2=2 //Specify marquee scroll speed (larger is faster 1-10)
var speed3=9 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit1=0 //Pause marquee onMousever (0=no. 1=yes)?
var pauseit2=0 //Pause marquee onMousever (0=no. 1=yes)?
var pauseit3=0 //Pause marquee onMousever (0=no. 1=yes)?

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

var copyspeed1=speed1
var copyspeed2=speed2
var copyspeed3=speed3
var pausespeed1=(pauseit1==0)? copyspeed1: 0
var pausespeed2=(pauseit2==0)? copyspeed2: 0
var pausespeed3=(pauseit3==0)? copyspeed3: 0
var actualheight1=''
var actualheight2=''
var actualheight3=''

function scrollmarquee1()
{
if (parseInt(marquee1.style.top)>(actualheight1*(-1)+8))
marquee1.style.top=parseInt(marquee1.style.top)-copyspeed1+"px"//invertito segno
else
marquee1.style.top=parseInt(marqueeheight1)+8+"px" //invertito segno
}
function scrollmarquee2()
{
if (parseInt(marquee2.style.top)>(actualheight2*(-1)+8))
marquee2.style.top=parseInt(marquee2.style.top)-copyspeed1+"px"
else
marquee2.style.top=parseInt(marqueeheight2)+8+"px"

}function scrollmarquee3()
{
if (parseInt(marquee3.style.top)<100)  //se il parametro top di di vmarquee3 e' maggiore dell'altezza attuale
marquee3.style.top=parseInt(marquee3.style.top)+copyspeed3+"%" //allora aggiorna il parametro top di vmarquee3 al suo valore+la velocit�3 di spostamento
else
marquee3.style.top=0-400+"%"       //quando il top 
}

function initializemarquee1()
{
marquee1=document.getElementById("vmarquee1")
marquee1.style.top=0
marqueeheight1=document.getElementById("marqueecontainer1").offsetHeight
actualheight1=marquee1.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
marquee1.style.height=marqueeheight1+"px"
marquee1.style.overflow="scroll"
return
}
setTimeout('lefttime1=setInterval("scrollmarquee1()",100)', delay1)
}
function initializemarquee2()
{
marquee2=document.getElementById("vmarquee2")
marquee2.style.top=0
marqueeheight2=document.getElementById("marqueecontainer2").offsetHeight
actualheight2=marquee2.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
marquee2.style.height=marqueeheight2+"px"
marquee2.style.overflow="scroll"
return
}
setTimeout('lefttime2=setInterval("scrollmarquee2()",100)', delay1)
}
function initializemarquee3()
{
marquee3=document.getElementById("vmarquee3")
marquee3.style.top=-450+"%"
marqueeheight3=document.getElementById("marqueecontainer3").offsetHeight
actualheight3=marquee3.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
marquee3.style.height=marqueeheight3+"px"
marquee3.style.overflow="scroll"
return
}
setTimeout('lefttime3=setInterval("scrollmarquee3()",100)', delay1)
}
if (window.addEventListener)
window.addEventListener("load", initializemarquee1, false)

else if (window.attachEvent)
window.attachEvent("onload", initializemarquee1)

else if (document.getElementById)
window.onload=initializemarquee1

if (window.addEventListener)
window.addEventListener("load", initializemarquee2, false)

else if (window.attachEvent)
window.attachEvent("onload", initializemarquee2)

else if (document.getElementById)
window.onload=initializemarquee2

if (window.addEventListener)
window.addEventListener("load", initializemarquee3, false)

else if (window.attachEvent)
window.attachEvent("onload", initializemarquee3)

else if (document.getElementById)
window.onload=initializemarquee3
/************open_div******************/
var enablepersist="off" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="no" //Collapse previously open content when opening present? (yes/no)
var contractsymbol='<img src="opilioni_2nd_gen/opilione1.png" width="35% height="35%">' //HTML for contract symbol. For image, use: <img src="whatever.gif">
var expandsymbol='<img src="opilioni_2nd_gen/opilione2.png" width="35% height="35%">' //HTML for expand symbol.

if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}

function getElementbyClass(rootobj, classname){
var temparray=new Array()
var inc=0
var rootlength=rootobj.length
for (i=0; i<rootlength; i++){
if (rootobj[i].className==classname)
temparray[inc++]=rootobj[i]
}
return temparray
}

function sweeptoggle(ec){
var thestate=(ec=="expand")? "block" : "none"
var inc=0
while (ccollect[inc]){
ccollect[inc].style.display=thestate
inc++
}
revivestatus()
}

function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}

function expandcontent(curobj, cid){
var spantags=curobj.getElementsByTagName("SPAN")
var showstateobj=getElementbyClass(spantags, "showstate")
if (ccollect.length>0){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
if (showstateobj.length>0){ //if "showstate" span exists in header
if (collapseprevious=="no")
showstateobj[0].innerHTML=(document.getElementById(cid).style.display=="block")? contractsymbol : expandsymbol
else
revivestatus()
}
}
}

function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}

function revivestatus(){
var inc=0
while (statecollect[inc]){
if (ccollect[inc].style.display=="block")
statecollect[inc].innerHTML=contractsymbol
else
statecollect[inc].innerHTML=expandsymbol
inc++
}
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}

document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
var alltags=document.all? document.all : document.getElementsByTagName("*")
ccollect=getElementbyClass(alltags, "switchcontent")
statecollect=getElementbyClass(alltags, "showstate")
if (enablepersist=="on" && ccollect.length>0){
document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0" 
firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
if (!firsttimeload)
revivecontent()
}
if (ccollect.length>0 && statecollect.length>0)
revivestatus()
}

if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate

//EYEspin_dhtml (c) Petre Stefan
//email: eyecon@eyecon.ro
//website: www.eyecon.ro
//Modified by JavaScriptKit.com for relative positioning of menu
//please leave this copyright notice intact

eye={p:0,x:0,y:0,w:0,h:0,r:0,v:0,s:0,isVertical:0,a1:0,a2:0,a3:0,
color:'#ffffff',
colorover:'#ffffff',
backgroundcolor:'#0099ff',
backgroundcolorover:'#000000',
bordercolor:'#000000',
fontsize:12,
fontfamily:'Arial',
pas:0,
spinmenu:function()
		{
		this.p=this.r/this.s;this.a1=this.a2=this.isVertical?0:Math.PI/2;
		},
spinmenuitem:function(a7,a6,a5)
		{
		a4="onclick='window.open(\""+a6+"\""+(a5?(",\""+a5+"\""):",\"_self\"")+")'";//a6 quando un elemento viene clikkato 
		document.write("<div id='spinmenu"+this.a3+"'style='cursor:pointer;cursor:expression(\"hand\");position:absolute;width:"+this.w+"px;left:"+this.h+"px;"+"background-color:"+this.backgroundcolor+";color:"+this.color+";border:1px solid "+this.bordercolor+";font:normal "+this.fontsize+"px "+this.fontfamily+";text-align:center;cursor:default;z-Index:1000;' onmouseover='this.style.color=\""+this.colorover+"\";this.style.backgroundColor=\""+this.backgroundcolorover+"\"'"+	"onmouseout='this.style.color=\""+this.color+"\";this.style.backgroundColor=\""+this.backgroundcolor+"\"'"+a4+">"+a7+"</div>");
		this.a3++ //a3 � l'indice dell'elemento del menu
		},
muta:function()
		{
		a8=document.getElementById("controale");
			for(i=0;i<this.a3;i++)
			{
					a9=document.getElementById("spinmenu"+i+"");a9s=a9.style;
					if(this.isVertical)
						{
							xi=parseInt(this.r*Math.cos(this.a1+i*this.pas))/this.s;yi=parseInt(this.r*Math.sin(this.a1+i*this.pas));
							a10=(this.p+xi)/(2*this.p);a11=this.fontsize*(this.p+xi)/(2*this.p)+2;
							a12=parseInt(100*(this.p+xi)/(2*this.p))
						}
					else
						{
							xi=parseInt(this.r*Math.cos(this.a1+i*this.pas));
							yi=parseInt(this.r*Math.sin(this.a1+i*this.pas))/this.s;a10=(this.p+yi)/(2*this.p);a11=this.fontsize*(this.p+yi)/(2*this.p)+2;
							a12=parseInt(100*(this.p+yi)/(2*this.p))
						};
						a13=(this.w-20)*a10+20;
						a14=(this.h-20)*a10+10;
						a9s.top=(yi+this.y-a14/2)+"px";
						a9s.left=(xi+this.x-a13/2)+"px";
						a9s.width=a13+"px";a9s.fontSize=a11+"px";
						a9s.zIndex=a12};
						a8.style.top=this.y+(this.isVertical?this.r:this.p)+this.h/2+6;
						a8.style.left=this.x-a8.offsetWidth/2;
					   
					if(this.a1!=this.a2)
						{
							this.a1=(this.a1>this.a2)?(this.a1-this.pas/this.v):(this.a1+this.pas/this.v);
							if(Math.abs(this.a1-this.a2)<this.pas/this.v)
								this.a1=this.a2;
								setTimeout("eye.muta()",10)
						}
			},
spinmenuclose:function()
			{
			this.pas=2*Math.PI/this.a3;
document.write('<div id="controale" style="position:absolute" onclick="eye.a2+=eye.pas;eye.muta()" onfocus="this.blur()"></div>');					
			eye.muta();
			}
			};


function getposOffset(what,offsettype)
			{
			var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
			var parentEl=what.offsetParent;
			while (parentEl!=null)
				{
					totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft :totaloffset+parentEl.offsetTop;parentEl=parentEl.offsetParent;
				}return totaloffset;
}














