function jumpMenu( targ, selObj, restore, urlA, urlB ){
	eval( targ + ".location='" + urlA + selObj.options[selObj.selectedIndex].value + urlB + "'" );
	if ( restore ) selObj.selectedIndex = 0;
}

function bm_change_prop( objRef, color, linkRef ) {
	objRef.style.backgroundColor = color;
	if ( color=='#ffffff' ) {
		objRef.style.color = '#666666';
		document.getElementById(linkRef).style.color = '#666666';
	}
	else {
		objRef.style.color = '#ffffff';
		document.getElementById(linkRef).style.color = '#ffffff';
	}
	return;
}

function CheckLength( num_caratteri ) {
	with (document.modulo) {
		if ( corpo.value.length > num_caratteri ) { corpo.value = corpo.value.substr( 0, num_caratteri ); corpo.blur(); }
		chr.value = num_caratteri - corpo.value.length;
	}
}

//
// Funzioni per lo scroll delle news in home page ### inizio
//
function start() {
	if(document.getElementById)
		ns6marquee(document.getElementById('slider'));
	else if(document.all)
		iemarquee(slider);
	else if(document.layers)
		ns4marquee(document.slider1.document.slider2);
}

function iemarquee(whichdiv) {
	iediv = eval(whichdiv);
	iediv.style.pixelTop = sheight+"px";
	iediv.innerHTML = wholemessage;
	sizeup = iediv.offsetHeight;ieslide();
}

function ieslide() {
	if(iediv.style.pixelTop>=sizeup*(-1)) {
		iediv.style.pixelTop-=sspeed+"px";
		setTimeout("ieslide()",100);
	}
	else {
		iediv.style.pixelTop=sheight+"px";
		ieslide();
	}
}

function ns4marquee(whichlayer) {
	ns4layer = eval(whichlayer);
	ns4layer.top = sheight;
	ns4layer.document.write(wholemessage);
	ns4layer.document.close();
	sizeup = ns4layer.document.height;ns4slide();
}

function ns4slide() {
	if(ns4layer.top>=sizeup*(-1)) {
		ns4layer.top-=sspeed;
		setTimeout("ns4slide()",100);
	}
	else{
		ns4layer.top = sheight;ns4slide();
	}
}

function ns6marquee(whichdiv) {
	ns6div = eval(whichdiv);
	ns6div.style.top = sheight+"px";
	ns6div.innerHTML = wholemessage;
	sizeup = ns6div.offsetHeight;ns6slide();
}

function ns6slide() {
	if(parseInt(ns6div.style.top)>=sizeup*(-1)) {
		ns6div.style.top = parseInt(ns6div.style.top)-sspeed+"px";
		setTimeout("ns6slide()",100);
	}
	else{
		ns6div.style.top = sheight+"px";ns6slide();
	}
}
//
// Funzioni per lo scroll delle news in home page ### fine
//

//
// Funzioni per lo scroll del time out in home page ### inizio
//
var list; 
var tickerObj; 
var hex = 255;

function fadeText(divId) {
  if(tickerObj)
  {
    if(hex>0) {
      hex-=5; // increase color darkness
      tickerObj.style.color="rgb("+hex+","+hex+","+hex+")";
      setTimeout("fadeText('" + divId + "')", fadeSpeed); 
    } else
      hex=255; //reset hex value
  }
}

function initialiseList(divId) {
  tickerObj = document.getElementById(divId);
  if(!tickerObj)
    reportError("Could not find a div element with id \"" + divId + "\"");
  list = tickerObj.childNodes;
  if(list.length <= 0)
    reportError("The div element \"" + divId + "\" does not have any children");
  for (var i=0; i<list.length; i++) {
    var node = list[i];
    if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) 
              tickerObj.removeChild(node);
  }
  run(divId, 0);
}

function run(divId, count) {
  fadeText(divId);
  list[count].style.display = "block";
  if(count > 0)
    list[count-1].style.display = "none";
  else
    list[list.length-1].style.display = "none";
  count++;
  if(count == list.length)
    count = 0;
  window.setTimeout("run('" + divId + "', " + count+ ")", interval*1000);
}

function reportError(error) {
  alert("The script could not run because you have errors:\n\n" + error);
  return false;
}

var interval = 8; // interval in seconds
var fadeSpeed = 10;
//
// Funzioni per lo scrollo del time out in home page ### fine
//