<!--

var dtCh= "/";
var minYear=1900;
var maxYear=2100;

function convdate(vdata){
	var strdata=vdata
	var strgiorno="0"+strdata.substring(0,strdata.indexOf("/"))
	strgiorno=strgiorno.slice(-2)
	strdata=strdata.substring(strdata.indexOf("/")+1)
	var strmese="0"+strdata.substring(0,strdata.indexOf("/"))
	strmese=strmese.slice(-2)
	strdata=strdata.substring(strdata.indexOf("/")+1)
	if (strdata.length>1) {
		var stranno="20"+strdata
	} else {
		var stranno="200"+strdata
	}
	stranno=stranno.slice(-4)
	strdata=stranno+strmese+strgiorno
	strdata=parseInt(strdata)
	return strdata
}

function slideFoto(attuale,successivo){
	if(attuale>0){
		clearTimeout(timerIDFoto);
	}
	if($('divFoto_'+successivo)!=null){
		$('divFoto_'+successivo).remove();		
	}
	var newDiv = new Element('div',{'id':'divFoto_'+successivo,'style':'display:none;','class':'contSlide'})
	new Ajax.Updater('divFoto_'+successivo, '/loadFoto.asp?id='+successivo, {
																asynchronous:true,
																evalScripts:true
																}
							);
	$('contenuti').appendChild(newDiv)

	if(attuale>0){
		new Effect.Fade('divFoto_'+attuale)
	}
	new Effect.Appear('divFoto_'+successivo)
}

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}
function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}
function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strDay=dtStr.substring(0,pos1)
	var strMonth=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		return false
	}
return true
}

function popup(scelta){
	finestra = window.open(scelta,'FILIPPI_BOATS','scrollbars=yes,resizable=NO,width=600,height=350,status=no,location=no,toolbar=no,left=50,top=50');
}

function popupwh(scelta,w,h){
	finestra = window.open(scelta,'FILIPPI_BOATS','scrollbars=yes,resizable=NO,width='+w+',height='+h+',status=no,location=no,toolbar=no,left=50,top=50');
}

function openImageWindow(imageSrc) {
	fileName = 'popupgall.htm?' + escape(imageSrc);
	myWindowHandle = window.open(fileName,'popup','directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no');
}

function loadswf(swf,w,h){
	document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"");
	document.write("codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\"");
	document.write("width=\""+w+"\" height=\""+h+"\">");
	document.write("<param name='movie' value='"+swf+"' />\n");
	document.write("<param name='quality' value='high' /><param name='wmode' value='transparent' />\n");
	document.write("<embed src=\""+swf+"\" quality=\"high\" wmode=\"transparent\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\""+w+"\" height=\""+h+"\"></embed>");
	document.write("</object>\n");
}

function chiamaMetodo(lev, mov) {
	var IE = navigator.appName.indexOf("Microsoft") != -1;
	var filmato = IE ? window.mainMovie : window.document.mainMovie;
	filmato.LoadMovie(lev, mov);
}

function checkMail(mail){
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(mail)){
		return true;
	}else{
		return false;
	}
}

