// JavaScript Document
	function olss_hide(id) {
		document.getElementById('olss-hide-' + id).style.display = 'none';
		document.getElementById('olss-show-' + id).style.display = 'inline';
		document.getElementById(id).style.display = 'none';
	}

	function olss_show(id) {
		document.getElementById('olss-hide-' + id).style.display = 'inline';
		document.getElementById('olss-show-' + id).style.display = 'none';
		document.getElementById(id).style.display = 'inline';
	}

function valida(){

   EmailAddr = document.FormInvioDati.email.value;
   Filtro = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
    if (Filtro.test(EmailAddr))
			
		  if (FormInvioDati.privacy.checked == false )
		  {
			alert('L\'invio del modulo prevede il trattamento dei dati personali, come specificato in basso. ' +
				  '\nSelezionate la casella di controllo relativa alla privacy (art. 13 del 30.06.2003, n.196)');
		
			return false;
		  } else
			return true;	

   else
      {
      alert("Controlla l'indirizzo e-mail inserito.\nNon sembra essere valido.");
      document.FormInvioDati.email.focus();
      return false;
      }
}


//Finestre sendmail
function sendmail(to1,to2) {
	var string="mailto:"+to1+"@"+to2;
	document.location=string;
}

//Finestre popup
function openwin(url, windowname, atrib) {
    window.open(url, windowname, atrib);
}

//codice Form
function autoTab(e) {
    if(this.value.length == this.getAttribute("maxlength") && 
        e.KeyCode != 8 && e.keyCode != 16 && e.keyCode != 9) {
            new Field.activate(findNextElement(this.getAttribute("tabindex")));
        }
}

function findNextElement(index) {
    elements = new Form.getElements('shippingInfo');
    for(i = 0; i < elements.length; i++) {
        element = elements[i];
        if(parseInt(element.getAttribute("tabindex")) == (parseInt(index) + 1)) {
            return element;
        }
    }
    return elements[0];
}

function apriimg(url,name,w,h)
{
val = 'width='+w+',height='+h+',scrollbars=0,resizable=0';
window.open(url, name, val);
}



