
var isNS4=document.layers?true:false;
var isIE=document.all?true:false;
var isNS6=!isIE&&document.getElementById?true:false;
var isDOM = (document.getElementById) ? true : false;

function login() {
	//l ff377aff39a9345a9cca803fb5c5c081
	//p a7edacc0da42f1ff014d5c814d3f7318
	
	//l 1cba77c39b4d0a81024a7aada3655a28
	//p 3f744f62b881f96aa1764fcb7306f4ee
	  	
	
	if( (hex_md5($F('login'))=='ff377aff39a9345a9cca803fb5c5c081' && hex_md5($F('psw'))=='a7edacc0da42f1ff014d5c814d3f7318') || (hex_md5($F('login'))=='1cba77c39b4d0a81024a7aada3655a28' && hex_md5($F('psw'))=='3f744f62b881f96aa1764fcb7306f4ee') ){
		//alert('ok')
	}else{
		$('msg').innerHTML="Login e/o password errate!";
		return false;
	}


	$('restricted_over').hide();
	$('restricted_login').hide();	

}

function loadData(s,dove){
   
   if(!dove) dove='mainContent';
   
   var pars = 'pag='+s;
	
   var myAjax = new Ajax.Updater( 
      dove, 
      'index.php', { 
            method: 'get', 
            parameters: pars
            }
   );
}

function zoomSWF(btn,swf){

	h='<div id="zoomSWF">zoomSWF</div>';
	win = new Ext.Window({
	    layout:'fit',
	    width:520,
	    height:340,
	    //closeAction:'hide',
	    //plain: true,
	    //modal:true,
		 html:h
	});	
	
	win.on('show',function(){
		
		var flashvars = {
			path:'/gui/swf/'
		};
		var params = {
			menu: "false",
			quality: "high"
		};
		var attributes = {
		};
		if(swf=='disenia'){
			win.setSize(542,415);
			swfobject.embedSWF("gui/swf/"+swf+".swf", 'zoomSWF', "530", "380", "7.0.0",false, flashvars, params, attributes);			
		}else
			swfobject.embedSWF("gui/swf/"+swf+".swf", 'zoomSWF', "507", "304", "6.0.0",false, flashvars, params, attributes);			
	})

	win.show(btn);
}
function on_load(){
	//sostituisce sfondo ######################################################################################################
	var pag=$('flashBckContent').innerHTML;
	
	//hack per l'home
	if(pag==0) pag=6;
	//--------------
	
	var flashvars = {
		pagina:pag
	};
	var params = {
		menu: "false",
		quality: "high",
		wmode: "transparent"
	};
	var attributes = {
		style:"width: 100%; height: 100%;z-index:1;position:absolute;top:0px;left:0px;"
	};
	swfobject.embedSWF("/gui/swf/sfondo.swf", 'flashBckContent', "100%", "100%", "6.0.0",false, flashvars, params, attributes);
	//#######################################################################################################################
	
	//sostituisce H1 ######################################################################################################
	var h1=$$('h1');
	
	for(var i=0;i<h1.length;i++){
		var ele=h1[i];
		var flashvars = {
			colore:ele.id,
			size:'20',
			titolo:ele.innerHTML
		};
		var params = {
			menu: "false",
			quality: "high",
			wmode: "transparent",
			salign: "rt"
		};
		var attributes = {};
		ele.id='h1_'+i;
		swfobject.embedSWF("/gui/swf/h1.swf", ('h1_'+i), "550", "50", "6.0.0",false, flashvars, params, attributes);
		//alert(299)
	}
	//#######################################################################################################################		

	//se reg in cache apro il menu ##########
	//alert('htm: '+htm)
	if(htm!=''){
		//alert(htm)
		showSM(htm,false);
	}else{
		var tm=readCookie('tm');
		if(tm!='') showSM(tm,false);		
	}
	//########################################
	
	//sostituisce H2 ######################################################################################################
	var h2=$$('h2');
	
	for(var i=0;i<h2.length;i++){
		var ele=h2[i];
		var flashvars = {
			colore:ele.id,
			size:'35',
			titolo:ele.innerHTML
		};
		var params = {
			menu: "false",
			quality: "high",
			wmode: "transparent",
			salign: "rt"
		};
		var attributes = {};
		ele.id='h2_'+i;
		swfobject.embedSWF("/gui/swf/test.swf", ('h2_'+i), "235", "30", "6.0.0",false, flashvars, params, attributes);
	}
	//#######################################################################################################################		
	
	//sostituisce video prodotti ######################################################################################################
	if($('videoProd')){
		var flashvars = {};
		var params = {
			menu: "false",
			quality: "high",
			wmode: "transparent",
			bgcolor: "#000000"
		};
		var attributes = {};
		
		var src=$('videoProd').innerHTML;
		src=src.toLowerCase();
		//src=src+'_banner_it';
		//alert(src)
		swfobject.embedSWF("/gui/swf/"+src+".swf", 'videoProd', "302", "188", "6.0.0",false, flashvars, params, attributes);		
	}
	//#######################################################################################################################	
	
	// gestione del footer #################################################################################################
	on_resize();
	//#####################################################################################################################
}
function on_resize(){
	
	//return;
	var h=document.viewport.getHeight();
	var coo=$('footer').viewportOffset();
	//$('footer').innerHTML=h+'<br><span style="color:#fff">'+coo.top+'</span>';
	
	var nh=(h-coo.top);
	
	if(nh>0){
		$('footer').style.height=nh+'px';
	}else{
		//$('footer').style.height='100px';
		//$('footer').innerHTML+='<div style="color:#fff;">h:'+h+' | coo:'+coo.top+' | nh:'+nh+'</div>';
	}
	
	if(coo.top>h){
		$('flashBckContent').style.height=(coo.top)+'px';
	}	
	
	//$('footer').innerHTML+='<div style="color:#fff;">h:'+h+' | coo:'+coo.top+' | nh:'+nh+'</div>';
}	