function controlla(obbligatorio,nome,campo_data,campo_numero,campo_mail,campoPrivacy,controlloDate){
	var sAgent = navigator.userAgent.toLowerCase() ;
	var elemento = document.getElementById(nome)
	len =elemento.elements.length;
	var i=0;
	var campo=' I seguenti campi obbligatori sono stati lasciati vuoti o il loro contenuto non e\' valido.:\n'
	var passa=true
	var dtDal = ""
	var dtAl = ""
	campo=campo+'_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\n\t\t '
	for( i=0 ; i<len ; i++) {
		if (controlloDate){
			if(elemento.elements[i].name.indexOf('Dal')>0){
				 dtDal+= elemento.elements[i].value;
				 if(elemento.elements[i].name.indexOf('yyyy')<0){
					 dtDal+= '/' ;
				 }
			}
			if(elemento.elements[i].name.indexOf('Al')>0){
				 dtAl+= elemento.elements[i].value;
				 if(elemento.elements[i].name.indexOf('yyyy')<0){
					 dtAl+= '/' ;
				 }
			}
		}
		if (elemento.elements[i].name.length > 0){
			if (elemento.elements[i].name.indexOf(obbligatorio)>0 & elemento.elements[i].value.length<=0 ) {
				campo=campo+' # '+elemento.elements[i].title+' # \n\n\t\t '
				passa=false
			} else if (elemento.elements[i].name.indexOf(campo_mail)>0 & !checkMail(elemento.elements[i].value)) {
				campo=campo+' # '+elemento.elements[i].title+' # \n\n\t\t '
				passa=false
			} else if (elemento.elements[i].name.indexOf(campoPrivacy)>0 & !elemento.elements[i].checked) {
				campo=campo+' # '+elemento.elements[i].title+' # \n\n\t\t '
				passa=false
			} else {
				if (elemento.elements[i].name.indexOf(campo_numero)>0 & isNaN(elemento.elements[i].value.replace(',','.')) & elemento.elements[i].value.length > 0) {
					campo=campo+' # '+elemento.elements[i].title+' # \n\n\t\t '
					passa=false
				}
			}
		}
	}
	if (controlloDate){
		if (isDate(dtDal) && isDate(dtAl)){
			//alert(convdate(dtDal) + '\n' + convdate(dtAl))
			if(convdate(dtDal)>convdate(dtAl)){
				campo=campo+' # La data di inizio deve essere minore di quella di fine # \n\n\t\t '
				passa=false
			}
		}else{
			if (!isDate(dtDal)){
				campo=campo+' # Devi inserire una data di inizio valida # \n\n\t\t '
				passa=false
			}
			if (!isDate(dtAl)){
				campo=campo+' # Devi inserire una data di fine valida # \n\n\t\t '
				passa=false
			}
		}
	}
	campo=campo+'\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ '
	if (passa){
		controlla=true;
		return true;
	}else{ 
		alert(campo)
		return false;
	}
}

var initI=0
function scrollMenu() {
	var boxTop=document.getElementById('divScroll')
	if (boxTop!=undefined && boxTop!=null){
		if (document.body.scrollTop-274>0) {
			posizione=Math.floor((initI+((document.body.scrollTop-274)))/2)
			boxTop.style.marginTop = posizione
			initI=posizione
		} else {
			boxTop.style.marginTop = 0
			initI=0
		}
	}
}

var quanti_elem=0
function apri_chiudi(oggetto,text) {
	if (oggetto.style.display=="none") {
		oggetto.style.display="";
		text.style.color="#bc1220";
	} else {
		oggetto.style.display="none";
		text.style.color="";
	}
}
function chiudi_tutti(k) {
	for (i=0;i<k;i++) {
		apri_chiudi(document.getElementById("descr"+i),document.getElementById("text"+i))
	}
}


//------------------------------------------------------------------------------


function cambiaSfondi(quale){
	var qualeSfondo = "";
	if (quale=="1"){
		qualeSfondo = "2";
	}else{
		qualeSfondo = "1";
	}
	document.getElementById('mainBody'+quale).style.background='url(css/img/bgSfumo'+qualeSfondo+'.png)';
	document.getElementById('menu'+quale).style.background='url(css/img/bgMenu'+qualeSfondo+'.png)';
	document.getElementById('footer'+quale).style.background='url(css/img/bgFooter'+qualeSfondo+'.png)';
}

