function gebi(id) {
	return document.getElementById(id);
}

String.prototype.trim = function(){return this.replace(/^\s+/,'').replace(/\s+$/,'')}
function GetCookie (name) {
        var cookies = document.cookie.split(/[=;]/)
        for (var i=0; i<cookies.length-1; i+=2) {
                if(name.trim() == cookies[i].trim()) return unescape(cookies[i+1])
        }
        return null
}
function SetCookie (name, value) {
        var str = name + "=" + value
        for(var i=2; i<arguments.length; i++){
                var arg = arguments[i]
                switch (i){
                        case 2:
                                if (typeof(arg) != 'undefined') {
                                        if (typeof(arg) != 'object') {
                                                var s=1000, m=60*s, h=60*m, d=24*h, mon=30*d, y=12*mon
                                                arg = new Date(new Date().getTime() + eval('0' + arg.toString().toLowerCase().replace(/([0-9]+)([a-z]+)/g,'$1*$2')))
                                        }
                                        str += "; expires=" + arg.toGMTString()
                                }
                                break
                        case 3:
                                str += "; path=" + arg
                                break
                        case 4:
                                str += "; domain=" + arg
                                break
                        case 5:
                                str += "; secure"
                                break
                }
        }
        document.cookie = str
}
function DeleteCookie(name) {
        SetCookie(name, GetCookie (name), -1)
}

var l = GetCookie('loginc');

function setLogin(l) {
  if(l) {
    if(document.getElementById('login')) document.getElementById('login').value = l;
    if(document.getElementById('pwd')) document.getElementById('pwd').focus();
  };
};
