t=0;
function move_up() {
		document.getElementById("scroll_clipper").scrollTop = document.getElementById("scroll_clipper").scrollTop - 1;
		t=setTimeout('move_up()',10);
}
function move_dn() {
		document.getElementById("scroll_clipper").scrollTop = document.getElementById("scroll_clipper").scrollTop + 1;
		t=setTimeout('move_dn()',10);
}
		function scroll_stop() {
		if (t) clearTimeout(t);
}


function MM_openBrWindow(theURL,winName,features) {
		window.open(theURL,winName,features);
}

var aux;
var pos=15;
function scroll() {
			if(document.all||document.getElementById){
					h=document.getElementById("myDiv1").offsetHeight;
					pos=pos-1;
					if(h==-pos){pos=0}
					document.getElementById("myDiv1").style.top=pos+"px";
					document.getElementById("myDiv2").style.top=pos+"px";
					
			}else{
					h=myDiv.offsetHeight;
					pos=pos-1;
					if (-pos>h)pos=280;
					myDiv.top=pos+"px";
			}
}

function selezionaImage(nome){
	document.getElementById('img1').src='images/'+nome;
}

function deselezionaImage(){
	document.getElementById('img1').src='images/ruote.jpg';
}

function trim(stringa){
    var newstr = stringa + "";
    newstr = lTrim(newstr);
    newstr = rTrim(newstr);
    return newstr;
}

function lTrim(stringa){
    var newstr = stringa + "";
    while(newstr.charAt(0) == " ") 
        newstr = newstr.substring(1, newstr.length);    
    return newstr;
}

function rTrim(stringa){
    var newstr = stringa + "";
    while(newstr.charAt(newstr.length - 1) == " ") 
        newstr = newstr.substring(0, newstr.length - 1);    
    return newstr;
}

function convalida_email(mail){
	if (trim(mail)=='')return false;
		var espressione = /^[_a-z0-9+-]+(\.[_a-z0-9+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/;	
		if (espressione.test(mail))return true;
		else return false;
}
													 