function showSM(selM,fx){
	//alert(selM)
	if(selM == undefined || selM<=0 ) return;
	
	var subMenus=$$('div.topMenu2');
	
	for (var i = 0; i < subMenus.length; i++) {
		var menu=subMenus[i];
		menu.hide();
   }
	
	//alert(fx)
	if(fx)
		Effect.SlideDown('m'+selM,{ duration: .3 });
	else{
		//alert($('m'+selM))
		$('m'+selM).show();
	}
		
	
	setCookie('tm',selM,1,'');
}

function showLang(){
	$('language').toggle();
	//Effect.SlideDown('language',{ duration: .3 });
}
function addFlash(titolo,colore,div){
	var flashvars = {
	};
	var params = {
		menu: "false",
		quality: "high",
		wmode: "transparent",
		salign: "rt",
		flashvars: "&colore="+colore+"&size=70&titolo="+titolo
	};
	var attributes = {};
	swfobject.embedSWF("gui/swf/test.swf", div, "235", "200", "6.0.0",false, flashvars, params, attributes);
}

function natale(){
	var mD = new Date();
	//alert(mD.getDate() + "/" + (mD.getMonth()+1) + "/" + mD.getFullYear()) 
	if(mD.getFullYear()>2008) return;
	
	var mw=window.open('','Natale2008','height=520,width=690,scrollbars=no,resizable=false');
	if (mw.focus) {mw.focus()}
  	
	
	var c='<html><head><title>Popup</title>'+
		'</head><body style="margin:0;padding:0;">' +
		'<img src="gui/images/natale_idea.jpg"/>' +
		
		'</body></html>';
	
	mw.document.write(c);
	mw.document.close();
}

function delcheck(){
	if(window.confirm("Deleting selected record. Are you sure?"))
		return true;
	else
		return false;
}

function checkMail(src) {
	var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
	var regex = new RegExp(emailReg);
	return regex.test(src);
}

function aggiorna(){
	location.reload(true);
}

function vaia(url){
    if (isIE){
		document.URL=url;
	}else{
		window.location=url;
	}
}


//gestione blocchi --------------------------------------------
var hasCookies = false;

