//---------------------------------------------AJAX---------------------------------------------
var ajax1 = assegnaXMLHttpRequest();
var ajax2 = assegnaXMLHttpRequest();
var ajax3 = assegnaXMLHttpRequest();
var ajax4 = assegnaXMLHttpRequest();
var ajax5 = assegnaXMLHttpRequest();
var ajax6 = assegnaXMLHttpRequest();
var ajax7 = assegnaXMLHttpRequest();
var readyState = Ajax_InitReadyState();
var statusText = Ajax_InitStatusText();
//---------------------------------------------AJAX---------------------------------------------

//---------------------------------------------VARIABILI---------------------------------------------
//------------------FORM------------------
var form_message01='Si sono verificati i seguenti errori';
var form_message02='deve contenere un indirizzo e-mail';
var form_message03='deve contenere un numero';
var form_message04='deve contenere un numero compreso tra';
var form_message05='e';
var form_message06='e\' richiesto';
var form_message07='deve essere una Partita Iva valida';
var form_message08='deve essere accettata';
var form_message09='devono essere uguali';
var form_message10='e\' richiesta';

var testoconfirm01='Procedere con la modifica dei dati?';

var NameDivError='helperror';
var NameDivError_Message='message';

//var form_nomedesc_work=new Array('usr01','usr02','usr03','usr04','usr05','usr06','usr07','usr08','usr09','usr10','usr11');
//------------------FORM------------------

//------------------MENU------------------
var listbutton_mainmenu=Array();
listbutton_mainmenu[0]=Array('img/bt_home_up.jpg','img/bt_home_down.jpg');
listbutton_mainmenu[1]=Array('img/bt_contattaci_up.jpg','img/bt_contattaci_down.jpg');
listbutton_mainmenu[2]=Array('img/bt_lavoraconnoi_up.jpg','img/bt_lavoraconnoi_down.jpg');
listbutton_mainmenu[3]=Array('img/bt_mappasito_up.jpg','img/bt_mappasito_down.jpg');
listbutton_mainmenu[4]=Array('img/bt_azienda_up.gif','img/bt_azienda_down.gif');
//listbutton_mainmenu[4]=Array('img/bt_dovesiamo_up.gif','img/bt_dovesiamo_down.gif');
listbutton_mainmenu[5]=Array('img/bt_prodotti_up.gif','img/bt_prodotti_down.gif');
listbutton_mainmenu[6]=Array('img/bt_retevendita_up.gif','img/bt_retevendita_down.gif');
listbutton_mainmenu[7]=Array('img/bt_centriassistenza_up.gif','img/bt_centriassistenza_down.gif');
listbutton_mainmenu[8]=Array('img/bt_news_up.gif','img/bt_news_down.gif');
listbutton_mainmenu[9]=Array('img/bt_link_up.gif','img/bt_link_down.gif');
listbutton_mainmenu[10]=Array('img/bt_stampa_up.gif','img/bt_stampa_down.gif');
listbutton_mainmenu[11]=Array('img/bt_download_up.gif','img/bt_download_down.gif');
listbutton_mainmenu[12]=Array('img/bt_preventivo_up.gif','img/bt_preventivo_down.gif');
listbutton_mainmenu[13]=Array('img/bt_areariservata_up.gif','img/bt_areariservata_down.gif');
listbutton_mainmenu[14]=Array('img/bt_areaprivata_up.gif','img/bt_areaprivata_down.gif');
listbutton_mainmenu[15]=Array('img/bt_offerte_up.gif','img/bt_offerte_down.gif');
listbutton_mainmenu[16]=Array();
listbutton_mainmenu[17]=Array();
listbutton_mainmenu[18]=Array();
listbutton_mainmenu[19]=Array();
listbutton_mainmenu[20]=Array();
listbutton_mainmenu[21]=Array();
listbutton_mainmenu[22]=Array();
listbutton_mainmenu[23]=Array();
listbutton_mainmenu[24]=Array();
listbutton_mainmenu[25]=Array();
listbutton_mainmenu[26]=Array();
listbutton_mainmenu[27]=Array('img/bt_dovesiamo_up.gif','img/bt_dovesiamo_down.gif');
listbutton_mainmenu[28]=Array('img/bt_referenze_up.gif','img/bt_referenze_down.gif');
listbutton_mainmenu[29]=Array('img/bt_certificazioni_up.gif','img/bt_certificazioni_down.gif');
listbutton_mainmenu[30]=Array('img/bt_privacy_up.gif','img/bt_privacy_down.gif');
listbutton_mainmenu[31]=Array('img/bt_team_up.gif','img/bt_team_down.gif');
//------------------MENU------------------

//------------------PAGE------------------
var ListPage_LoadMainMenu=Array('include_file/site_top.php');

