	// VERIFICA E-MAIL
function isEmail(what)
{
   var i=new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
   if(!i.test(what)) {return false};
   return true;
}
<!--
function controllamail(theForm)
{
if (theForm.email.value == "")
  {
	alert("Inserire un valore per il campo \"E-Mail\".");
	theForm.email.focus();
	return (false);
  }
if (!isEmail(theForm.email.value))
  {
	alert("L' \"E-Mail\" non è corretta.");
	theForm.email.focus();
	return (false);
  }
return (true);
}
<!--
function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}




 function MM_jumpMenu(targ,selObj,restore){ //v3.0
			   eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
			   if (restore) selObj.selectedIndex=0;
			 }



originalColorArray = new Array();

function changeBg(tr) {
	if (isTrMarked(tr)) return;
	var children = tr.childNodes;
	tmpArray = new Array();
	if (tr.children) {
		for (var i=0;i < children.length; i++) {
			tmpArray[i] = tr.children[i].bgColor;
			tr.children[i].bgColor='666666';
		}
	}
	originalColorArray[tr.rowIndex] = tmpArray;
}


function changeBg2(tr) {
	if (isTrMarked(tr)) return;
	var children = tr.childNodes;
	tmpArray = new Array();
	if (tr.children) {
		for (var i=0;i < children.length; i++) {
			tmpArray[i] = tr.children[i].bgColor;
			tr.children[i].bgColor='607625';
		}
	}
	originalColorArray[tr.rowIndex] = tmpArray;
}

function changeBg3(tr) {
	if (isTrMarked(tr)) return;
	var children = tr.childNodes;
	tmpArray = new Array();
	if (tr.children) {
		for (var i=0;i < children.length; i++) {
			tmpArray[i] = tr.children[i].bgColor;
			tr.children[i].bgColor='8C7625';
		}
	}
	originalColorArray[tr.rowIndex] = tmpArray;
}

function changeBg4(tr) {
	if (isTrMarked(tr)) return;
	var children = tr.childNodes;
	tmpArray = new Array();
	if (tr.children) {
		for (var i=0;i < children.length; i++) {
			tmpArray[i] = tr.children[i].bgColor;
			tr.children[i].bgColor='FF9900';
		}
	}
	originalColorArray[tr.rowIndex] = tmpArray;
}

function changeBg5(tr) {
	if (isTrMarked(tr)) return;
	var children = tr.childNodes;
	tmpArray = new Array();
	if (tr.children) {
		for (var i=0;i < children.length; i++) {
			tmpArray[i] = tr.children[i].bgColor;
			tr.children[i].bgColor='7F7F88';
		}
	}
	originalColorArray[tr.rowIndex] = tmpArray;
}

function changeBg6(tr) {
	if (isTrMarked(tr)) return;
	var children = tr.childNodes;
	tmpArray = new Array();
	if (tr.children) {
		for (var i=0;i < children.length; i++) {
			tmpArray[i] = tr.children[i].bgColor;
			tr.children[i].bgColor='CCA300';
		}
	}
	originalColorArray[tr.rowIndex] = tmpArray;
}

function changeBg7(tr) {
	if (isTrMarked(tr)) return;
	var children = tr.childNodes;
	tmpArray = new Array();
	if (tr.children) {
		for (var i=0;i < children.length; i++) {
			tmpArray[i] = tr.children[i].bgColor;
			tr.children[i].bgColor='99CC66';
		}
	}
	originalColorArray[tr.rowIndex] = tmpArray;
}

function changeBg8(tr) {
	if (isTrMarked(tr)) return;
	var children = tr.childNodes;
	tmpArray = new Array();
	if (tr.children) {
		for (var i=0;i < children.length; i++) {
			tmpArray[i] = tr.children[i].bgColor;
			tr.children[i].bgColor='386781';
		}
	}
	originalColorArray[tr.rowIndex] = tmpArray;
}



function resetBg(tr) {
	if (isTrMarked(tr)) return;
	tmpArray = originalColorArray[tr.rowIndex];
	var children = tr.childNodes;
	if (tr.children) {
		for (var i=0;i < children.length; i++) {
			tr.children[i].bgColor=tmpArray[i];
		}
	}
}

function isTrMarked(tr) {

	if (tr.children && tr.children[0].bgColor=='#437ca7') {
		return true;
	}
	return false;
}