// tests whether the user accepts cookies, and sets a flag.
if(document.cookie == '') {
	document.cookie = 'hasCookies=yes';
	if (document.cookie.indexOf('hasCookies=yes') != -1) hasCookies = true;
}
else hasCookies = true;

function blockState(divID) {
	var theCookie = readCookie(divID);
	var state="e";
	if ((theCookie == "e") || (theCookie == "")) {
		state="c";
	}
	setCookie(divID,state,'Wed 01 Jan 2020 00:00:00 GMT','/');
	return state;
}

// reads a cookie from the browser
function readCookie(name) {
	if (document.cookie == '') return '';
	else {
		var firstChar, lastChar;
		var theBigCookie = document.cookie;
		firstChar = theBigCookie.indexOf(name);
		if (firstChar != -1) {
			firstChar += name.length + 1;
			lastChar = theBigCookie.indexOf(';', firstChar);
			if (lastChar == -1) lastChar = theBigCookie.length;
			return unescape(theBigCookie.substring(firstChar, lastChar));
		}
	else return '';
	}
}

// sets a cookie in the browser.
function setCookie (name, value, hours, path) {
	if (hasCookies) {
	if(hours) {
		if ( (typeof(hours) == 'string') && Date.parse(hours) ) var numHours = hours;
		else if (typeof(hours) == 'number') var numHours = (new Date((new Date()).getTime() + hours*3600000)).toGMTString();
	}
	document.cookie = name + '=' + escape(value) + ((numHours)?(';expires=' + numHours):'') + ((path)?';path=' + path:'');
	}
}

//FINE gestione blocchi --------------------------------------------

function checkForm(f,lang){
	
	
	var error="";
	var msg = new Array('it','en','fr');
	msg['it']=new Array(
		"Nome non presente\n",										/*0*/
		"Cognome non presente\n",									/*1*/
		"Indirizzo non presente\n",									/*2*/
		"CAP non presente\n",										/*3*/	
		"Provincia non presente\n",									/*4*/	
		"E-mail non presente o errata\n",							/*5*/
		"Privacy non accettata\n",									/*6*/
		"Form non corretta a causa dei seguenti errori:\n",			/*7*/
		"Prego correggere gli errori e riprovare!\n",				/*8*/
		"CV non presente\n",										/*9*/
		"Citta' non presente\n");									/*10*/
	msg['en']=new Array(
		"Name not present\n",										/*0*/
		"Surname not present\n",									/*1*/
		"Address not present\n",									/*2*/
		"CAP not present\n",										/*3*/
		'',															/*4*/
		"E-mail not present or wrong\n",							/*5*/
		"Privacy conditions not accepted\n",						/*6*/		
		"Form uncorrect due the following errors:\n",				/*7*/
		"Please Correct errors and try again!",						/*8*/
		"CV not present\n",											/*9*/
		"City not present\n");										/*10*/	
	msg['fr']=new Array(
		"Name not present\n",										/*0*/
		"Surname not present\n",									/*1*/
		"Address not present\n",									/*2*/
		"CAP not present\n",										/*3*/
		'',															/*4*/
		"E-mail not present or wrong\n",							/*5*/
		"Privacy conditions not accepted\n",						/*6*/		
		"Form uncorrect due the following errors:\n",				/*7*/
		"Please Correct errors and try again!",						/*8*/
		"CV not present\n",											/*9*/
		"City not present\n");										/*10*/
	
	
	
	//alert(f.id)
	switch(f.id){
		case 'newsletter_form':
			if( f.f_Mail.value=='' || f.f_Mail.value==null || !checkMail(f.f_Mail.value) ) error += " - " + msg[lang][5];	
			if ( !f.f_privacy.checked ) error += " - " + msg[lang][6];			
			break;
		default:
			for(var i=0; i< f.length; i++){
				var e=f.elements[i];
				
				if (e.name=="f_Nome")
					if ( (e.value==null ) || (e.value=='') ) error += " - " + msg[lang][0];
				if (e.name=="f_Cognome")
					if ( (e.value==null ) || (e.value=='') ) error += " - " + msg[lang][1];
				if (e.name=="f_Indirizzo")
					if ( (e.value==null ) || (e.value=='') ) error += " - " + msg[lang][2];
				if (e.name=="f_CAP")
					if ( (e.value==null ) || (e.value=='') ) error += " - " + msg[lang][3];
				if (e.name=="f_Provincia")
					if ( (e.value==null ) || (e.value=='') ) error += " - " + msg[lang][4];
				if (e.name=="f_Citta")
					if ( (e.value==null ) || (e.value=='') ) error += " - " + msg[lang][10];
				if (e.name=="f_CV")
					if ( (e.value==null ) || (e.value=='') ) error += " - " + msg[lang][9];
		
				if (e.name=="f_Mail")
					if ((e.value==null ) || (e.value=="") || !checkMail(e.value)) error += " - " + msg[lang][5];
				if (e.name=="f_privacy")
					if ( !e.checked ) error += " - " + msg[lang][6];
			}		
	}
	

	//alert(error);return false;
	if (error!=''){
// 		alert (error!='' && head!='');
		var s=msg[lang][7];
		s +=error;
		s +="\n" + msg[lang][8];
		alert(s);
		return false;
	}else{
		return true;
	}
}