var ListPage_LoadListPage=Array();
ListPage_LoadListPage[0]='include_file/start.php';
ListPage_LoadListPage[1]='include_file/contattaci.php';
ListPage_LoadListPage[2]='include_file/lavoraconnoi.php';
ListPage_LoadListPage[3]='include_file/mappasito.php';
ListPage_LoadListPage[4]='include_file/mission.php';
//ListPage_LoadListPage[4]='include_file/dovesiamo.php';
ListPage_LoadListPage[5]='include_file/prodotti.php';
ListPage_LoadListPage[6]='include_file/retevendita.php';
ListPage_LoadListPage[7]='include_file/centriassistenza.php';
ListPage_LoadListPage[8]='include_file/news.php';
ListPage_LoadListPage[9]='include_file/link.php';
ListPage_LoadListPage[10]='include_file/stampa.php';
ListPage_LoadListPage[11]='include_file/download.php';
ListPage_LoadListPage[12]='include_file/preventivo.php';
ListPage_LoadListPage[13]='include_file/dovesiamo.php';
ListPage_LoadListPage[14]='include_file/mission.php';
ListPage_LoadListPage[15]='include_file/profilo.php';
ListPage_LoadListPage[16]='include_file/referenze.php';
ListPage_LoadListPage[17]='include_file/certificazioni.php';
ListPage_LoadListPage[18]='include_file/privacy.php';
ListPage_LoadListPage[19]='include_file/team.php';
ListPage_LoadListPage[20]='include_file/registrati.php';
ListPage_LoadListPage[21]='include_file/cerca.php';
ListPage_LoadListPage[22]='include_file/area_privata.php';
ListPage_LoadListPage[23]='include_file/private_calendario.php';
ListPage_LoadListPage[24]='include_file/private_comunicazioni.php';
//ListPage_LoadListPage[25]='include_file/private_offerte.php';
ListPage_LoadListPage[25]='admin_area/offerte_area.php';
ListPage_LoadListPage[26]='include_file/sos_fotovoltaico.php';
ListPage_LoadListPage[27]='include_file/dovesiamo.php';
ListPage_LoadListPage[28]='include_file/referenze.php';
ListPage_LoadListPage[29]='include_file/certificazioni.php';
ListPage_LoadListPage[30]='include_file/privacy.php';
ListPage_LoadListPage[31]='include_file/team.php';

var ListPage_OfficeLocation=Array();
ListPage_OfficeLocation[0]='include_file/retevendita_list.php';
ListPage_OfficeLocation[1]='include_file/centriassistenza_list.php';
ListPage_OfficeLocation[2]='include_file/puntivendita_list.php';
ListPage_OfficeLocation[3]='include_file/puntivendita_list2.php';
//------------------PAGE------------------

//------------------PRODOTTI------------------
var ListPage_LoadListPageProduct=Array();

ListPage_LoadListPageProduct['CALDAIE']=Array();
ListPage_LoadListPageProduct['CALDAIE'][0]='prodotti/caldaie/condensazione/murali/iride_i.php';
ListPage_LoadListPageProduct['CALDAIE'][1]='prodotti/caldaie/condensazione/murali/iride_r.php';
ListPage_LoadListPageProduct['CALDAIE'][2]='prodotti/caldaie/condensazione/murali/iride_mb.php';
ListPage_LoadListPageProduct['CALDAIE'][3]='prodotti/caldaie/condensazione/murali/iride_bb-xb.php';
ListPage_LoadListPageProduct['CALDAIE'][4]='prodotti/caldaie/condensazione/basamento/alba_modulosingolo.php';
ListPage_LoadListPageProduct['CALDAIE'][5]='prodotti/caldaie/premiscelate/murali/sogno_el.php';
ListPage_LoadListPageProduct['CALDAIE'][6]='prodotti/caldaie/premiscelate/murali/sogno_eli.php';
ListPage_LoadListPageProduct['CALDAIE'][7]='prodotti/caldaie/premiscelate/murali/sogno_elr.php';
ListPage_LoadListPageProduct['CALDAIE'][8]='prodotti/caldaie/premiscelate/murali/sogno_eli_accumulo.php';
ListPage_LoadListPageProduct['CALDAIE'][9]='prodotti/caldaie/premiscelate/basamento/goldcore1_modutronic.php';
ListPage_LoadListPageProduct['CALDAIE'][10]='prodotti/caldaie/premiscelate/basamento/goldcore1_modutronic_bollitore.php';
ListPage_LoadListPageProduct['CALDAIE'][11]='prodotti/caldaie/premiscelate/basamento/goldcore1_gt.php';
ListPage_LoadListPageProduct['CALDAIE'][12]='prodotti/caldaie/condensazione/murali/iride_eli_biz.php';
ListPage_LoadListPageProduct['CALDAIE'][13]='prodotti/caldaie/condensazione/murali/iride_eco.php';
ListPage_LoadListPageProduct['CALDAIE'][14]='prodotti/caldaie/condensazione/murali/iride_in.php';
ListPage_LoadListPageProduct['CALDAIE'][15]='prodotti/caldaie/condensazione/basamento/alba_modulocascato.php';

ListPage_LoadListPageProduct['RADIANTE']=Array();
ListPage_LoadListPageProduct['RADIANTE'][0]='prodotti/radiante/productfinder.php';

ListPage_LoadListPageProduct['GEOTERMIA']=Array();
ListPage_LoadListPageProduct['GEOTERMIA'][0]='prodotti/geotermia/base/baseAT.php';
ListPage_LoadListPageProduct['GEOTERMIA'][1]='prodotti/geotermia/base/baseATR.php';
ListPage_LoadListPageProduct['GEOTERMIA'][2]='prodotti/geotermia/colonna/colonnaAT.php';
ListPage_LoadListPageProduct['GEOTERMIA'][3]='prodotti/geotermia/colonna/colonnaATR.php';
ListPage_LoadListPageProduct['GEOTERMIA'][4]='prodotti/geotermia/thermageo/thermageo.php';

ListPage_LoadListPageProduct['CLIMATIZZAZIONE']=Array();
ListPage_LoadListPageProduct['CLIMATIZZAZIONE'][0]='prodotti/climatizzazione/chiller/frigo/page.php';
ListPage_LoadListPageProduct['CLIMATIZZAZIONE'][1]='prodotti/climatizzazione/chiller/modulfrigo/page.php';
ListPage_LoadListPageProduct['CLIMATIZZAZIONE'][2]='';
ListPage_LoadListPageProduct['CLIMATIZZAZIONE'][3]='';
//------------------PRODOTTI------------------
//---------------------------------------------VARIABILI---------------------------------------------



