function Vaicombo(link) {

	url = link[link.selectedIndex].value;
	

	if (url == -1) return false;
	

	location.href=url;

}



function Apricombo(link) {

if (link.selectedIndex==0) return false;

	url = link[link.selectedIndex].value;

	win = window.open(url,'combo','');

	win.focus();

}



function MenuRaint(links) {

if (links.selectedIndex==0) return false;

lingua = links[links.selectedIndex].value;

win = window.open(lingua,'v','top=40,left=40,width=330,height=400,toolbar=0,directories=0,menubar=0,status=0,resizable=0,location=0,scrollbars=0,copyhistory=0');

win.focus();

}



function MenuViabilita(links) {

UrlViabilita = links[links.selectedIndex].value;

options='top=40,left=40,width=600,height=600,toolbar=0,directories=0,menubar=0,status=0,resizable=no,location=0,scrollbars=1,copyhistory=0';

previewPage=window.open(UrlViabilita,'preview2',options);

previewPage.focus();

}



function MenuTG(links) {

UrlTg = links[links.selectedIndex].value;

options = "top=40,left=40,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=575,height=470";

previewPage=window.open(UrlTg,'preview2',options);

previewPage.focus();

}



function apripopup(url,w,h,resizable,scroll) {

win = window.open(url,'win','width='+w+',height='+h+',top=40,left=40,toolbar=0,directories=0,menubar=0,status=0,resizable='+resizable+',location=0,scrollbars='+scroll+',copyhistory=0');

win.focus();

return false;

}



function apripopupdoppio(url,w,h,resizable,scroll) {

win2 = window.open(url,'win2','width='+w+',height='+h+',top=40,left=40,toolbar=0,directories=0,menubar=0,status=0,resizable='+resizable+',location=0,scrollbars='+scroll+',copyhistory=0');

win2.focus();

return false;

}



function apripopupfromflash(url,w,h,resizable,scroll) {

win = window.open(url,'win','width='+w+',height='+h+',top=40,left=40,toolbar=0,directories=0,menubar=0,status=0,resizable='+resizable+',location=0,scrollbars='+scroll+',copyhistory=0');

win.focus();

}



function aprilink(link) {

linkwin = window.open(link,'link','top=40,left=40,width=700,height=500,toolbar=1,directories=0,menubar=1,status=0,resizable=yes,location=1,copyhistory=0,scrollbars=yes');

linkwin.focus();

}

function apriDesc(idDesc) {

descwin = window.open("/CmsRai/portale/pub/DescFoto/0,,"+idDesc+",00.html",'desc','top=40,left=40,width=300,height=300,toolbar=1,directories=0,menubar=1,status=0,resizable=yes,location=1,copyhistory=0,scrollbars=no');

descwin.focus();

return false;

}

function votaSondaggio(f,UrlSondaggio) {

	var voto=false;

	var idvoto=0;

	for (i=0; i< f.risposta.length;i++) {

		if (f.risposta[i].checked=="1") {

		voto = true;

		idvoto = f.risposta[i].value;

		}

	}

	if (voto==false) {

		alert("Selezionare una risposta prima di votare");

		return false;

	}

	UrlSondaggio = UrlSondaggio + "?id_sondaggio=" + f.id_sondaggio.value + "&id_voto=" + idvoto;

	options='width=500,height=450,toolbar=0,directories=0,menubar=0,status=0,resizable=yes,location=0,scrollbars=1,copyhistory=0,left=40,top=40';

	popupSondaggio=window.open(UrlSondaggio,'sondaggio',options);

	popupSondaggio.focus();

	
	return false;

}

function apriTLV(page, regione, sottopagina) {

	if (regione=="" || typeof(regione)=='undefined') regione="Nazionale";

	if (sottopagina=="" || typeof(sottopagina)=='undefined') sottopagina="0";

	
	wid=window.open("popupTelevideo.jsp?p="+page+"&s="+sottopagina+"&r="+regione,'popupTLV','top=40,left=40,width=660,height=580,toolbar=0,directories=0,menubar=0,status=0,resizable=yes,location=0,copyhistory=0,scrollbars=no');
	//document.form1.trova.focus();

	//wid.focus();

	//return false;

	//toldo da fabio

}

/**
 * Funzine che apre in un popup la pagina per navigare il solo televideo
 */