function checkNumber(f,e){
	var code = (window.Event) ? e.which : e.keyCode;
	var myD = $("f_MaxAmount2");
	

	n=f.value;
	if(  (code<47 || code>58) && (code<36 || code>41) &&  (code<15 || code>21) &&  (code<32 || code>36) && code!=0 && code!=13 && code!=8 && code!=45 && code!=27 && code!=46 &&  (code<111 || code>124)){
		
		if (code==190){
			punto=n.lastIndexOf(".") - n.indexOf(".");
			if(punto>0)
				n=n.substr(0,n.length-1)
		}else if (code==188){	
			punto=n.indexOf(".");
// 			alert(", p:"+punto)
			if(punto>0)
				n=n.substr(0,n.length-1)
			else
				n=n.replace(/,/,".");
// 		}else if (  (code>=37 || code<=40) || code==13 || code==8 || code==46        ){
			// 37-40 frecce
			// 13 invio
			// 8 del
			// 46 canc
		}else{
			n=n.substr(0,n.length-1)
// 			myD.value+="-"+code;
		}
		
	}
	f.value=n;
}

function img_over(img) { 
	if( typeof img  == 'object' )
		img=img;
	else
		img=$(img);
	

	if(img == null) return;
	
	//alert(img)
	
	src=img.src;
	if(src.substr(src.length-6,2)=='_o')
	  return;
	  
	est=src.substring(src.length-4);
	src=src.substring(0,(src.length-4)) + '_o'+est;
	
	img.src=src;
}
function img_out(img) {
	if( typeof img  == 'object' )
		img=img;
	else
		img=$(img);
		
	if(!img) return;
	//alert(img.src)
	//return;
	src=img.src;
	est=src.substring(src.length-4);
	src=src.substring(0,(src.length-6)) + est;
// 	alert(src)
	img.src=src;
}

function show_zoom(img) {
	
	//rendo visibile lo sfondo semitrasparente
	var zoom=$('zoom');
	zoom.style.visibility='visible'
		
	var zoom_img=$('zoom_img');
	var s='<div style="position:absolute;top:2px;right:2px;">';
   s += '<a href="#" onclick="hide_zoom();"><img src="gui/images/btnClose.gif" border="0"/></a>';
   s += '</div>';
	s += '<img src="'+img +'&h=490&q=95&fltr[]=usm"/>';
   zoom_img.innerHTML = s;
}

function hide_zoom() { 
	var zoom=$('zoom');
	zoom.style.visibility='hidden';
}

function setSpot(n,lang) {
	img=$('multimedia_spot');

	if(img==null) return;
	
	img.src='gui/images/mmedia'+n+'_2_'+lang+'.gif';
}

function topMenu(n) {
	img=$('multimedia_spot');

	if(img==null) return;
	
	img.src='/gui/images/mmedia'+n+'_2.gif';
}