//---------------------------------------------PAGE FUNCTION---------------------------------------------
//--------------------------------
function Load_Page01(oggetto,nomediv,array_listpage,idpage,variabili){
	listadati=Array();
	listadati['oggetto']=oggetto;
	listadati['iddiv']=nomediv;
	listadati['arraypage']=array_listpage;
	listadati['idpage']=idpage;
	listadati['variable']=variabili;
	listadati['typedata']='TXT';
	listadati['preloader']='img/preloader01.gif';
	listadati['width_preloader']='100%';
	listadati['height_preloader']='270';
	GetPage(listadati);
	}
//--------------------------------

//--------------------------------
function Load_Page02(oggetto,nomediv,array_listpage,idpage,variabili){
	top.GET_ElementById(nomediv).innerHTML = '';
	top.Ajax_MOD_InnerElementById(oggetto,nomediv,array_listpage[idpage],'TXT','','img/preloader01.gif','100%','270');
	}
//--------------------------------

//--------------------------------
function Load_Page03(oggetto,nomediv,page){
	GET_ElementById(nomediv).innerHTML = '';
	Ajax_MOD_InnerElementById(oggetto,nomediv,page,'TXT','','img/preloader01.gif','100%','270');
	}
//--------------------------------

//--------------------------------
function Load_Mainmenu(oggetto,nomediv,array_listpage,idpage,idpage_submenu,variabili){
	if(idpage_submenu==''){
		Load_Page01(oggetto,nomediv,array_listpage,idpage,variabili);
		}
	else{
		Load_Page01(oggetto,nomediv,array_listpage,idpage_submenu,variabili);
		}
		
	ChangeIcon(array_listpage,listbutton_mainmenu,idpage);	
	for(i=0; i<(array_listpage.length); i+=1){
		if(GET_ElementById('btmainmenu'+i)){
			if(i==idpage){
				ChangeIcon('btmainmenu'+i,listbutton_mainmenu[i][1]);
				}
			else{
				ChangeIcon('btmainmenu'+i,listbutton_mainmenu[i][0]);
				}
			}
		}
	}
//--------------------------------

//--------------------------------
function ChangeIcon(idimage,path){
	if(GET_ElementById(idimage)){
		GET_ElementById(idimage).src=path;
		}
	}
//--------------------------------

//--------------------------------
function mmLoadMenus() {
	if (window.mm_menu_1) return;
	window.mm_menu_1 = new Menu("root",100,15,"Verdana, Arial, Helvetica, sans-serif",10,"#003C7C","#ffffff","#AECEEA","#025BC3","left","middle",3,0,1000,0,0,true,true,true,0,true,true);
	mm_menu_1.addMenuItem("dove siamo","location=\"javascript:Load_Mainmenu(ajax1,'bodysite',ListPage_LoadListPage,4,13,'');\"");
	mm_menu_1.addMenuItem("mission","location=\"javascript:Load_Mainmenu(ajax1,'bodysite',ListPage_LoadListPage,4,14,'');\"");
	//mm_menu_1.addMenuItem("profilo","location=\"javascript:Load_Mainmenu(ajax1,'bodysite',ListPage_LoadListPage,4,15,'');\"");
	mm_menu_1.addMenuItem("referenze","location=\"javascript:Load_Mainmenu(ajax1,'bodysite',ListPage_LoadListPage,4,16,'');\"");
	mm_menu_1.addMenuItem("certificazioni","location=\"javascript:Load_Mainmenu(ajax1,'bodysite',ListPage_LoadListPage,4,17,'');\"");
	mm_menu_1.addMenuItem("privacy/legal info","location=\"javascript:Load_Mainmenu(ajax1,'bodysite',ListPage_LoadListPage,4,18,'');\"");
	mm_menu_1.addMenuItem("team","location=\"javascript:Load_Mainmenu(ajax1,'bodysite',ListPage_LoadListPage,4,19,'');\"");
	mm_menu_1.hideOnMouseOut=true;
	mm_menu_1.childMenuIcon="img/arrows.gif";
	mm_menu_1.menuBorder=1;
	mm_menu_1.menuLiteBgColor='#ffffff';
	mm_menu_1.menuBorderBgColor='#001982';
	mm_menu_1.bgColor='#ffffff';
	mm_menu_1.writeMenus();
	}
//--------------------------------

//--------------------------------
function Load_OfficePosition(variabili){
	var idpage=GET_ElementById('sectionoffice').value;
	Load_Page01(ajax4,'listacontatti',ListPage_OfficeLocation,idpage,variabili);
	}
//--------------------------------

//--------------------------------
function Preventivo_SetData(num_multiple_value,suffisso_campo,valore_fisso,campo_finale){
	if(num_multiple_value==''){
		GET_ElementById(campo_finale).value=valore_fisso;
		}
	else{
		if(num_multiple_value>0){
			GET_ElementById(campo_finale).value='';
			for(c=0;c<num_multiple_value;c++){
				if(GET_ElementById(suffisso_campo+''+c).checked==true){
					if(GET_ElementById(campo_finale).value==''){
						GET_ElementById(campo_finale).value=GET_ElementById(suffisso_campo+''+c).value;
						}
					else{
						GET_ElementById(campo_finale).value+=', '+GET_ElementById(suffisso_campo+''+c).value;
						}
					}
				}
			}
		}
	//GET_ElementById('fileattach').value=nomefile;
	//alert(GET_ElementById(campo_finale).value);
	}
//--------------------------------

//--------------------------------
function Finder(){
	if((GET_ElementById('findbox').value!='')&&(GET_ElementById('findbox').value.length>1)){
		Load_Mainmenu(ajax1,'bodysite',ListPage_LoadListPage,21,'','tofind='+GET_ElementById('findbox').value);
		}
	}
