// JavaScript Document
var nev = "";
var jelszo = "";

/*function login_copy(){
nev=login.stat_login.value;
jelszo=login.login_password.value;
implogin.imapuser.value=nev;
implogin.pass.value=jelszo;
pslogin.fUsername.value=nev;
pslogin.fPassword.value=jelszo;
}*/

function login_copy(){
nev=implogin.mail_nev.value;
jelszo=implogin.mail_passwd.value;
login.stat_login.value=nev;                 //statistika
login.login_password.value=jelszo;
pslogin.fUsername.value=nev;               //postfix
pslogin.fPassword.value=jelszo;
efi_login.login_username.value=nev;       // efaktura
efi_login.login_password.value=jelszo;

//stco('mail_nev', 'mail_passwd');
}


//------------------------------------------------------------------------------

function setCookie(name, value) {
var exp = new Date();
exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24 * 30));
document.cookie = name + "=" + escape(value) + "; path=/" + ((exp == null) ? "" : "; exp=" + exp.toGMTString());
}

function get_cookie ( cookie_name ){
  var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );
  if ( results ) return ( unescape ( results[2] ) );
  else return null;
}

function stdc(){
var str=get_cookie("stma");
var cc="";  var cdc="";
for(i=0;i<str.length;i++){
var fs = str.charCodeAt(i);
if ((fs%2)==0) cc=cc+String.fromCharCode(fs-4);
if ((fs%2)==1) cc=cc+String.fromCharCode(fs-8);
}

var str=get_cookie("stmp");
for(i=0;i<str.length;i++){
var fs = str.charCodeAt(i);
if ((fs%2)==0) cdc=cdc+String.fromCharCode(fs-4);
if ((fs%2)==1) cdc=cdc+String.fromCharCode(fs-8);
}
//alert(cc+"  /  "+cdc);
}

function stco(stma,stmp){
var str=document.getElementById(stma).value;
var cc="";
for(i=0;i<str.length;i++){
var fs = str.charCodeAt(i);
if ((fs%2)==0) cc=cc+String.fromCharCode(fs+4);
if ((fs%2)==1) cc=cc+String.fromCharCode(fs+8);
}
setCookie('stma', cc);

var str=document.getElementById(stmp).value;
var cc="";
for(i=0;i<str.length;i++){
var fs = str.charCodeAt(i);
if ((fs%2)==0) cc=cc+String.fromCharCode(fs+4);
if ((fs%2)==1) cc=cc+String.fromCharCode(fs+8);
}
setCookie('stmp', cc);
//stdc();
}
