<!--

// view preferences
var tag1 = 1;
var tag2 = 1;
var tag3 = 0;
var tag4 = 1;
var spans = document.getElementsByTagName("SPAN");

// initialization function for floating <ann> element
function init(){

	var scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		y = "window.pageYOffset + 25";
		x = "window.pageXOffset + document.documentElement.clientWidth - divfloat.clientWidth - 23";
	} else {
		y = "document.documentElement.scrollTop + 25";
		x = "document.documentElement.scrollLeft + document.documentElement.clientWidth - divfloat.clientWidth - 23";
	}

//	y = "document.documentElement.scrollTop + 25";
//	x = "document.documentElement.scrollLeft + document.documentElement.clientWidth - divfloat.clientWidth - 23";
	
	iniz();
}
// localization function for floating <ann> element
function loc(){
	y1=eval(y);x1=eval(x);
	
	if (y1 < 100) y1 = 100;
	
	y1 = y1 + "px";
	x1 = x1 + "px";
	
	divfloat.style.top = y1;
	divfloat.style.left = x1;
		
	setTimeout("loc()",20)
}
function iniz(){
	y1=eval(y);x1=eval(x);
}

function expandIt(){return}
function ei(){return}
function expandAll(){return}

isExpanded=false;

function initIt(){
	livelli = document.getElementsByTagName("DIV");
	for (i = 0; i < livelli.length; i++) {
		if (livelli[i].className == "child") {
			livelli[i].style.display="none";
			livelli[i].isExpanded=false;
		}
	}
}
function ei(el){
	expandIt(el);
}
function expandIt(el){
	if (!is_ok) return;
	var nome=el + "Child";
	var whichEl = document.getElementById(nome);
	if (whichEl.style.display == "none") {
		whichEl.style.display="block";
		whichEl.isExpanded=true;
	} else {
		whichEl.style.display="none";
		whichEl.isExpanded=false;
	}
}

function expandAll() {
	if (!is_ok) return;
	livelli=document.getElementsByTagName("DIV");
	for (i=0; i<livelli.length; i++) {
		if (livelli[i].className == "child") {
			livelli[i].style.display=(isExpanded)?"none":"block";
			livelli[i].isExpanded=(isExpanded)?false:true;
		}
	}
	isExpanded=!isExpanded;
}

function getCookie(cookie_name){
	if(document.cookie.length > 0){
		cookie_start = document.cookie.indexOf(cookie_name + "=");
		if (cookie_start != -1){
			cookie_start = cookie_start + cookie_name.length + 1;
			cookie_end=document.cookie.indexOf(";",cookie_start);
			if(cookie_end == -1) cookie_end = document.cookie.length;
			return unescape(document.cookie.substring(cookie_start, cookie_end));
		}
	}
	return "";
}

function prefs(){
	c_quot = getCookie("vis_quot");
	c_cat = getCookie("vis_cat");
	c_catb = getCookie("vis_catb");
	c_dett = getCookie("vis_dett");
	
	if(c_quot == "0") cambioQuot();
	if(c_cat == "0") cambioCat();
	if(c_catb == "1") cambioCatB();
	if(c_dett == "0") cambioDett();
}

//popup various
function vari(){
	var wtr = window.open("../../../indexes/adv1.htm","xtrp4t","toolbars=0, scrollbars=1, height=100, width=200, left=20, top=20");
	wtr.document.focus();
}

function cambioCat(){
	for (i=0;i<spans.length;i++){
	if (spans[i].className=="ct"){
	if (tag2) { spans[i].style.display="none";}
	else { spans[i].style.display="block";}}}
	tag2=(tag2)?0:1;
	var ctt = document.getElementById("cmbctt");
	if (tag2==1) ctt.innerHTML = '<a href="javascript:cambioCat()">Nascondi numeri di catalogo</a>';
	else ctt.innerHTML = '<a href="javascript:cambioCat()">Mostra numeri di catalogo</a>';
	
	document.cookie = "vis_cat="+tag2+";path=/cat;expires=" + dateobj.toGMTString();
}

function cambioCatB(){
	for (i=0;i<spans.length;i++){
	if (spans[i].className=="ca"){
	if (tag3) { spans[i].style.display="none";}
	else { spans[i].style.display="block";}}}
	tag3=(tag3)?0:1;
	var ctt = document.getElementById("cmbctt");
	if (tag3==1) ctt.innerHTML = '<a href="javascript:cambioCatB()">Nascondi numeri di catalogo</a>';
	else ctt.innerHTML = '<a href="javascript:cambioCatB()">Mostra numeri di catalogo</a>';

	document.cookie = "vis_catb="+tag3+";path=/cat;expires=" + dateobj.toGMTString();
	
}