//--------------------------------
	
//--------------------------------
function Calendario_Cambiamese(mese,anno,action){
	listadati=Array();
	listadati['oggetto']=ajax2;
	listadati['iddiv']='privatecalendar';
	listadati['arraypage']=ListPage_LoadListPage;
	listadati['idpage']=23;
	listadati['variable']='vedi='+mese+'&getanno='+anno+'&action='+action+'&reload=1';
	listadati['typedata']='TXT';
	listadati['preloader']='img/preloader01.gif';
	listadati['width_preloader']='100%';
	listadati['height_preloader']='221';
	GetPage(listadati);
	}
	
function ColorBackground(oggetto,colore){
	GET_ElementById(oggetto).style.backgroundColor=colore;
	}
//--------------------------------
//---------------------------------------------PAGE FUNCTION---------------------------------------------

//---------------------------------------------FORM FUNCTION---------------------------------------------
//--------------------------------
function controllaform_contattaci(){
	var campi=new Array();
	var form_nomedesc_contact=new Array('usr01','usr02','usr03','usr04','usr05','usr06','usr07','usr08','usr09','usr10','usr11','usr12');
	//------------------
	campi['nome_campi']=new Array('nomeuser','cognomeuser','professioneuser','indirizzouser','cittauser','capuser','provinciauser','telefonouser','cellulareuser','emailuser','infouser','destinatario');
	campi['txt_desc']=new Array('Nome','Cognome','Professione','Indirizzo','Citta\'','C.A.P.','Provincia','Telefono','Cellulare','E-mail','Info','Destinatario');
	campi['nome_desc']=form_nomedesc_contact;
	campi['desc_error']=new Array('Nome','Cognome','Professione','Indirizzo','Citta\'','C.A.P.','Provincia','Telefono','Cellulare','E-mail','Info','Destinatario');
	campi['type_value']=new Array('R','R','','','','isNum','','isNum','isNum','RisEmail','R','R');
	campi['message']=new Array(form_message01,form_message02,form_message03,form_message04,form_message05,form_message06,form_message07);
	campi['css']=new Array('testo10-blu01','testo10-red01');
	campi['div']=new Array(NameDivError,'100%','#E9EEF3','testo10-red01','testo10-blu01');
	campi['sign_request']='';
	campi['other_error']=new Array();
	//-------------------
	if(GET_ElementById('privacy').checked==false){
		campi['other_error'][campi['other_error'].length]=new Array(1,'Accetto','- La Legge sulla Privacy',form_message08,'prv01');
		}
	else{
		campi['other_error'][campi['other_error'].length]=new Array(0,'Accetto','','','prv01');
		}
	//-------------------
	MM_validateFormHTML_lingua(campi);
	//-------------------
	if(document.MM_returnValue==true){
		MODIFY_InnerElementById(NameDivError,'');
		SendFormContact('bodysite','include_file/contattaci.php','TXT','100%',392);
		}
	}


function SendFormContact(iddiv,nomeFile,typedata,width_preloader,height_preloader){
	variabili='';
	var ToSendField=new Array('nomeuser','cognomeuser','professioneuser','indirizzouser','cittauser','capuser','provinciauser','telefonouser','cellulareuser','emailuser','infouser','destinatario','iscontact');
	//--------s
	for(x=0;x<ToSendField.length;x++){
		if(GET_ElementById(ToSendField[x])){
			if(variabili==''){
				variabili=ToSendField[x]+'='+GET_ElementById(ToSendField[x]).value;
				}
			else{
				variabili+='&'+ToSendField[x]+'='+GET_ElementById(ToSendField[x]).value;
				}
			}
		}
	//--------
	//alert(variabili);
	return Ajax_POST_SendForm(ajax5,iddiv,nomeFile,variabili,typedata,'img/preloader01.gif',width_preloader,height_preloader);
	}
//--------------------------------

//--------------------------------
function controllaform_registrati(){
	var campi=new Array();
	var form_nomedesc_contact=new Array('usr01','usr02','usr03','usr04','usr05','usr06','usr07','usr08','usr09','usr10','usr11','usr12','usr13','usr14','usr15');
	//------------------
	campi['nome_campi']=new Array('nomeuser','cognomeuser','ragsocuser','partitaivauser','tipologiauser','indirizzouser','cittauser','capuser','provinciauser','telefonouser','faxuser','cellulareuser','emailuser','password','repassword');
	campi['txt_desc']=new Array('Nome','Cognome','Ragione sociale','Partita iva','Tipologia','Indirizzo','Citta\'','C.A.P.','Provincia','Telefono','Fax','Cellulare','E-mail (username)','Password','Conferma password');
	campi['nome_desc']=form_nomedesc_contact;
	campi['desc_error']=new Array('Nome','Cognome','Ragione sociale','Partita iva','Tipologia','Indirizzo','Citta\'','C.A.P.','Provincia','Telefono','Fax','Cellulare','E-mail (username)','Password','Conferma password');
	if(GET_ElementById('ragsocuser').value==''){
		campi['type_value']=new Array('R','R','','','R','R','R','RisNum','R','isNum','isNum','isNum','RisEmail','R','R');
		}
	else{
		campi['type_value']=new Array('R','R','','RisIva','R','R','R','RisNum','R','isNum','isNum','isNum','RisEmail','R','R');
		}
	campi['message']=new Array(form_message01,form_message02,form_message03,form_message04,form_message05,form_message06,form_message07);
	campi['css']=new Array('testo10-blu01','testo10-red01');
	campi['div']=new Array(NameDivError,'100%','#E9EEF3','testo10-red01','testo10-blu01');
	campi['sign_request']='';
	campi['other_error']=new Array();
	//-------------------
	if((GET_ElementById('password').value!='')&&(GET_ElementById('repassword').value!='')){
		if(GET_ElementById('password').value!=GET_ElementById('repassword').value){
			campi['other_error'][campi['other_error'].length]=new Array(1,'Password','- Password e Conferma password',form_message09,'usr14');
			campi['other_error'][campi['other_error'].length]=new Array(1,'Conferma password','','','usr15');
			}
		else{
			campi['other_error'][campi['other_error'].length]=new Array(0,'Password','','','usr14');
			campi['other_error'][campi['other_error'].length]=new Array(0,'Conferma password','','','usr15');
			}
		}
	//-------------------
	if(GET_ElementById('privacy').checked==false){
		campi['other_error'][campi['other_error'].length]=new Array(1,'Accetto','- La Legge sulla Privacy',form_message08,'prv01');
		}
	else{
		campi['other_error'][campi['other_error'].length]=new Array(0,'Accetto','','','prv01');
		}
	//-------------------
	MM_validateFormHTML_lingua(campi);
	//-------------------
	if(document.MM_returnValue==true){
		MODIFY_InnerElementById(NameDivError,'');
		SendFormRegister('bodysite','include_file/registrati.php','TXT','100%',392);
		}
	}


