function connexion(){
login=document.getElementById('pass_pass').login.value;
password=document.getElementById('pass_pass').password.value;
s=document.getElementById('pass_pass').status.options[document.getElementById('pass_pass').status.selectedIndex].value;
if(document.getElementById('pass_pass').auto.checked) auto=1; else auto=0;
if(document.getElementById('pass_pass').https.checked) https=1; else https=0;
if(login==''||password==''){alert('Please enter a login and a password.');}else{
ajax();xhr.open('POST','/pass/login.php',false);
xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xhr.send('login='+login+'&password='+password+'&status='+s+'&auto='+auto);
if(xhr.readyState==4){message=xhr.responseText;if(message==1){if(https==1) window.location=window.location.href.replace(RegExp('http://','g'),'https://'); else window.location.reload();}else{alert(message);}}}}

function encrypt(){
if(document.getElementById('pass_pass').https.checked)
window.location=window.location.href.replace(RegExp('http://www.'||'https://','g'),'https://').replace(RegExp('http://','g'),'https://');
else window.location=window.location.href.replace(RegExp('https://','g'),'http://');}

function signup(){
document.getElementById('pass_signup').submit.disabled=true;
document.getElementById('pass_signup').submit.value='Validation loading';
login=document.getElementById('pass_signup').login.value;
pw1=document.getElementById('pass_signup').pw1.value;
pw2=document.getElementById('pass_signup').pw2.value;
if(login!='' && pw1!='' && pw2!='')
if(pw1!=pw2){alert('Caution!\nYou do not type the same passwords.\nPlease correct.');document.getElementById('pass_signup').submit.disabled=false;document.getElementById('pass_signup').submit.value='Validate';}
else{
ajax();xhr.open('POST','/pass/signup_en.php',false);
xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
xhr.send('login='+login+'&password='+pw1);
if(xhr.readyState==4){
re=xhr.responseText.split('#');
if(re[0]=='0'){document.getElementById('signup').innerHTML=re[1];}else{alert(re[0]);document.getElementById('pass_signup').submit.disabled=false;document.getElementById('pass_signup').submit.value='Validate';}}}}