function cambiaImmagineNome(origine){
	var orig =  document.getElementById(origine);
	var origAlt = orig.alt
	var origTitle = orig.title
	var newOrig = orig.src.replace('/min/','/max/')
	var dest = document.getElementById("Dett_image");
	Effect.Appear('Dett_image');
	var oldDest = dest.src.replace('/max/','/min/')
	var oldAlt = dest.alt
	var oldTitle = dest.title
	dest.src = newOrig;
	dest.alt = origAlt;
	dest.title = origTitle;
	orig.src = oldDest;
	orig.alt = oldAlt;
	orig.title = oldTitle;
}

function viewdiv(text1,div1,text2,div2) {
	document.getElementById(text1).style.display="none";
	document.getElementById(div1).style.display="none";
	document.getElementById(text2).style.display="";
	document.getElementById(div2).style.display="";
}

function cambiaImmagine(origine,id,type,cambiaDa,cambiaA){
	if(cambiaDa==undefined){
		cambiaDa = "min";
	}
	if(cambiaA==undefined){
		cambiaA = "max";
	}
	var orig =  document.getElementById(origine);
	var origAlt = orig.alt
	var origTitle = orig.title
	var newOrig = orig.src.replace('/'+ cambiaDa +'/','/'+ cambiaA +'/')
	var dest = document.getElementById("Dett_image");
	var oldDest = orig.src.replace('/'+ cambiaA +'/','/'+ cambiaDa +'/')
	
	var oldAlt = dest.alt
	var oldTitle = dest.title
	dest.src = newOrig;
	dest.alt = origAlt;
	dest.title = origTitle;
	orig.src = oldDest;
	orig.alt = oldAlt;
	orig.title = oldTitle;
	
	
	
	var elem = document.getElementsByClassName('image')
	for (i=0;i<elem.length;i++){
		if (elem[i].id==id){
			elem[i].style.background='url(css/img/bgimgsel.gif)';
		}else{
			elem[i].style.background='url(css/img/bgimg.gif)';
		}
	}
}

function loadPage(qualeDiv,para,alCompletamento){
	var ele = $(qualeDiv);
	new Ajax.Updater(qualeDiv, 'includes/viewmenu.asp?'+para ,
						{
							asynchronous:true,
							evalScripts:true,
							encoding:'UTF-8',
							onComplete:alCompletamento
						}
					);
}


function Viewmenu(var1,id,i,funz) {
	var elem = document.getElementsByClassName('vocemenu')
	for (i=0;i<elem.length;i++){
		if (elem[i].id==var1){
			elem[i].firstChild.className= 'sel';
			
			var ele = document.getElementById('Vedimenu'+i);
			if (ele.style.display=='none'){
				ele.style.display='';
			}else{
				ele.style.display='none';
				new Ajax.Updater('Pagina', 'includes/viewmenu.asp?idmenu2='+id,{asynchronous:true});
			}
			document.getElementById('Vedimenu'+i).style.display='';
			if (funz!=undefined) {
				cambiamenuli(funz);
			}
		}else{
			elem[i].firstChild.className= '';
			document.getElementById('Vedimenu'+i).style.display='none';
		}
	}
}

function cambiamenu(id,i){
	var elem = document.getElementsByClassName('vocemenu')
	for (i=0;i<elem.length;i++){
		if (elem[i].id==id){
			elem[i].firstChild.className= 'sel';
		}else{
			elem[i].firstChild.className= '';
			var elemento = document.getElementsByClassName('contmenu')
			for (j=0;j<elemento.length;j++){
				if (elemento[j].id!=id){
					elemento[j].style.display='none';
				}
			}
		}
	}
}

function cambiamenuli(id){
	var elem = document.getElementsByClassName('voceli')
	for (i=0;i<elem.length;i++){
		if (elem[i].id==id){
			elem[i].firstChild.className= 'selezionato';
		}else{
			elem[i].firstChild.className= '';
		}
	}
}