function SendFormRegister(iddiv,nomeFile,typedata,width_preloader,height_preloader){
	variabili='';
	var ToSendField=new Array('nomeuser','cognomeuser','ragsocuser','partitaivauser','tipologiauser','indirizzouser','cittauser','capuser','provinciauser','telefonouser','faxuser','cellulareuser','emailuser','password','sms','nws','isregister');
	//--------s
	for(x=0;x<ToSendField.length;x++){
		if(GET_ElementById(ToSendField[x])){
			if(variabili==''){
				variabili=ToSendField[x]+'='+GET_ElementById(ToSendField[x]).value;
				}
			else{
				variabili+='&'+ToSendField[x]+'='+GET_ElementById(ToSendField[x]).value;
				}
			}
		}
	//--------
	//alert(variabili);
	return Ajax_POST_SendForm(ajax5,iddiv,nomeFile,variabili,typedata,'img/preloader01.gif',width_preloader,height_preloader);
	}
//--------------------------------

//--------------------------------
function controllaform_lavoraconnoi(){
	var campi=new Array();
	var form_nomedesc_lavoraconnoi=new Array('usr01','usr02','usr03','usr04','usr05','usr06','usr07','usr08','usr09','usr10','usr11','usr12');
	//------------------
	campi['nome_campi']=new Array('nomeuser','cognomeuser','professioneuser','indirizzouser','cittauser','capuser','provinciauser','telefonouser','cellulareuser','emailuser','infouser','Curriculum vitae (doc,pdf)');
	campi['txt_desc']=new Array('Nome','Cognome','Professione','Indirizzo','Citta\'','C.A.P.','Provincia','Telefono','Cellulare','E-mail','Info','Curriculum vitae (doc,pdf)');
	campi['nome_desc']=form_nomedesc_lavoraconnoi;
	campi['desc_error']=new Array('Nome','Cognome','Professione','Indirizzo','Citta\'','C.A.P.','Provincia','Telefono','Cellulare','E-mail','Info','Curriculum vitae');
	campi['type_value']=new Array('R','R','','','','isNum','','isNum','isNum','RisEmail','R','');
	campi['message']=new Array(form_message01,form_message02,form_message03,form_message04,form_message05,form_message06,form_message07);
	campi['css']=new Array('testo10-blu01','testo10-red01');
	campi['div']=new Array(NameDivError,'100%','#E9EEF3','testo10-red01','testo10-blu01');
	campi['sign_request']='';
	campi['other_error']=new Array();
	//-------------------
	if(GET_ElementById('privacy').checked==false){
		campi['other_error'][campi['other_error'].length]=new Array(1,'Accetto','- La Legge sulla Privacy',form_message08,'prv01');
		}
	else{
		campi['other_error'][campi['other_error'].length]=new Array(0,'Accetto','','','prv01');
		}
	//-------------------
	MM_validateFormHTML_lingua(campi);
	//-------------------
	if(document.MM_returnValue==true){
		//MODIFY_InnerElementById(NameDivError,'');
		//SendFormLavoraconnoi('bodysite','include_file/lavoraconnoi.php','TXT','100%',392);
		GET_ElementById('inviawork').submit();
		}
	}
	
	
function SendFormLavoraconnoi(iddiv,nomeFile,typedata,width_preloader,height_preloader){
	variabili='';
	var ToSendField=new Array('nomeuser','cognomeuser','professioneuser','indirizzouser','cittauser','capuser','provinciauser','telefonouser','cellulareuser','emailuser','infouser','curriculum','iscontact');
	//--------
	for(x=0;x<ToSendField.length;x++){
		if(GET_ElementById(ToSendField[x])){
			if(variabili==''){
				variabili=ToSendField[x]+'='+GET_ElementById(ToSendField[x]).value;
				}
			else{
				variabili+='&'+ToSendField[x]+'='+GET_ElementById(ToSendField[x]).value;
				}
			}
		}
	//--------
	//alert(variabili);
	return Ajax_POST_SendForm(ajax5,iddiv,nomeFile,variabili,typedata,'img/preloader01.gif',width_preloader,height_preloader);
	}
