// JavaScript Document

//BOX
$(document).ready(function() {

$(".reg_privacy").fancybox({
				'width'				: '85%',
				'height'			: '85%',
		        'autoScale'     	: false,
		        'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
				//'overlayOpacity'	: 0.95,
				//'overlayColor'		: '#FFF'
			});

$(".rich_info").fancybox({
				'width'				: 500,
				'height'			: 585,
		        'autoScale'     	: false,
		        'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
				//'overlayOpacity'	: 0.95,
				//'overlayColor'		: '#FFF'
			});

});

//link mailto antispam	
function mail_no_spam(user,dominio) 
    { 
        document.location.href = "mailto:" + user + "@" + dominio; 
    }
	
//link mailto antispam	
function mail_no_spam2(user,dominio,sogg) 
    { 
        document.location.href = "mailto:" + user + "@" + dominio + "?subject=" + sogg; 
    }



//CONTROLLO FORM RICERCA
function buildSelect() { //alert(x) ; //return
x= document.getElementById('contr').value;
if (x == "1") { 
  /* set choices 1 and 2 */
  option0 = new Option("0",0);
  option1 = new Option("50000",50000);
  option2 = new Option("100000",100000);
  option3 = new Option("100000",100.000);
  option4 = new Option("150000",150.000);
  option5 = new Option("200000",200.000);
  option6 = new Option("250000",250.000);
  option7 = new Option("300000",300.000);
  option8 = new Option("350000",350.000);
  option9 = new Option("400000",400.000);
  option10 = new Option("450000",450.000);
  option11 = new Option("500000",500.000);
  
  // write them
  document.getElementById('da').options[0] = option0;
  document.getElementById('da').options[1] = option1;
  document.getElementById('da').options[2] = option2;
  document.getElementById('da').options[3] = option3;
  document.getElementById('da').options[4] = option4;
  document.getElementById('da').options[5] = option5;
  document.getElementById('da').options[6] = option6;
  document.getElementById('da').options[7] = option7;
  document.getElementById('da').options[8] = option8;
  document.getElementById('da').options[9] = option9;
  document.getElementById('da').options[10] = option10;
  document.getElementById('da').options[11] = option11;


  /* set choices 1 and 2 */
  optionb0 = new Option("50.000",50000);
  optionb1 = new Option("100.000",100000);
  optionb2 = new Option("150.000",150.000);
  optionb3 = new Option("200.000",200.000);
  optionb4 = new Option("250.000",250.000);
  optionb5 = new Option("300.000",300.000);
  optionb6 = new Option("350.000",350.000);
  optionb7 = new Option("400.000",400.000);
  optionb8 = new Option("450.000",450.000);
  optionb9 = new Option("500.000",500.000);
  optionb10 = new Option("Max","Max");
  
  // write them
  document.getElementById('a').options[0] = optionb0;
  document.getElementById('a').options[1] = optionb1;
  document.getElementById('a').options[2] = optionb2;
  document.getElementById('a').options[3] = optionb3;
  document.getElementById('a').options[4] = optionb4;
  document.getElementById('a').options[5] = optionb5;
  document.getElementById('a').options[6] = optionb6;
  document.getElementById('a').options[7] = optionb7;
  document.getElementById('a').options[8] = optionb8;
  document.getElementById('a').options[9] = optionb9;
  document.getElementById('a').options[10] = optionb10;
  document.getElementById('a').options[10].selected=true;

  return;
  }else if (x == "2") { 
  /* set choices 1 and 2 */
  option0 = new Option("0",0);
  option1 = new Option("200",200);
  option2 = new Option("400",400);
  option3 = new Option("600",600);
  option4 = new Option("800",800);
  option5 = new Option("1.000",1000);
  option6 = new Option("1.200",1200);
  option7 = new Option("1.400",1400);
  option8 = new Option("1.600",1600);
  option9 = new Option("1.800",1800);
  option10 = new Option("2.000",2000);
  
  // write them
  document.getElementById('da').options[0] = option0;
  document.getElementById('da').options[1] = option1;
  document.getElementById('da').options[2] = option2;
  document.getElementById('da').options[3] = option3;
  document.getElementById('da').options[4] = option4;
  document.getElementById('da').options[5] = option5;
  document.getElementById('da').options[6] = option6;
  document.getElementById('da').options[7] = option7;
  document.getElementById('da').options[8] = option8;
  document.getElementById('da').options[9] = option9;
  document.getElementById('da').options[10] = option10;

  /* set choices 1 and 2 */
  optionb0 = new Option("200",200);
  optionb1 = new Option("400",400);
  optionb2 = new Option("600",600);
  optionb3 = new Option("800",800);
  optionb4 = new Option("1.000",1000);
  optionb5 = new Option("1.200",1200);
  optionb6 = new Option("1.400",1400);
  optionb7 = new Option("1.600",1600);
  optionb8 = new Option("1.800",1800);
  optionb9 = new Option("2.000",2000);
  optionb10 = new Option("Max","Max");
  
  // write them
  document.getElementById('a').options[0] = optionb0;
  document.getElementById('a').options[1] = optionb1;
  document.getElementById('a').options[2] = optionb2;
  document.getElementById('a').options[3] = optionb3;
  document.getElementById('a').options[4] = optionb4;
  document.getElementById('a').options[5] = optionb5;
  document.getElementById('a').options[6] = optionb6;
  document.getElementById('a').options[7] = optionb7;
  document.getElementById('a').options[8] = optionb8;
  document.getElementById('a').options[9] = optionb9;
  document.getElementById('a').options[10] = optionb10;
  document.getElementById('a').options[10].selected=true;
  return;
  }

}


//NEWS SCORREVOLI

var tickdelay=5000 //delay btw messages
var highlightspeed=10 //10 pixels at a time.
 
////Do not edit pass this line////////////////
 
var currentmessage=0
var clipwidth=0
 
function changetickercontent(){
crosstick.style.clip="rect(0px 0px auto 0px)"
crosstick.innerHTML=tickercontents[currentmessage]
highlightmsg()
}
 
function highlightmsg(){
var msgwidth=crosstick.offsetWidth
if (clipwidth<msgwidth){
clipwidth+=highlightspeed
crosstick.style.clip="rect(0px "+clipwidth+"px auto 0px)"
beginclip=setTimeout("highlightmsg()",20)
}
else{
clipwidth=0
clearTimeout(beginclip)
if (currentmessage==tickercontents.length-1) currentmessage=0
else currentmessage++
setTimeout("changetickercontent()",tickdelay)
}
}
 
function start_ticking(){
crosstick=document.getElementById? document.getElementById("highlighter") : document.all.highlighter
crosstickParent=crosstick.parentNode? crosstick.parentNode : crosstick.parentElement
if (parseInt(crosstick.offsetHeight)>0)
crosstickParent.style.height=crosstick.offsetHeight+'px'
else
setTimeout("crosstickParent.style.height=crosstick.offsetHeight+'px'",100) //delay for Mozilla's sake
changetickercontent()
}
 
if (document.all || document.getElementById)
window.onload=start_ticking