function loadBlog(DivBlog,para,id,vocemenu){
	var elem = document.getElementsByClassName(vocemenu)
	if (id>0){
		for (i=0;i<elem.length;i++){
			if (elem[i].id==id){
				elem[i].firstChild.className= 'selezionato';
			}else{
				elem[i].firstChild.className= '';
			}
		}
		if (vocemenu=='datacal') {
			var elem = document.getElementsByClassName('voceli')
			for (i=0;i<elem.length;i++){
				elem[i].firstChild.className= '';
			}
		} else if (vocemenu=='voceli') {
			var elem = document.getElementsByClassName('datacal')
			for (i=0;i<elem.length;i++){
				elem[i].firstChild.className= '';
			}
		} else {
			var elem = document.getElementsByClassName('voceli')
			for (i=0;i<elem.length;i++){
				elem[i].firstChild.className= '';
			}
			var elem = document.getElementsByClassName('datacal')
			for (i=0;i<elem.length;i++){
				elem[i].firstChild.className= '';
			}
		}
	}
	var ele = $(DivBlog);
	ele.style.display='';
	new Ajax.Updater(DivBlog, 'includes/caricablog.asp?'+para,
		{
			asynchronous:true,
			evalScripts:true,
			encoding:'UTF-8'
		}
	);
}

function loadAgent(qualeDiv,para,id,alCompletamento){
	var ele = $(qualeDiv);
	ele.innerHTML = '<div style="padding-bottom:3px;margin:auto;text-align:center;"><img src="css/img/indicator_blu.gif" alt="" width="16" height="16" border="0" align="absmiddle"></div>';
	ele.style.display='';
	var elem = document.getElementsByClassName('vocemenu')
	for (i=0;i<elem.length;i++){
		if (elem[i].id==id){
			elem[i].firstChild.className= 'sel';
		}else{
			elem[i].firstChild.className= '';
		}
	}
	new Ajax.Updater(qualeDiv, 'includes/caricaAgent.asp?'+para ,
						{
							asynchronous:true,
							evalScripts:true,
							encoding:'UTF-8',
							onComplete:alCompletamento
						}
					);
}

function loadAppl(qualeDiv,para,id,alCompletamento){
	var ele = $(qualeDiv);
	ele.innerHTML = '<div style="padding-bottom:3px;margin:auto;text-align:center;"><img src="css/img/indicator_blu.gif" alt="" width="16" height="16" border="0" align="absmiddle"></div>';
	ele.style.display='';
	var elem = document.getElementsByClassName('vocemenu')
	for (i=0;i<elem.length;i++){
		if (elem[i].id==id){
			elem[i].firstChild.className= 'sel';
		}else{
			elem[i].firstChild.className= '';
		}
	}
	new Ajax.Updater(qualeDiv, para ,
						{
							asynchronous:true,
							evalScripts:true,
							encoding:'UTF-8',
							onComplete:alCompletamento
						}
					);
}

function loadPhoto(qualeDiv,para,alCompletamento){
	//var ele = $(qualeDiv);
	//ele.innerHTML = '<div style="padding-bottom:3px;margin:auto;text-align:center;"><img src="css/img/indicator_blu.gif" alt="" width="16" height="16" border="0" align="absmiddle"></div>';
	//ele.style.display='';
	new Ajax.Updater(qualeDiv, 'includes/caricaPhoto.asp?'+para ,
						{
							asynchronous:true,
							evalScripts:true,
							encoding:'UTF-8',
							onComplete:alCompletamento
						}
					);
}

function loadImgdett(qualeDiv,para,alCompletamento){
	//var ele = $(qualeDiv);
	//ele.innerHTML = '<div style="padding-bottom:3px;margin:auto;text-align:center;"><img src="css/img/indicator_blu.gif" alt="" width="16" height="16" border="0" align="absmiddle"></div>';
	//ele.style.display='';
	new Ajax.Updater(qualeDiv, 'includes/vediphoto.asp?'+para ,
						{
							asynchronous:true,
							evalScripts:true,
							encoding:'UTF-8',
							onComplete:alCompletamento
						}
					);
}