//--------------------------------
function controllaform_lavoraconnoi_comm(){
	var campi=new Array();
	var form_nomedesc_lavoraconnoi=new Array('usr01','usr02','usr03','usr04','usr05','usr06','usr07','usr08','usr09','usr10','usr11','usr12','usr13');
	//------------------
	campi['nome_campi']=new Array('nomeuser','cognomeuser','professioneuser','indirizzouser','cittauser','capuser','provinciauser','telefonouser','cellulareuser','emailuser','infouser','Curriculum vitae (doc,pdf)','zonacompetenzauser');
	campi['txt_desc']=new Array('Nome','Cognome','Professione','Indirizzo','Citta\'','C.A.P.','Provincia','Telefono','Cellulare','E-mail','Info','Curriculum vitae (doc,pdf)','Zona di competenza');
	campi['nome_desc']=form_nomedesc_lavoraconnoi;
	campi['desc_error']=new Array('Nome','Cognome','Professione','Indirizzo','Citta\'','C.A.P.','Provincia','Telefono','Cellulare','E-mail','Info','Curriculum vitae','Zona di competenza');
	campi['type_value']=new Array('R','R','','','','isNum','','isNum','isNum','RisEmail','R','','');
	campi['message']=new Array(form_message01,form_message02,form_message03,form_message04,form_message05,form_message06,form_message07);
	campi['css']=new Array('testo10-blu01','testo10-red01');
	campi['div']=new Array(NameDivError,'100%','#E9EEF3','testo10-red01','testo10-blu01');
	campi['sign_request']='';
	campi['other_error']=new Array();
	//-------------------
	if(GET_ElementById('privacy').checked==false){
		campi['other_error'][campi['other_error'].length]=new Array(1,'Accetto','- La Legge sulla Privacy',form_message08,'prv01');
		}
	else{
		campi['other_error'][campi['other_error'].length]=new Array(0,'Accetto','','','prv01');
		}
	//-------------------
	MM_validateFormHTML_lingua(campi);
	//-------------------
	if(document.MM_returnValue==true){
		//MODIFY_InnerElementById(NameDivError,'');
		//SendFormLavoraconnoi('bodysite','include_file/lavoraconnoi.php','TXT','100%',392);
		GET_ElementById('inviawork').submit();
		}
	}
	
function SendFormLavoraconnoi_comm(iddiv,nomeFile,typedata,width_preloader,height_preloader){
	variabili='';
	var ToSendField=new Array('nomeuser','cognomeuser','professioneuser','zonacompetenzauser','indirizzouser','cittauser','capuser','provinciauser','telefonouser','cellulareuser','emailuser','infouser','curriculum','iscontact');
	//--------
	for(x=0;x<ToSendField.length;x++){
		if(GET_ElementById(ToSendField[x])){
			if(variabili==''){
				variabili=ToSendField[x]+'='+GET_ElementById(ToSendField[x]).value;
				}
			else{
				variabili+='&'+ToSendField[x]+'='+GET_ElementById(ToSendField[x]).value;
				}
			}
		}
	//--------
	//alert(variabili);
	return Ajax_POST_SendForm(ajax5,iddiv,nomeFile,variabili,typedata,'img/preloader01.gif',width_preloader,height_preloader);
	}
//--------------------------------
function controllaform_sosfotovoltaico(){
	var campi=new Array();
	var form_nomedesc_lavoraconnoi=new Array('usr01','usr02','usr03','usr04','usr05','usr06','usr07','usr08','usr09','usr10','usr11','usr12','usr13','usr14','usr15');
	//------------------
	campi['nome_campi']=new Array("nomeuser","cognomeuser","ragsocuser","tipologiauser","indirizzouser","cittauser","capuser","provinciauser","cellulareuser","emailuser","consumieuro","consumikw","orientamento","tipologia","pianta");
	campi['txt_desc']=new Array("Nome","Cognome","Ragione sociale","Tipologia","Indirizzo","Citta'","C.A.P.","Provincia","Telefono","E-mail","Consumi annui in euro","Consumi in Kw","Orientamento dello spazio dedicato","Tipologia dello spazio","Pianta");
	campi['nome_desc']=form_nomedesc_lavoraconnoi;
	campi['desc_error']=new Array("Nome","Cognome","Ragione sociale","Tipologia","Indirizzo","Citta'","C.A.P.","Provincia","Telefono","E-mail","Consumi annui in euro","Consumi in Kw","Orientamento dello spazio dedicato","Tipologia dello spazio","Pianta");
	if(GET_ElementById('tipologiauser').options[GET_ElementById('tipologiauser').selectedIndex].value!='azienda'){
		campi['type_value']=new Array('R','R','','R','R','R','RisNum','R','RisNum','RisEmail','R','R','R','R','');
		}
	else{
		campi['type_value']=new Array('R','R','R','R','R','R','RisNum','R','RisNum','RisEmail','R','R','R','R','');
		}
	campi['message']=new Array(form_message01,form_message02,form_message03,form_message04,form_message05,form_message06,form_message07);
	campi['css']=new Array('testo10-blu01','testo10-red01');
	campi['div']=new Array(NameDivError,'100%','#E9EEF3','testo10-red01','testo10-blu01');
	campi['sign_request']='';
	campi['other_error']=new Array();
	//-------------------
	if(GET_ElementById('privacy').checked==false){
		campi['other_error'][campi['other_error'].length]=new Array(1,'Accetto','- La Legge sulla Privacy',form_message08,'prv01');
		}
	else{
		campi['other_error'][campi['other_error'].length]=new Array(0,'Accetto','','','prv01');
		}
	//-------------------
	MM_validateFormHTML_lingua(campi);
	//-------------------
	if(document.MM_returnValue==true){
		//MODIFY_InnerElementById(NameDivError,'');
		//SendFormLavoraconnoi('bodysite','include_file/lavoraconnoi.php','TXT','100%',392);
		GET_ElementById('inviasos').submit();
		}
	}