function apriPopupTLV(page, regione, sottopagina, pagetocall,scheda) {

	if (regione=="" || typeof(regione)=='undefined') regione="Nazionale";
	if (sottopagina=="" || typeof(sottopagina)=='undefined') sottopagina="0";
	
	//questo parametro č valorizzato solo dalla pagina cinemaregione e serve per indicare che il popupTelevideo verrā aperto senza la 
	//parete sopra di navigazione
  if(scheda=="" || typeof(scheda)=='undefined'){
			wid=window.open(pagetocall+"?p="+page+"&s="+sottopagina+"&r="+regione+"&pagetocall="+pagetocall,'popupTLV','top=40,left=40,width=380,height=550,toolbar=0,directories=0,menubar=0,status=0,resizable=false,location=0,copyhistory=0,scrollbars=no');
  
  }else{
  	if(pagetocall =="popupTelevideo.jsp"){
			wid=window.open(pagetocall+"?p="+page+"&s="+sottopagina+"&r="+regione+"&pagetocall="+pagetocall+"&scheda=si",'popupTLV','top=40,left=40,width=380,height=550,toolbar=0,directories=0,menubar=0,status=0,resizable=false,location=0,copyhistory=0,scrollbars=no');
    }else{
    	 wid=window.open(pagetocall+"?p="+page+"&s="+sottopagina+"&r="+regione+"&pagetocall="+pagetocall,'popupTLV','top=40,left=40,width=380,height=550,toolbar=0,directories=0,menubar=0,status=0,resizable=false,location=0,copyhistory=0,scrollbars=no');

    }
  }
  
}

function ricaricaRegione(url,parametro) {

	window.location.href=url+parametro;

}

/*************************************************************************

  This code is from Dynamic Web Coding at http://www.dyn-web.com/

  Copyright 2001-3 by Sharon Paine 

  See Terms of Use at http://www.dyn-web.com/bus/terms.html

  regarding conditions under which you may use this code.

  This notice must be retained in the code as is!

*************************************************************************/

// If all the images you wish to display are in the same location, you can specify the path here 

// no need to edit code below 

/////////////////////////////////////////////////////////////////////

rotateImgObjs = []; // holds all rotating image objects defined

// constructor 

function rotateImgObj(nm,s) {

  this.speed=s; 
  this.ctr=0; 
  this.timer=0;  

  this.arrayMapArea=[];

  this.imgObj = document.images[nm]; // get reference to the image object

  //this.mapObj = document.getElementById("mappapng"); // get reference to the image object
  this.idAreaMap = rotateImgObj.idAreaMap;
  this.mapObj = document.getElementById(this.idAreaMap); // get reference to the image object

  this.index = rotateImgObjs.length; rotateImgObjs[this.index] = this;

  this.primvaolta=1;

  this.animString = "rotateImgObjs[" + this.index + "]";
  this.addref = rotateImgObj.hrefarg;
 

}

rotateImgObj.prototype = {
    
    addImages: function() { // preloads images

			    this.imgObj.imgs = [];
			

			    for (var i=0; arguments[i]; i++) {

			      this.imgObj.imgs[i] = new Image();

			      this.imgObj.imgs[i].src = rotateImgObj.imagesPath + arguments[i];

			    }

			  },

  	addMapArea : function () { //addmaparea

			    this.arrayMapArea=new Array(arguments.length);

			    appoggio="";

			    prova="";
			

			    for (var i=0; i<arguments.length; i++) {

					appoggio=arguments[i];

					paramMap=appoggio.split("-");

					stringa="";
			      

					for (j=0;j < paramMap.length; j++) {
				     

						//stringa+='<area COORDS="'+paramMap[j++]+','+paramMap[j++]+','+paramMap[j++]+','+paramMap[j++]+'" target="_blank" href="javascript:apriTLV('+paramMap[j]+');" onmousedown="apriTLV('+paramMap[j]+');return false;" _href="popupTelevideo.jsp?p='+paramMap[j++]+'&s=0">';

						//stringa+='<area COORDS="'+paramMap[j++]+','+paramMap[j++]+','+paramMap[j++]+','+paramMap[j++]+'" href="javascript:apriTLV('+paramMap[j++]+',regione);">';

					   
					    if(parseInt(j) == paramMap.length-1){
					    	stringa+= paramMap[j];
					    }else{    
							stringa+= paramMap[j]+',';
						}
					}
					

					this.arrayMapArea[i]=stringa;

			    }
			

			  },

  rotate: function() {
  

			    if (this.ctr < this.imgObj.imgs.length-1){ 
			    	this.ctr++;
			    }else {
			    	this.ctr = 0;
			    }
			   

			    if (this.arrayMapArea[this.ctr] && this.arrayMapArea[this.ctr]!='undefined') {

			    	this.mapObj.innerHTML=this.arrayMapArea[this.ctr];
					//*************************
					  var maps = document.getElementById(this.idAreaMap);
					  var areas = maps.getElementsByTagName("area"); 
					
					    for(var j = 0; j < areas.length; j++){
						     //Aggiunto da Milena: nell'href vengono aggiunti gli attributi necessari
						     var areas_href = areas[j].href +  rotateImgObjs[0].addref;
						     areas[j].href = areas_href;
						}			
					//*************************	

			    } else {

			    	this.mapObj.innerHTML="";

			    }
			

			    this.imgObj.src = this.imgObj.imgs[this.ctr].src;

			  }
			  

  

}