function loadVideo(qualeDiv,para,id,alCompletamento){
	var ele = $(qualeDiv);
	ele.innerHTML = '<div style="padding-bottom:3px;margin:auto;text-align:center;"><img src="css/img/indicator_blu.gif" alt="" width="16" height="16" border="0" align="absmiddle"></div>';
	ele.style.display='';
	
	var elem = document.getElementsByClassName('image')
	for (i=0;i<elem.length;i++){
		if (elem[i].id==id){
			elem[i].style.background='url(css/img/bgimgsel.gif)';
		}else{
			elem[i].style.background='url(css/img/bgimg.gif)';
		}
	}
	
	new Ajax.Updater(qualeDiv, para ,
						{
							asynchronous:true,
							evalScripts:true,
							encoding:'UTF-8',
							onComplete:alCompletamento
						}
					);
}

function loadProduct(qualeDiv,para,alCompletamento){
	var ele = $(qualeDiv);
	ele.innerHTML = '<div style="padding-bottom:3px;margin:auto;text-align:center;"><img src="css/img/indicator_blu.gif" alt="" width="16" height="16" border="0" align="absmiddle"></div>';
	ele.style.display='';
	new Ajax.Updater(qualeDiv, 'includes/caricaProd.asp?'+para ,
						{
							asynchronous:true,
							evalScripts:true,
							encoding:'UTF-8',
							onComplete:alCompletamento
						}
					);
}
function loadFotoModello(qualeDiv,para,alCompletamento){
	var ele = $(qualeDiv);
	ele.innerHTML = '<div style="padding-bottom:3px;margin:auto;text-align:center;"><img src="css/img/indicator_blu.gif" alt="" width="16" height="16" border="0" align="absmiddle"></div>';
	ele.style.display='';
	new Ajax.Updater(qualeDiv, 'includes/azioniModello.asp?'+para ,
						{
							asynchronous:true,
							evalScripts:true,
							encoding:'UTF-8',
							onComplete:alCompletamento
						}
					);
}

function cercaModello(qualeDiv,ilForm,qualeInput,msgErrore){
	if(!isNaN($(qualeInput).value) && $(qualeInput).value.length>0){
		$(qualeDiv).innerHTML = '<div style="padding-bottom:3px;margin:auto;text-align:center;"><img src="css/img/indicator_blu.gif" alt="" width="16" height="16" border="0" align="absmiddle"></div>';
		new Ajax.Updater(qualeDiv, 'includes/azioniModello.asp', {
															asynchronous:true,
															evalScripts:true,
															parameters:Form.serialize(ilForm)
															}
						);
		return false;
	}else{
		alert(msgErrore)
	}
}

function RichiediInformazioni(qualeDiv,ilForm,qualePagina){
		$(qualeDiv).innerHTML = '<div style="padding-bottom:3px;margin:auto;text-align:center;"><img src="css/img/indicator_blu.gif" alt="" width="16" height="16" border="0" align="absmiddle"></div>';
		if(qualePagina==undefined){
			qualePagina = 'includes/richiediInfo.asp'
		}
		new Ajax.Updater(qualeDiv, qualePagina , {
															asynchronous:true,
															evalScripts:true,
															parameters:Form.serialize(ilForm)
															}
						);
		return false;
}

function Logaccess(qualeDiv,ilForm,qualePagina){
		$(qualeDiv).innerHTML = '<div style="padding-bottom:3px;margin:auto;text-align:center;"><img src="css/img/indicator_blu.gif" alt="" width="16" height="16" border="0" align="absmiddle"></div>';
		if(qualePagina==undefined){
			qualePagina = 'includes/login.asp'
		}
		new Ajax.Updater(qualeDiv, qualePagina , {
															asynchronous:true,
															evalScripts:true,
															parameters:Form.serialize(ilForm)
															}
						);
		return false;
}