//--------------------------------

//--------------------------------
function controllaform_preventivo(){
	var campi=new Array();
	var form_nomedesc_preventivo=new Array('usr01','usr02','usr03','usr04','usr05','usr06','usr07','usr08','usr09','usr10','prg01','prg02','prg03','prg04');
	//------------------
	campi['nome_campi']=new Array('nomeuser','cognomeuser','professioneuser','indirizzouser','cittauser','capuser','provinciauser','telefonouser','cellulareuser','emailuser','carattedificio','tipointervento','tipoimpianto','descrizione');
	campi['txt_desc']=new Array('Nome','Cognome','Professione','Indirizzo','Citta\'','C.A.P.','Provincia','Telefono','Cellulare','E-mail','Caratteristiche dell\'edificio','Tipologia dell\'intervento','Tipologia dell\'impianto','Descrizione sommaria');
	campi['nome_desc']=form_nomedesc_preventivo;
	campi['desc_error']=new Array('Nome','Cognome','Professione','Indirizzo','Citta\'','C.A.P.','Provincia','Telefono','Cellulare','E-mail','Caratteristiche dell\'edificio','Tipologia dell\'intervento','Tipologia dell\'impianto','Descrizione sommaria');
	campi['type_value']=new Array('R','R','','','','isNum','','isNum','isNum','RisEmail','R','R','R','R');
	campi['message']=new Array(form_message01,form_message02,form_message03,form_message04,form_message05,form_message06,form_message07);
	campi['css']=new Array('testo10-blu01','testo10-red01');
	campi['div']=new Array(NameDivError,'100%','#E9EEF3','testo10-red01','testo10-blu01');
	campi['sign_request']='';
	campi['other_error']=new Array();
	//-------------------
	if(GET_ElementById('privacy').checked==false){
		campi['other_error'][campi['other_error'].length]=new Array(1,'Accetto','- La Legge sulla Privacy',form_message08,'prv01');
		}
	else{
		campi['other_error'][campi['other_error'].length]=new Array(0,'Accetto','','','prv01');
		}
	//-------------------
	MM_validateFormHTML_lingua(campi);
	//-------------------
	if(document.MM_returnValue==true){
		//MODIFY_InnerElementById(NameDivError,'');
		//SendFormPreventivo('bodysite','include_file/preventivo.php','TXT','100%',392);
		GET_ElementById('inviapreventivo').submit();
		}
	}


function SendFormPreventivo(iddiv,nomeFile,typedata,width_preloader,height_preloader){
	variabili='';
	var ToSendField=new Array('nomeuser','cognomeuser','professioneuser','indirizzouser','cittauser','capuser','provinciauser','telefonouser','cellulareuser','emailuser','carattedificio','tipointervento','tipoimpianto','descrizione','ispreventivo');
	//--------s
	for(x=0;x<ToSendField.length;x++){
		if(GET_ElementById(ToSendField[x])){
			if(variabili==''){
				variabili=ToSendField[x]+'='+GET_ElementById(ToSendField[x]).value;
				}
			else{
				variabili+='&'+ToSendField[x]+'='+GET_ElementById(ToSendField[x]).value;
				}
			}
		}
	//--------
	//alert(variabili);
	return Ajax_POST_SendForm(ajax5,iddiv,nomeFile,variabili,typedata,'img/preloader01.gif',width_preloader,height_preloader);
	}
//--------------------------------

//--------------------------------
function controllaform_login(){
	//DIV_autovisibility('messagesection');
	
	var campi=new Array();
	var form_nomedesc_login=new Array('usr01','usr02');
	//------------------
	campi['nome_campi']=new Array('loginuser','loginpass');
	campi['txt_desc']=new Array('Username','Password');
	campi['nome_desc']=form_nomedesc_login;
	campi['desc_error']=new Array('Username','Password');
	campi['type_value']=new Array('R','R');
	campi['message']=new Array(form_message01,form_message02,form_message03,form_message04,form_message05,form_message06,form_message07);
	campi['css']=new Array('testo10-blu01','testo10-red01');
	campi['div']=new Array(NameDivError_Message,'100%','#E9EEF3','testo10-red01','testo10-blu01');
	campi['sign_request']='';
	campi['other_error']=new Array();
	//-------------------
	MM_validateFormHTML_lingua(campi);
	//setTimeout("MM_validateFormHTML_lingua(campi)",3000);
	//-------------------
	if(document.MM_returnValue==true){
		if(DIV_GetStyle('messagesection').visibility=='visible'){
			MODIFY_InnerElementById(NameDivError_Message,'');
			DIV_autovisibility('messagesection');
			}
		SendFormLogin('topsite','include_file/site_top.php','TXT','100%',288);
		}
	else{
		if(DIV_GetStyle('messagesection').visibility!='visible'){
			DIV_autovisibility('messagesection');
			}
		}
	}


function SendFormLogin(iddiv,nomeFile,typedata,width_preloader,height_preloader){
	variabili='';
	var ToSendField=new Array('loginuser','loginpass','flashused','islogin');
	//--------
	for(x=0;x<ToSendField.length;x++){
		if(GET_ElementById(ToSendField[x])){
			if(variabili==''){
				variabili=ToSendField[x]+'='+GET_ElementById(ToSendField[x]).value;
				}
			else{
				variabili+='&'+ToSendField[x]+'='+GET_ElementById(ToSendField[x]).value;
				}
			}
		}
	//--------
	//alert(variabili);
	 
	openAjaxLink([['topsite',null,null]],['include_file/site_top.php?'+variabili+''],[[ajaxloader1(),null,null]],'POST');
	//openAjaxLink(['bodysite'],['include_file/start.php'],ajaxloader1());
	return;
	//return Ajax_POST_SendForm(ajax5,iddiv,nomeFile,variabili,typedata,'img/preloader01.gif',width_preloader,height_preloader);
	}