function cambioDett(){
	for (i=0;i<spans.length;i++){
	if (spans[i].className=="in"){
	if (tag1) { spans[i].style.display="none";}
	else { spans[i].style.display="block";}}}
	tag1=(tag1)?0:1;
	var dtt = document.getElementById("cmbdtt");
	if (tag1==1) dtt.innerHTML = '<a href="javascript:cambioDett()">Nascondi dettagli</a>';
	else dtt.innerHTML = '<a href="javascript:cambioDett()">Mostra dettagli</a>';

	document.cookie = "vis_dett="+tag1+";path=/cat;expires=" + dateobj.toGMTString();

}

function cambioQuot(){
	for (i=0;i<spans.length;i++){
	if (spans[i].className=="qt"){
	if (tag4) { spans[i].style.display="none";}
	else { spans[i].style.display="block";}}}
	tag4=(tag4)?0:1;
	var ett = document.getElementById("cmbett");
	if (tag4==1) ett.innerHTML = '<a href="javascript:cambioQuot()">Nascondi quotazioni</a>';
	else ett.innerHTML = '<a href="javascript:cambioQuot()">Mostra quotazioni</a>';

	document.cookie = "vis_quot="+tag4+";path=/cat;expires=" + dateobj.toGMTString();
	
}

// elexpand, onclick load img
function pt(parziale){
	if (parziale == "tutto"){
	var coll_extra = document.getElementsByTagName("IMG");
	for (i=0; i<coll_extra.length; i++){
	if(coll_extra[i].className=="im") coll_extra[i].src = coll_extra[i].getAttribute('s');}}
	else{
	var coll_contenitore = document.getElementById ("el"+parziale+"Child");
	var coll_extra = coll_contenitore.getElementsByTagName("IMG");
	for (i=0; i<coll_extra.length; i++){
	if (coll_extra[i].className=="im") coll_extra[i].src = coll_extra[i].getAttribute('s')}}
}

function mostra_area(quale_area){
	
	for (i=1; i<=8; i++){                          
		a = document.getElementById('area'+i+'');    
		a.style.display = "none";		                 
	}                                              
	                                               
	if (quale_area) {                                   
		a = document.getElementById('area'+quale_area+'');
		a.style.display = "block";                   
	}
}                                              

function stristr (haystack, needle, bool) {
	var pos = 0;
 
	haystack += '';
	pos = haystack.toLowerCase().indexOf( (needle+'').toLowerCase() );    if (pos == -1){
		return false;
	}
	else{
		if (bool){
			return haystack.substr( 0, pos );
		}
		else{
			return haystack.slice( pos );
		}
	}
}
// if 1, show text and caption; if 0, show only title
function reset_inner_search(switch_status){
	s_title = document.getElementById("inner_search_title");
	s_text = document.getElementById("inner_search_text");
	s_caption = document.getElementById("inner_search_caption");
	if(switch_status == "1"){
		s_title.style.display = "none";
		s_text.style.display = "inline";
		s_text.focus();
	}
	else{
		do_search("");
		s_text.value = "";
		s_title.style.display = "block";
		s_text.style.display = "none";
		s_caption.style.display = "none";

	}
}
function do_search(ks){
	if(!is_ok) return;
	valid_ids = new Array();
	a = document.getElementsByTagName("span");
	for(i=0;i<a.length;i++){
		if((a[i].id.indexOf("dd")) != -1){
			if(!stristr(a[i].innerHTML, ks)){
				b = document.getElementById("p"+a[i].id);
				c = document.getElementById("el"+a[i].id.substr(2)+"Child");
				c.style.display = b.style.display = "none";
			}
			else valid_ids.push("p"+a[i].id);
		}
	}
	for(ii=0;ii<valid_ids.length;ii++){
		bb = document.getElementById(valid_ids[ii]);
		bb.style.display = "block";
	}
	reset_inner_search(1);
	if(ks){
		s_caption = document.getElementById("inner_search_caption");
		s_caption.style.display = "inline";
		s_caption.innerHTML = "Risultato della ricerca di: <span id='inner_act_words'>"+ks+"</span> (<a href='javascript:reset_inner_search(0)'>annulla</a>)";
	}
	
}
function inner_search(){
	if(!is_ok) return;
	a = document.getElementById("inner_search_text");
	do_search(a.value);
}

function focus_input(field){
	a = document.getElementsByName(field);
	a[0].focus();
}
//-->