function cambiaSfondoTab(nomeClasse,come){
	var ele = document.getElementsByClassName(nomeClasse)
	for(i=0;i<ele.length;i++){
		if (come){
			ele[i].style.color = '#EE334E';
		}else{
			ele[i].style.color = '#3B4DBC';
		}		
	}
}
function checkComponenti(quale,componente){
	var comp = $(componente)
	var sottoassieme = $('id_303_'+quale)
	var componenti = $("contenitore_"+quale).getElementsByTagName("input")
	var infoBox = $('infoBox')
	if((sottoassieme.checked && $('id_303_'+quale+'_ins') == undefined) || (!sottoassieme.checked && comp != undefined && comp.checked && $('id_303_'+quale+'_ins') == undefined)){
		var divSottoAssieme = document.createElement("h4")
		divSottoAssieme.setAttribute("id",'id_303_'+quale+'_ins')
		var cloneSottoAssieme = sottoassieme.parentNode.childNodes[1].cloneNode(false)
		divSottoAssieme.appendChild(cloneSottoAssieme)
		infoBox.appendChild(divSottoAssieme)
	}else if(!sottoassieme.checked && $('id_303_'+quale+'_ins') != undefined){
		infoBox.removeChild($('id_303_'+quale+'_ins'))
	}
	if (comp!=undefined){
		if (comp.checked){
			sottoassieme.checked = true;
			var clone = comp.parentNode.childNodes[2].cloneNode(false)
			//input per quantità
			var inputDescrizione = document.createElement("input")
			inputDescrizione.setAttribute("id", "quantita_" + quale + "_" + componente)
			inputDescrizione.setAttribute("name",componente)
			inputDescrizione.setAttribute("value", "1")
			//div descrizione
			var divDescr = document.createElement("h5")
			divDescr.setAttribute("id", "rich_" + quale + "_" + componente)
			//aggiungo il contenuto testuale al div contenitore
			divDescr.appendChild(clone)
			var spazio  = document.createTextNode(" ") 
			divDescr.appendChild(spazio)
			divDescr.appendChild(inputDescrizione)
			infoBox.appendChild(divDescr)
		}else{
			infoBox.removeChild($("rich_" + quale + "_" + componente))
		}
	}else{
		for (i=0;i<componenti.length;i++){
			if(sottoassieme.checked){
				componenti[i].checked = true;
				if($("rich_" + quale + "_" + componenti[i].id)==undefined && componenti[i].id != 'id_303_'+quale){
					var clone = componenti[i].parentNode.childNodes[2].cloneNode(false)
					//div descrizione
					var divDescr = document.createElement("h5")
					divDescr.setAttribute("id", "rich_" + quale + "_" + componenti[i].id)
					var inputDescrizione = document.createElement("input")
					inputDescrizione.setAttribute("id", "quantita_" + quale + "_" + componenti[i].id)
					inputDescrizione.setAttribute("name",componenti[i].id)
					inputDescrizione.setAttribute("value", "1")
					divDescr.appendChild(clone)
					var spazio  = document.createTextNode(" ") 
					divDescr.appendChild(spazio)
					divDescr.appendChild(inputDescrizione)
					infoBox.appendChild(divDescr)
				}
			}else{
				componenti[i].checked = false;
				if($("rich_" + quale + "_" + componenti[i].id)!=undefined){
					infoBox.removeChild($("rich_" + quale + "_" + componenti[i].id))
				}
			}
		}
	}
}
function ActionAreaRiservata(qualeDiv,ilForm,qualePagina){
		$(qualeDiv).innerHTML = '<div style="padding-bottom:3px;margin:auto;text-align:center;"><img src="css/img/indicator_blu.gif" alt="" width="16" height="16" border="0" align="absmiddle"></div>';
		new Ajax.Updater(qualeDiv, qualePagina , {
															asynchronous:true,
															evalScripts:true,
															parameters:Form.serialize(ilForm)
															}
						);
		return false;
}
function markRead(qualeDiv,qualePagina){
		var ele = $(qualeDiv);
		ele.show();
		ele.innerHTML = '<div style="padding-bottom:3px;margin:auto;text-align:center;"><img src="css/img/indicator_blu.gif" alt="" width="16" height="16" border="0" align="absmiddle"></div>';
		new Ajax.Updater(qualeDiv, qualePagina , {
															asynchronous:true,
															evalScripts:true
															}
						);
}