//--------------------------------

//--------------------------------
function controllaform_logout(){
	SendFormLogout('topsite','include_file/site_top.php','TXT','100%',288);
	}

function SendFormLogout(iddiv,nomeFile,typedata,width_preloader,height_preloader){
	variabili='';
	var ToSendField=new Array('flashused','islogout');
	//--------
	for(x=0;x<ToSendField.length;x++){
		if(GET_ElementById(ToSendField[x])){
			if(variabili==''){
				variabili=ToSendField[x]+'='+GET_ElementById(ToSendField[x]).value;
				}
			else{
				variabili+='&'+ToSendField[x]+'='+GET_ElementById(ToSendField[x]).value;
				}
			}
		}
	//--------
	//alert(variabili);
	//Load_Mainmenu(ajax2,'bodysite',ListPage_LoadListPage,0,'','');
	//return Ajax_POST_SendForm(ajax5,iddiv,nomeFile,variabili,typedata,'img/preloader01.gif',width_preloader,height_preloader);
	openAjaxLink([['topsite',null,null]],['include_file/site_top.php?'+variabili+''],[[ajaxloader1(),null,null]],'POST');
	//openAjaxLink(['bodysite'],['include_file/start.php'],ajaxloader1());
	return;
	}
//--------------------------------
//---------------------------------------------FORM FUNCTION---------------------------------------------

//---modifiche di Cristian Zaretta del 26.05.08----//

function ajaxloader1(){
return "<div id=\"loader\" style=\"position:relative; z-index:99; height:100%; width:100%; overflow:hidden;\" align=\"center\" valign=\"middle\"><table width=\"100%\" height=\"270\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"><tr><td align=\"center\"><img src=\"http://www.nstgroup.it/img/ajax-loader.gif\" border=\"0\"></td></tr></table></div>";	
}

function selButton(idpulsantesel){
	
	var idpulsante=['mmainbt0','mmainbt1','mmainbt2','mmainbt3','mainbt4','mainbt5','mainbt6','mainbt7','mainbt8'];
	var pathpulsante=['../img/menu_top/home_','../img/menu_top/contattaci_','../img/menu_top/lavora_','../img/menu_top/mappa_','../img/login/dove_','../img/login/referenze_','../img/login/certificazioni_','../img/login/privacy_','../img/login/team_'];
	for (i=0;i<idpulsante.length;i++){
		if(idpulsantesel==idpulsante[i]){
										document.getElementById(idpulsante[i]).src=pathpulsante[i]+'up.jpg';
		}else {
										document.getElementById(idpulsante[i]).src=pathpulsante[i]+'down.jpg';	
										};
	}
	
}
function selButton2(idpulsantesel){
	
	var idpulsante=['mmainbt0','mmainbt1','mmainbt2','mmainbt3'];
	var pathpulsante=['../img/menu_top/home_','../img/menu_top/contattaci_','../img/menu_top/lavora_','../img/menu_top/mappa_'];
	for (i=0;i<idpulsante.length;i++){
		if(idpulsantesel==idpulsante[i]){
										document.getElementById(idpulsante[i]).src=pathpulsante[i]+'up.jpg';
		}else {
										document.getElementById(idpulsante[i]).src=pathpulsante[i]+'down.jpg';	
										};
	}
	
}
function changepermessi(){
	var permesso = document.getElementById('cambiapermessi').options[document.getElementById('cambiapermessi').selectedIndex].value;
	openAjaxLink([['topsite',null,null]],['include_file/site_top.php?flashused=1&chlogin='+permesso],[[ajaxloader1(),null,null]],'POST');
}
function cambiaCategoria(){
	var categoria = document.getElementById('categoria').options[document.getElementById('categoria').selectedIndex].value;
	openAjaxLink(['divdownload'],['include_file/page_download.php?categoria='+categoria],[ajaxloader1()]);
}

function checkEnter(e){ //e is event object passed from function invocation
	var characterCode //literal character code will be stored in this variable

	if(e && e.which){ //if which property of event object is supported (NN4)
		e = e
		characterCode = e.which //character code is contained in NN4's which property
	} else {
		e = event
		characterCode = e.keyCode //character code is contained in IE's keyCode property
	}

	if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
		controllaform_login(); //submit the form
		return false 
	} else {
		return true 
	}
}

function gruppoReferenze(){
	var gruppo=	document.getElementById('menu_referenze').options[document.getElementById('menu_referenze').selectedIndex].value;
	openAjaxLink(['bodysite'],['include_file/referenze2.php?gruppo='+gruppo],[ajaxloader1()]);
}



function lanciaHeaderFlash() {
	var IE = navigator.appName.indexOf("Microsoft") != -1;
	var el = IE ? window: window.document;

	//return;
	if (IE) {
		if ( !el['loghi'] || !el['laterale_dei_loghi'] ) {
			setTimeout('lanciaHeaderFlash();', 100);
			return;
		}
	} else {
		if ( !el['loghi'].PercentLoaded || !el['laterale_dei_loghi'].PercentLoaded ) {
			setTimeout('lanciaHeaderFlash();', 100);
			return;
		}
	}

	if ( (el['loghi'].PercentLoaded() < 100) && (el['laterale_dei_loghi'].PercentLoaded() < 100) ){
		el['loghi'].StopPlay();
		el['laterale_dei_loghi'].StopPlay();
		setTimeout('lanciaHeaderFlash();', 100);
		return;
	} else {
		//alert('hey');
		el['loghi'].Play();
		el['laterale_dei_loghi'].Play();
	}
}