function markTr(tr) {
	var children = tr.childNodes;
	var doStyle = true;
	if (isTrMarked(tr)) {
		unMarkTr(tr);
	} else {
		tmpArray = new Array();
		if (tr.children) {
			for (var i=0;i < children.length; i++) {
				tr.children[i].bgColor='437CA7';
				if (tr.children[i].style.color == "red") {
					tr.children[i].style.color="ffff00";
				} else {
					tr.children[i].style.color="ffffff";
				}
				if (tr.children[i].childNodes[0] != null && tr.children[i].childNodes[0].nodeName == "A") {
					tr.children[i].childNodes[0].style.color="ffffff";
				}
			}
		}
	}
}

function unMarkTr(tr) {
	var children = tr.childNodes;
	tmpArray = originalColorArray[tr.rowIndex];
	if (tr.children) {
		for (var i=0;i < children.length; i++) {
			tr.children[i].bgColor=tmpArray[i];
			if (tr.children[i].style.color == "#ffff00") {
				tr.children[i].style.color="red";
			} else {
				tr.children[i].style.color="000000";
			}
			if (tr.children[i].childNodes[0].nodeName == "A") {
				tr.children[i].childNodes[0].style.color="305E80";
			}
		}
	}
}





//-->

<!--------------- Menù ad albero ------------------>

function aprichiudi(item) {
   elem=document.getElementById(item);
   visibile=(elem.style.display!="none")
   prefisso=document.getElementById("menu" + item);
   if (visibile) {
     elem.style.display="none";
     prefisso.innerHTML="<img src='/images/new/icon_m_sx.gif' hspace='0' vspace='0' border='0' style='vertical-align:middle;'>";
   } else {
      elem.style.display="block";
      prefisso.innerHTML="<img src='/images/new/icon_m_sx_over.gif' hspace='0' vspace='0' border='0' style='vertical-align:middle;'>";
   }
}

//  popup per legge //

function popup(url) 
{ 
 
var winl = (screen.width-575); 
var wint = (screen.height-300)/2; 
settings='height=400,width=570,top='+wint+',left='+winl+',scrollbars=yes,toolbar=0,location=0,status=0,menubar=0,resizable=0,dependent=0,copyhistory=0' 

{ 
MyPopUp = window.open(url,"scheda",settings);
MyPopUp.focus();
} 
}

function finestra(url,wt,ht) 
{ 
 
var winl = (screen.width-391); 
var wint = 100; 
settings='height=' + ht + ',width=' + wt +',top=' + wint + ',left=' + winl +',scrollbars=yes,toolbar=0,location=0,status=0,menubar=0,resizable=0,dependent=0,copyhistory=0' 

{ 
Myfin = window.open(url,"scheda",settings);
Myfin.focus();



} 
}



/***********************************************
* Dynamic Ajax Content
***********************************************/

var bustcachevar=0 //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects=""
var rootdomain="http://"+window.location.hostname
var bustcacheparameter=""

function ajaxpage(url, containerid){


var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}

function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=page_request.responseText
}

function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}

function getById(id) { 
	return document.getElementById?document.getElementById(id):(document.all?document.all(id):null); 
	}

function hideDiv(id) { 
	getById(id).style.visibility = "hidden";        
	getById(id).style.display = "none"; 
	}
	
function showDiv(id) {
	getById(id).style.visibility = ""; 
	getById(id).style.display = ""; 
}

function trova_marca(selObj) {
theStr ='<img src="/images/trasp.gif" width="1" height="12">';
document.getElementById('modello_form').innerHTML=theStr;
marca_form=selObj.options[selObj.selectedIndex].value;
ajaxpage('/ajax_mod.php?op=cerca_modello&marca_form=' + marca_form + '', 'modello_form');
}

function trova_modello(selObj) {
theStr ='<img src="http://www.motup.com/images/trasp.gif" width="1" height="12">';
document.getElementById('info_form').innerHTML=theStr;
var modello_form=selObj.options[selObj.selectedIndex].value;
ajaxpage('/ajax_mod.php?op=info_form&marca_form=' + marca_form + '&modello_form=' + modello_form + '', 'info_form');
}


 function MM_jumpMenu(targ,selObj,restore){ //v3.0
			   eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
			   if (restore) selObj.selectedIndex=0;
			 }
			 
			  function MM_jumpMenu_price(targ,selObj,restore){ //v3.0
			   eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
			   if (restore) selObj.selectedIndex=0;
			 }




function showThis(id){
	for (var i = 1; i <= 2; i++) {
          hideDiv(i + '_home');
     }
	showDiv(id);
}



