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 NameDivError='helperror';

var form_nomedesc_contact=new Array('usr01','usr02','usr03','usr04','usr05','usr06','usr07','usr08','usr09','usr10','usr11','usr12','usr13');

var form_nomedesc_password=new Array('usr01','usr02');
//-------------------------VARIABILI-----------------------------


//--------------------------------INVIO LOGIN--------------------------------------------------
function SendFormLogin(iddiv,nomeFile,typedata,width_preloader,height_preloader){
	variabili='';
	ToSend=Array('loginuser','loginpass','islogin');
	//--------
	for(x=0;x<ToSend.length;x++){
		if(GET_ElementById(ToSend[x])){
			if(variabili==''){
				variabili=ToSend[x]+'='+GET_ElementById(ToSend[x]).value;
				}
			else{
				variabili+='&'+ToSend[x]+'='+GET_ElementById(ToSend[x]).value;
				}
			}
		}
	//--------
	//Ajax_POST_SendForm(ajax,iddiv,nomeFile,variabili,typedata);
	return Ajax_POST_SendForm(ajax3,iddiv,nomeFile,'',variabili,typedata,'img/preloader01.gif',width_preloader,height_preloader);
	}
//--------------------------------INVIO LOGIN--------------------------------------------------


//--------------------------------INVIO LOGOUT-------------------------------------------------
function SendFormLogout(iddiv,nomeFile,typedata,width_preloader,height_preloader){
	variabili='';
	ToSend=Array('islogout');
	//--------
	for(x=0;x<ToSend.length;x++){
		if(GET_ElementById(ToSend[x])){
			if(variabili==''){
				variabili=ToSend[x]+'='+GET_ElementById(ToSend[x]).value;
				}
			else{
				variabili+='&'+ToSend[x]+'='+GET_ElementById(ToSend[x]).value;
				}
			}
		}
	//--------
	//Ajax_POST_SendForm(ajax,iddiv,nomeFile,variabili,typedata);
	return Ajax_POST_SendForm(ajax3,iddiv,nomeFile,'',variabili,typedata,'img/preloader01.gif',width_preloader,height_preloader);
	}
//--------------------------------INVIO LOGOUT-------------------------------------------------


//--------------------------------INVIO PASSWORD---------------------------------------------
function controllaform_password(){
	var campi=new Array();
	//------------------
	campi['nome_campi']=new Array('mynewpass','mynewrepass');
	campi['txt_desc']=new Array('Digita la password definitiva','Conferma la password');
	campi['nome_desc']=form_nomedesc_contact;
	campi['desc_error']=new Array('Digita la password definitiva','Conferma la password');
	//campi['type_value']=new Array('R','R','','R','R','R','R','','','',''); -- società
	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-black01','testo10-red01');
	campi['div']=new Array(NameDivError,'350','#E9EEF3','testo10-red01','testo10-black01');
	campi['sign_request']='';
	campi['other_error']=new Array();
	//-------------------
	if(GET_ElementById('mynewpass').value!=GET_ElementById('mynewrepass').value){
		campi['other_error'][campi['other_error'].length]=new Array(1,'Digita la password definitiva','- I campi riguardanti la password devono contenere lo stesso valore.','','usr01');
		campi['other_error'][campi['other_error'].length]=new Array(1,'Conferma la password','','','usr02');
		}
	//-------------------
	MM_validateFormHTML_lingua(campi);
	//-------------------
	if(document.MM_returnValue==true){
		MODIFY_InnerElementById(NameDivError,'');
		SendFormPassword('mainmenu_bar','include_file/action_bar.php','TXT','100%',25);
		
		listadati['oggetto']=ajax1;
		listadati['iddiv']='mainsite';
		listadati['arraypage']=ListPage_MainPage;
		listadati['idpage']=0;
		listadati['variable']='';
		listadati['typedata']='TXT';
		listadati['charset']='';
		listadati['preloader']='img/preloader01.gif';
		listadati['width_preloader']='100%';
		listadati['height_preloader']='200';
		setTimeout("GetPage(listadati)",500);
		}
	}
	
function SendFormPassword(iddiv,nomeFile,typedata,width_preloader,height_preloader){
	variabili='';
	ToSend=Array('mynewpass','mynewrepass','confirm_password');
	//--------
	for(x=0;x<ToSend.length;x++){
		if(GET_ElementById(ToSend[x])){
			if(variabili==''){
				variabili=ToSend[x]+'='+GET_ElementById(ToSend[x]).value;
				}
			else{
				variabili+='&'+ToSend[x]+'='+GET_ElementById(ToSend[x]).value;
				}
			}
		}
	//--------
	//Ajax_POST_SendForm(ajax,iddiv,nomeFile,variabili,typedata);
	return Ajax_POST_SendForm(ajax3,iddiv,nomeFile,'',variabili,typedata,'img/preloader01.gif',width_preloader,height_preloader);
	}	
//--------------------------------INVIO PASSWORD---------------------------------------------


//--------------------------------INVIO CONTATTACI---------------------------------------------
function controllaform_registrati(){
	var campi=new Array();
	//------------------
	campi['nome_campi']=new Array('nomeuser','cognomeuser','ragsocuser','indirizzouser','cittauser','capuser','provinciauser','frazioneuser','telefonouser','faxuser','cellulareuser','emailuser','passworduser');
	campi['txt_desc']=new Array('Nome','Cognome','Ragione sociale','Indirizzo','Citta\'','CAP','Provincia','Frazione','Telefono','Fax','Cellulare','E-mail','Password');
	campi['nome_desc']=form_nomedesc_contact;
	campi['desc_error']=new Array('Nome','Cognome','Ragione sociale','Indirizzo','Citta\'','CAP','Provincia','Frazione','Telefono','Fax','Cellulare','E-mail','Password');
	//campi['type_value']=new Array('R','R','','R','R','R','R','','','',''); -- società
	campi['type_value']=new Array('R','R','','','','isNum','','','isNum','isNum','isNum','RisEmail','');
	campi['message']=new Array(form_message01,form_message02,form_message03,form_message04,form_message05,form_message06,form_message07);
	campi['css']=new Array('testo10-black01','testo10-red01');
	campi['div']=new Array(NameDivError,'100%','#E9EEF3','testo10-red01','testo10-black01');
	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,'');
		SendFormRegister('bodycontatti','include_file/contatti_module.php','TXT','100%',300);
		}
	}
	
function SendFormRegister(iddiv,nomeFile,typedata,width_preloader,height_preloader){
	variabili='';
	ToSend=Array('nomeuser','cognomeuser','ragsocuser','indirizzouser','cittauser','capuser','provinciauser','frazioneuser','telefonouser','faxuser','cellulareuser','emailuser','passworduser','isregister');
	//--------
	for(x=0;x<ToSend.length;x++){
		if(GET_ElementById(ToSend[x])){
			if(variabili==''){
				variabili=ToSend[x]+'='+GET_ElementById(ToSend[x]).value;
				}
			else{
				variabili+='&'+ToSend[x]+'='+GET_ElementById(ToSend[x]).value;
				}
			}
		}
	//--------
	//Ajax_POST_SendForm(ajax,iddiv,nomeFile,variabili,typedata);
	return Ajax_POST_SendForm(ajax1,iddiv,nomeFile,'',variabili,typedata,'img/preloader01.gif',width_preloader,height_preloader);
	}		
//--------------------------------INVIO CONTATTACI---------------------------------------------