// sets up rotation for all defined rotateImgObjs

rotateImgObj.start = function() {

	for (var i=0; i<rotateImgObjs.length; i++){ 	

    	rotateImgObjs[i].timer = setInterval(rotateImgObjs[i].animString + ".rotate()", rotateImgObjs[i].speed);  
  
  	}                   

}



// **************************************************************************

// MENU'

function MM_reloadPage(init) {  //reloads the window if Nav4 resized

  if (init==true) with (navigator) {
  	if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {

    	document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; 
    }
  } else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) 
  	location.reload();

  }

	MM_reloadPage(true);



function MM_findObj(n, d) { //v4.01

  var p,i,x;  
  
  if(!d) d=document; 
  if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d = parent.frames[n.substring(p+1)].document; 
    n=n.substring(0,p);
  }

  if(!(x=d[n])&&d.all) x=d.all[n]; 
  
  for (i=0;!x&&i<d.forms.length;i++)
  	 x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
  	x = MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) 
  	x = d.getElementById(n); 
  
  return x;

}



function MM_showHideLayers() { //v6.0

  var args=MM_showHideLayers.arguments;

  var i,p,v,obj;

  for (i=0; i<(args.length-2); i+=3) 
  	if ((obj=MM_findObj(args[i]))!=null) { 
  		v = args[i+2];

        if (obj.style) { 
        	obj=obj.style; 
        	v=(v=='show')?'visible':(v=='hide')?'hidden':v; 
       	}

    	obj.visibility=v; 
   	}

    if(args[9]=='hide'){

    	adtechhideElement();

    }else{

    	adtechshowElement();

    }

}



function MM_showHideLayers2(args) { //v6.0

	//alert("cc");

  var i,p,v,obj;

  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];

    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }

    obj.visibility=v; }

}





//serve per mantenere accesa la linguetta del menu'

function onMe(name,n){

	adtechhideElement();

	var did=document.getElementById(name);

	var backcolor;

	var col2;

	col2='#FFFFFF';

	if (n==1) {

		backcolor='#210099';

	}

	if (n==2) {

		backcolor='#210099';

	}

	if (n==3) {

		backcolor='#210099';

	}

	if (n==4) {

		backcolor='#210099';

	}

	if (n==5) {

		backcolor='#210099';

	}

	if (n==6) {

		backcolor='#210099';

		col2='#FFFFFF';

	}

	if (n==7) {

		backcolor='#210099';

	}

	if (n==8) {

		backcolor='#210099';

	}

	if (n==9) {

		backcolor='#210099';

	}

	if (n==10) {

		backcolor='#210099';

	}

	did.style.cssText='padding:5px;color:'+col2+';text-decoration:none;background-color:'+backcolor+';font:small-caps bold .7em verdana,arial,helvetica,sans-serif;';

}

function outMe(name){

	var did=document.getElementById(name);

	did.style.cssText='';

	adtechshowElement();

}



function adtechhideElement() {

	for (i = 0; i < document.getElementsByTagName('SELECT').length; i++){obj = document.getElementsByTagName('SELECT')[i]; if (! obj || ! obj.offsetParent) continue; obj.style.visibility = "hidden";}

}



function adtechshowElement() {

	for (i = 0; i < document.getElementsByTagName('SELECT').length; i++){obj = document.getElementsByTagName('SELECT')[i]; if (! obj || ! obj.offsetParent) continue; obj.style.visibility = "";}

}

//function adtechshowElement(){	

//	if (document.all) { 

//		dclk_expand.style.visibility='visible';

//	}	else if (navigator.userAgent.indexOf('Gecko')>0) { 

//		dclk_div["dclk_expand"].style.visibility='visible';

//	}

//}

//function adtechhideElement(){	

//	if (document.all) { 

//		dclk_expand.style.visibility='hidden';

//	}	else if (navigator.userAgent.indexOf('Gecko')>0) { 

//		dclk_div["dclk_expand"].style.visibility='hidden';

//	}

//}

