
var z = 0;
var y = 0;
var step = 0;


var  ie = ((document.all) && (window.offscreenBuffering)) ? true : false;
var  isNS = ((document.captureEvents) && (!document.getElementById)) ? true : false;
var  mozilla = ((document.getElementById) && (!document.all) && (document.documentElement)) ? true : false;
var  opera = ((document.getElementById) && (navigator.userAgent.indexOf('Opera') != -1)) ? true : false;
var isMacIE = ( (navigator.userAgent.indexOf("IE 4") > -1) && (navigator.userAgent.indexOf("Mac")  > -1) );


function get_browser(){

    if (ie){
        start = 'document.all["';
        end = '"].style';
    } else if (isNS){
        start = 'document.layers.scroll_window.document.layers["';
        end = '"]';
    } else if (mozilla || opera){
        start = 'document.getElementById("';
        end = '").style';
    }
}

function move(variable, type){

	if (type == "home"){
    var div = "scroll_content";
    var div_scroll = "scroll_balken";
	}
	if (type == "about"){
    var div = "scroll_content_about";
	}

    var hoehe = document.getElementById(div).offsetHeight;
	if(type == "home"){
    hoehe = hoehe - "290";
	}
	if(type == "about"){
	hoehe = hoehe - "430";
	}
    faktor = 150 / hoehe;
    y_2 = y;
    z_2 = z;
    y += variable;
    z += -(variable * faktor);
    
    if (y < -hoehe || y > 1){
    	y = y_2;
		z = z_2;
        eval(start + div + end + '.top="' + y + 'px"');
		
		if(type == "home"){
        eval(start + div_scroll + end + '.top="' + z + 'px"');
		}
    } else {

        eval(start + div + end + '.top="' + y + 'px"');
		
		if(type == "home"){
        eval(start + div_scroll + end + '.top="' + z + 'px"');
		}
    }
}


function scroll(variable, type){
	
    move(variable, type);
    c = type;
    i = variable;
    if ((step) && (y < 10)){
        setTimeout("scroll(i, c)", 20);
    }
}