function Infodett(qualeDiv,para,alCompletamento){
	var ele = $(qualeDiv);
	ele.style.marginTop= document.body.scrollTop-50;
	//ele.style.display='';
	new Ajax.Updater(qualeDiv, 'includes/scheda.asp?'+para ,
						{
							asynchronous:true,
							evalScripts:true,
							encoding:'UTF-8',
							onComplete:alCompletamento
						}
					);
}
function AddCarrello(qualeDiv,ilForm,qualePagina,alCompletamento){
	$(qualeDiv).innerHTML = '<div style="padding-bottom:3px;margin:auto;text-align:center;"><img src="css/img/indicator_blu.gif" alt="" width="16" height="16" border="0" align="absmiddle"></div>';
	new Ajax.Updater(qualeDiv, qualePagina , {
															asynchronous:true,
															evalScripts:true,
															parameters:Form.serialize(ilForm),
															onComplete: alCompletamento
															}
									);
}
function DelCarrello(qualeDiv,Viewtesto,para,alCompletamento){
	if (confirm(Viewtesto)) {
		$(qualeDiv).innerHTML = '<div style="padding-bottom:3px;margin:auto;text-align:center;"><img src="css/img/indicator_blu.gif" alt="" width="16" height="16" border="0" align="absmiddle"></div>';
		new Ajax.Updater(qualeDiv, 'includes/del.asp?'+para ,
							{
								asynchronous:true,
								evalScripts:true,
								encoding:'UTF-8',
								onComplete:alCompletamento
							}
						);
	}
}
function InviaCarr(qualeDiv,ilForm,qualePagina){
		$(qualeDiv).innerHTML = '<div style="padding-bottom:3px;margin:auto;text-align:center;"><img src="css/img/indicator_blu.gif" alt="" width="16" height="16" border="0" align="absmiddle"></div>';
		new Ajax.Updater(qualeDiv, qualePagina , {
															asynchronous:true,
															evalScripts:true,
															parameters:Form.serialize(ilForm)
															}
						);
}

var initI=0
function DivScroll(qualeDiv) {
	var boxTop=$(qualeDiv);
	if (document.body.scrollTop-320>0) {
		posizione=Math.floor((initI+((document.body.scrollTop-320)))/2);
		boxTop.style.marginTop = posizione;
		initI=posizione;
	} else {
		boxTop.style.marginTop = 25;
	}
}

function scrolla(quale){
	var posPrec = $('allNews').style.top;
	var posizione = (parseInt(quale) - 1) * 340;

	posDefinitiva = -posizione - parseInt(posPrec);
	
	new Effect.Move('allNews', {
	  x: 0, y: posDefinitiva, mode: 'relative', duration: 0.5,
	  transition: Effect.Transitions.spring
	});
	initSlide=quale;
}

function giraNews(quanti){
	scrolla(initSlide);
	if (initSlide==quanti){
		initSlide = 1
	}else{
		initSlide ++;
	} 
}

function startStopTimer(){
	var oggetto = document.getElementById('imgStr');
	if (stop==0){
		clearTimeout(timerID);
		stop=1;
		oggetto.style.background = "url(/css/img/load.gif) no-repeat";
	}else{ 
		setTimeout("timerID=setInterval('giraNews(5)',3000)",3000); 
		stop=0;
		oggetto.style.background = "url(/css/img/pause.gif) no-repeat";
	}
}

//-->
