function f_menu (pagina, vocemenu) {
	img1 = 'images/delta-cucine-home';
	img2 = 'images/delta-cucine-portfolio';
	img3 = 'images/delta-cucine-servizi';
	img4 = 'images/delta-cucine-prodotti';
	img5 = 'images/delta-cucine-dove';
	img6 = 'images/delta-cucine-contatti';
	
	if (pagina=='portfolio') {
		img1 = img1 + '-portfolio';
		img2 = img2 + '-portfolio';
		img3 = img3 + '-portfolio';
		img4 = img4 + '-portfolio';
		img5 = img5 + '-portfolio';
		img6 = img6 + '-portfolio';
	}
	if (pagina=='servizi') {
		img1 = img1 + '-servizi';
		img2 = img2 + '-servizi';
		img3 = img3 + '-servizi';
		img4 = img4 + '-servizi';
		img5 = img5 + '-servizi';
		img6 = img6 + '-servizi';
	}
	if (pagina=='prodotti') {
		img1 = img1 + '-prodotti';
		img2 = img2 + '-prodotti';
		img3 = img3 + '-prodotti';
		img4 = img4 + '-prodotti';
		img5 = img5 + '-prodotti';
		img6 = img6 + '-prodotti';
	}
	if (pagina=='dove') {
		img1 = img1 + '-dove';
		img2 = img2 + '-dove';
		img3 = img3 + '-dove';
		img4 = img4 + '-dove';
		img5 = img5 + '-dove';
		img6 = img6 + '-dove';
	}
	if (pagina=='contatti') {
		img1 = img1 + '-contatti';
		img2 = img2 + '-contatti';
		img3 = img3 + '-contatti';
		img4 = img4 + '-contatti';
		img5 = img5 + '-contatti';
		img6 = img6 + '-contatti';
	}
	
	if (pagina=='home') {img1 = img1 + '-on';} else {img1 = img1 + '-off';}
	if (pagina=='portfolio') {img2 = img2 + '-on';} else {img2 = img2 + '-off';}
	if (pagina=='servizi') {img3 = img3 + '-on';} else {img3 = img3 + '-off';}
	if (pagina=='prodotti') {img4 = img4 + '-on';} else {img4 = img4 + '-off';}
	if (pagina=='dove') {img5 = img5 + '-on';} else {img5 = img5 + '-off';}
	if (pagina=='contatti') {img6 = img6 + '-on';} else {img6 = img6 + '-off';}

	if (vocemenu=='home') {img1 = img1 + '-up';}
	if (vocemenu=='portfolio') {img2 = img2 + '-up';}
	if (vocemenu=='servizi') {img3 = img3 + '-up';}
	if (vocemenu=='prodotti') {img4 = img4 + '-up';}
	if (vocemenu=='dove') {img5 = img5 + '-up';}
	if (vocemenu=='contatti') {img6 = img6 + '-up';}
	
	img1 = img1 + '.jpg';
	img2 = img2 + '.jpg';
	img3 = img3 + '.jpg';
	img4 = img4 + '.jpg';
	img5 = img5 + '.jpg';
	img6 = img6 + '.jpg';
	
	document.getElementById('delta-home-id').src = img1;
	document.getElementById('delta-portfolio-id').src = img2;
	document.getElementById('delta-servizi-id').src = img3;
	document.getElementById('delta-prodotti-id').src = img4;
	document.getElementById('delta-dove-id').src = img5;
	document.getElementById('delta-contatti-id').src = img6;
}
function TrimString(sInString) 
{
   sInString = sInString.replace( /^\s+/g, "" );// strip leading
   return sInString.replace( /\s+$/g, "" );// strip trailing
}


function f_controllo() 
{
	ls_mail = document.getElementById('mail-id').value;
	ls_messaggio = document.getElementById('messaggio-id').value;
	posizione = ls_mail.indexOf('@');	
	ls_privacy = document.getElementById('privacy-id').checked;
	
	//Obbligatorietà
	
	if (TrimString(ls_mail)=='') {alert ('Il campo MAIL è obbligatorio'); return -1;}
	if (TrimString(ls_messaggio)=='') {alert ('Il campo MESSAGGIO è obbligatorio'); return -1;}
	if (!ls_privacy) {alert ('Campo PRIVACY obbligatorio'); return -1;}
	if (posizione<=0) {alert ('Indirizzo MAIL non è valido'); return -1;}

	return 1;
}


function f_operazione() 
{
	controllo = f_controllo();
	if (controllo==1) {
		document.getElementById('form1-id').submit();
	}
	return;
}