function showFiniture(btn) {
	switch(lang){
		case 'it':
			var tit='Finiture';
         var lingua=1;
         break;
		case 'en':
         var tit='finiture';
			var lingua=2;
         break;
		case 'fr':
			var tit='finiture';
         var lingua=3;
         break;         
		default:
			var lingua=1;
	}

	var color=new Array();
	color[1]=new Array("#FFFFFF",'Bianco','Matt white','Blanc mat')
	color[2]=new Array("#F4F3E1",'Panna','Cream white','Blanc cr&#232;me')
	color[3]=new Array("#ECE9BD",'Avorio','Ivory','Ivoire')
	color[4]=new Array("#DAF5FE",'Celeste','Light-blue','Azur claire')
	color[5]=new Array("#435AA9",'Bluette','Bluette','Bluette')
	color[6]=new Array("#FF0000",'Rosso schumy','Schumy red','Rouge schumy')
	color[7]=new Array("#D2D5D2",'Grigio cenere','Ash grey','Gris c&#232;nise')
	color[8]=new Array("#F32621",'Rosso bruno','Dark red','Rouge fonc&#232;')
	color[9]=new Array("#3F4340",'Grigio traffico','Dark grey','Gris fonc&#232;')
	color[10]=new Array("#C5B185",'Cappuccino','Kapuccino','Kapuccino')
	color[11]=new Array("#E85E0B",'Rosso arancio','Orange red','Rouge orange')
	color[12]=new Array("#C61800",'Rosso corallo','Coral red','Rouge Coral')
	color[13]=new Array("#400000",'Tortora','Dove grey','Gris tourtourelle')
	color[14]=new Array("bitmap",'Noce','Walnut','Noyer')
	color[15]=new Array("bitmap",'Ciliegio','Cherry','Cherry')
	color[16]=new Array("#FFFFFF",'Bianco lucido','Shiny white','Blanc brillant')
	color[17]=new Array("#DBDAC1",'Sahara 11','Sahara 11','Sahara 11')
	color[18]=new Array("#FEF3D3",'Avorio 12','Ivory 12','Ivoire 12')
	color[19]=new Array("#FFE791",'Giallo ananas 13','Pineapple yellow 13','Jaune ananas 13')
	color[20]=new Array("#FFE8C6",'Rosa francia 14','Francia pink 14','Rose France 14')
	color[21]=new Array("#FED1BC",'Rosa antico 15','Antique pink 15','Rose antique 15')
	color[22]=new Array("#FFBB77",'Albicocca 16','Apricot 16','Abricot 16')
	color[23]=new Array("#DCFED6",'Verde acquachiara 17','Watergreen 17','Vert d\'eau 17')
	color[24]=new Array("#8EE19D",'Verde lago 18','See green 18','Vert lacq 18')
	color[25]=new Array("#EEFB91",'Verde acido 19','Apple green 19','Vert pomme 19')
	color[26]=new Array("#D0EB7E",'Verde menta 20','Mint green 20','Vert mente 20')
	color[27]=new Array("#77A884",'Verde bosco 21','Wood green 21','Vert bois 21')
	color[28]=new Array("#D0FDE7",'Turchese 22','Turquoise 22','Turquoise 22')
	color[29]=new Array("#EBFEFA",'Celeste 23','Light-blue 23','Azur claire 23')
	color[30]=new Array("#074878",'Blu prussia 24','Prussia blue 24','Bleu Prusse 24')
	color[31]=new Array("#5A8DA0",'Blu oceano 25','Ocean blue 25','Bleu oc�an 25')
	color[32]=new Array("#0F66D0",'Blu elettrico 26','Elettriko blue 26','Bleu Elettrico 26')
	color[33]=new Array("#000000",'Nero 27','Black 27','Noir 27')
	color[34]=new Array("#C0C1BF",'Metallica 28','Metallika 28','Metallika 28')
	color[35]=new Array("#FFF3CE",'Bianco panna 29','Cream white 29','Blanc cr&#232;me 29')
	color[36]=new Array("#C8C8C8",'Alluminio 30','Aluminium 30','Aluminium 30')
	color[37]=new Array("#D5D6C0",'Grigio cenere 31','Ash grey 31','Gris c&#232;nise 31')
	color[38]=new Array("#FF8000",'Arancio 32','Orange 32','Orange 32')
	color[39]=new Array("#C60000",'Rubino 33','Ruby red 33','Rouge rubis 33')
	color[40]=new Array("#FF251A",'Rosso 34','Red 34','Rouge 34')
	color[41]=new Array("#F9E76A",'Giallo','Yellow','Jaune')
	color[42]=new Array("#074878",'Blu','Blue','Bleu')
	color[43]=new Array("#FFE8C6",'Rosa','Pink','Rose')
	color[44]=new Array("#DCFED6",'Verde','Green','Vert')
	color[45]=new Array("#000000",'Nero','Black','Noir')
	color[46]=new Array("bitmap",'Rovere','Oak','Chene')
	color[47]=new Array("bitmap",'Rosa spatolato','Spatula pink','Rose spatul&#232;')
	color[48]=new Array("bitmap",'Beige spatolato','Spatula beige','Beige spatul&#232;')
	color[49]=new Array("bitmap",'Azzurro spatolato','Spatula light-blue','Azur claire spatul&#232; ')
	color[50]=new Array("bitmap",'Grigio spatolato','Spatula Grey','Gris spatul&#232;')
	color[51]=new Array("#FFFFFF",'Bianco','White','Blanc')
	color[52]=new Array("bitmap",'Bianco','White','Blanc')
	color[53]=new Array("bitmap",'Celeste','Light-blue','Azur claire')
	color[54]=new Array("bitmap",'Grigio','Grey','Gris')
	color[55]=new Array("bitmap",'Rosso','Red','Rouge')
	color[56]=new Array("bitmap",'Nero','Black','Noir')
	color[57]=new Array("bitmap",'Weng&#232;','Weng&#232;','Weng&#232;')
	color[58]=new Array("#3F4138",'Grigio Londra','Grigio Londra','Grigio Londra')
	color[59]=new Array("#7E9A60",'Verde salvia','Verde salvia','Verde salvia')
	color[60]=new Array("#677D4F",'Verde ossido','Verde ossido','Verde ossido')
	color[61]=new Array("#3D2440",'Melanzana','Melanzana','Melanzana')
	color[62]=new Array("bitmap",'Ebano','Ebano','Ebano')
	
	color[63]=new Array("bitmap",'xxxxxx')
	color[64]=new Array("bitmap",'xxxxxx')
	color[65]=new Array("bitmap",'xxxxxx')
	color[66]=new Array("bitmap",'xxxxxx')
	color[67]=new Array("bitmap",'xxxxxx')
	color[68]=new Array("bitmap",'xxxxxx')
	
	var h='<div id="zoomF" style="background-color:#000;width:100%;height:100%;">..</div>';
	win = new Ext.Window({
		title:tit,
	    layout:'fit',
	    width:700,
	    height:340,
		 autoScroll:true,
	    //closeAction:'hide',
		 //style:'padding:10px;',
	    plain: true,
	    //modal:true,
		 html:h
	});
	var fusti=$('fusti').innerHTML;
	var ante=$('ante').innerHTML;
	var a=ante.split(",");
   // posizionamento e ridimensionameto di dett_finiture in funzione del numero di ante
   
	//alert(a.length)
   if(a.length < 3){
      win.setSize(700,150);
   }else if(a.length < 10){
      win.setSize(700,260);
   }else if(a.length < 19){
      win.setSize(700,460);
   }else if(a.length < 24){
      win.setSize(800,340);
   }else{
      win.setSize(700,400);
	}
	//win.setTitle(tit);
	// ---------------------	
	win.on('show',function(){

		var s='';	
		s +='<div style="position:absolute;top:8px;left:15px;color:#fff;font-weight:bold;font-size:12px;">';
	   switch(lingua){
	      case 1:
	         s +='ANTE';
	         break;
	      case 3:
	         s +='PORTE';
	         break;
	      default:
	         s +='DOORS';                  
	   }
	   s +='</div>';
	    
		s +='<div style="position:absolute;top:8px;left:390px;color:#fff;font-weight:bold;font-size:12px;">';
	   switch(lingua){
	      case 1:
	         s +='FUSTI';
	         break;
	      case 3:
	         s +='CAISSON';
	         break;
	      default:
	         s +='BODY';                  
	   }
	   s +='</div>';
    
		s +='<div style="position:absolute;top:30px;left:15px;width:48%;border:solid 0px #f00;">';
		var a=ante.split(",");
		for(var i=0;i<a.length;i++){
			s += '<div style="margin-bottom:3px;float:left;width:170px;color:#E6F0F6;font:normal 12px tahoma,Arial,sans-serif;text-align:left;">';
			
			if(color[parseInt(a[i])][0].substr(0,1)=='#')
				s +='<div style="float:left;width:28px;height:20px;border:solid 1px #cecece;background-color:' + color[parseInt(a[i])][0] + '"></div>';
			else
				s +='<div style="float:left;width:28px;height:20px;border:solid 1px #cecece;"><img src="gui/images/colori/'+parseInt(a[i])+'.gif" border="0" width="28" height="20" alt=""/></div>';
			s +='<span style="margin-left:10px;">' + color[parseInt(a[i])][lingua]+'</span></div>';
		}
		s +='</div>';
		
		s +='<div style="position:absolute;top:30px;left:390px;width:48%;border-left:solid 1px #cecece;padding-left:10px;">';
		
		var a=fusti.split(',');
		for(var i=0;i<a.length;i++){
			s += '<div style="margin-bottom:3px;float:left;width:170px;color:#E6F0F6;font:normal 12px tahoma,Arial,sans-serif;text-align:left;">';
			if(color[parseInt(a[i])][0].substr(0,1)=='#')
				s +='<div style="float:left;width:28px;height:20px;border:solid 1px #cecece;background-color:' + color[parseInt(a[i])][0] + '"></div>';
			else
				s +='<div style="float:left;width:28px;height:20px;border:solid 1px #cecece;"><img src="gui/images/colori/'+parseInt(a[i])+'.gif" border="0" width="28" height="20" border="0"/></div>';
			s +='<span style="margin-left:10px;">' + color[parseInt(a[i])][lingua]+'</div>';
		}
		s +='</div>';
		$('zoomF').innerHTML=s;		
	})
	win.show(btn);	
	
	

}
function hideFiniture() { 
	var zoom=$('finiture');
	zoom.style.visibility='hidden';
}

