//BOX LOGIN - NUOVO UTENTE
function showPan(){
		if (document.theForm.newUser[0].checked)
			{
				document.getElementById('newUserRegister').style.display="none";
				document.getElementById('textLogin').style.display="block";
			}
		else
			{
        document.getElementById('newUserRegister').style.display="block";
        document.getElementById('textLogin').style.display="none";
			}
		}
//POPUP PER LA HOME
function PopupUtil(myPage, wi, he) 
{       
  if (myPage=="../public/chiSiamo.html") {
    pippo = ajaxinclude('../public/chiSiamo.html','Profile')
  }
  else if (myPage=="../public/informativaPrivacy.html") {
    pippo = ajaxinclude('../public/informativaPrivacy.html','Profile')
  }
  else {
    window.open(myPage,"mail",'location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width='+wi+',height='+he+',top=100,left=100');
  }
}


function enableDiv(div0,div1){
  document.getElementById(div0).style.display="none";
  document.getElementById(div1).style.display="block";
  
}

function checkReg(){
  pwd1 = document.italianiRegisterForm.password.value;
  pwd2 = document.italianiRegisterForm.passwordConfirm.value;
  var obj = eval('document.italianiRegisterForm.trattamentoDati');
  if (pwd1.length<6) enableDiv('Login','pwdShort');
  else if (pwd1!=pwd2) enableDiv('Login','pwdError');
  else if (! obj.checked) enableDiv('Login','privacyError');
  else document.italianiRegisterForm.submit();
}

function showPrivacy(){
  enableDiv('Login','privacyInfo');
}


function checkInvite(){
  eMailFriend = document.FriendInviteForm.eMailFriend.value;
  if (eMailFriend.length==0) enableDiv('emailFriend','mailError');
  else xmlhttpPost('../engine/Person','FriendInviteForm');
}

function checkInvite1(){
  eMailFriend = document.FriendInviteForm.eMailFriend.value;
  if (eMailFriend.length==0) enableDiv('emailFriend','mailError');
  else document.FriendInviteForm.submit();
}
