var aktiv1 = null;
var aktiv2 = null;
var aktiv3 = null;

function getElement(e) {
	return document.getElementById(e);
}

function showLogin() {    
    var lb = getElement('loginbutton');
    lb.style.height = parseInt(lb.offsetHeight) + "px"
    lb.style.overflow = "hidden";
    lb.style.whiteSpace = "nowrap";
    aktiv2 = window.setInterval("LoginButtonShrink()", 10);
}
var c = 0;
function LoginButtonShrink() {
    var lb = getElement('loginbutton');    

    var h = parseInt(lb.style.height)-1;
    if ( h <= 0 ) h = 0;

    lb.style.height = h+"px";
        
    if ( h <= 0 ) {
        window.clearInterval(aktiv2);
        lb.style.display = 'none';
        var lf = getElement('loginform');
        lf.style.overflow = "hidden";
        lf.style.width = "1px";
        lf.style.display = 'block';
        lf.style.whiteSpace = "nowrap";
        aktiv2 = window.setInterval("LoginFormGrow()", 10);
    }
}

function LoginFormGrow() {
    var lf = getElement('loginform');

    var w = parseInt(lf.style.width)+5;
    lf.style.width = w+"px";
    
    if ( w >= 479 ) {
        window.clearInterval(aktiv3);
        lf.style.width="";
    }
}

function PwContainerShow() {
	var e = getElement('pwContainer');
	
    if ( e.style.display != 'none' ) return;

	e.style.overflow = "hidden";
	e.style.height = "1px";
	e.style.display = 'block';
	
    aktiv1 = window.setInterval("PwContainerGrow()", 10);
}

function PwContainerGrow() {
	var e = getElement('pwContainer');
	var w = parseInt(e.style.height)+2;
	e.style.height = w+"px";
	
	if ( w > 75 ) {
	    window.clearInterval(aktiv1);
	    e.style.height = "";
	}
}

/* Popups oeffnen */
var w         = 700;
var h         = 450;
var scrolling = "scrollbars=yes";
var menubar   = "menubar=yes";
function MyNewWindow( mypage, myname ) {
	if (myname =="agb") {
		var w = 700;
		var h = 450;
	}
	var settings = 'height='+h+',width='+w+','+scrolling+','+menubar+',resizable=no';
	window.open(mypage,myname,settings);
}

/*Promotion mittels Thickbox - onload*/
function timeout() {
	window.setTimeout('promotion()', 1500);
}
function promotion() {
	tb_show('Titel', '#TB_inline?height=400&width=380&inlineId=deactivate', false);
}