function Launch(page, width, height) { 
	OpenWin = this.open(page, "kirupa", "toolbar=no, menubar=no ,location=no, scrollbars=yes, resizable=yes, width=" + width + ", height=" + height + ", top=" + (screen.height/2 - height/2) + ", left=" + (screen.width/2 - width/2) + "\""); 
} 

function open_multimedia(name){
	if(name=='disenia')
		window.open('gui/swf/Disenia.html',name,'width=520,height=390');
	else
		window.open('gui/html/'+ name +'.html',name,'width=507,height=334');
}

function myPopup(n){
	var myw=window.open("", "pop");	
	myw.document.writeln('<html><body bgcolor="#000">');
	myw.document.writeln('<img src="'+n+'"/>');
	myw.document.writeln('</body></html>');	
	myw.document.close();
	
}	
function loadImg(n){
	
	if(!n || n==0) return;
	
	$('segnaposto').innerHTML='<img src="gui/images/loading.gif" style="margin-left:0px;margin-bottom:4px;">';
	
	myImg = new Image();
	myImg.src='/upload/repository/file_'+n;
	myImg.onload=function(){
		if(myImg.width > 270 || myImg.height > 270){
			var h='<a href="gui/include/image.php/articolo?width=900&amp;height=600&amp;image=/upload/repository/file_'+n+'" rel="lightbox[articolo]" >'
					+ '<img src="gui/include/image.php/articolo?width=270&amp;height=150&amp;cropratio=1:1&amp;image=/upload/repository/file_'+n+'" border="0" alt="" />'
				+ '</a>';
					
			$('segnaposto').innerHTML=h;	
		}else{
			$('segnaposto').innerHTML='<img src="/upload/repository//file_' + n + '" border="0" style="margin-left:0px;margin-bottom:4px;"/>';				
		}
		
		//alert('x')
	}
	
}
