     Fx.Properties = Fx.Styles.extend({
	increase: function(){
		for (var p in this.now) this.element[p] = this.now[p];
	}
});

Fx.FlyingScroller = Fx.Properties.extend({
	initialize: function(el, options){
		this.parent(el, options);
		this.options = Object.extend(this.options || {}, Object.extend({
			paddingLeft: 0,
			paddingTop: 0
		}, options || {}));
	},

	toElement: function(el, paddingLeft, paddingTop){
		this.goTo(el.offsetLeft - (paddingLeft || this.options.paddingLeft || 0), el.offsetTop - (paddingTop || this.options.paddingTop || 0));
	},

	goTo: function(x, y){
		this.custom({
			'scrollLeft': [this.element.scrollLeft, x],
			'scrollTop': [this.element.scrollTop, y]
		})
	}
});

// global mouse variables
//var activeFrameIndex = 1;
//var maxFrameIndex    = 13;

//function set Subnavigation Elemente aus Schwarz
function allblack() {
	for (var i = 1; i <= maxFrameIndex; i++) {
		var idText = 'subnav' + i;
	//	alert(idText);
		document.getElementById(idText).style.color = "black";
		document.getElementById(idText).style.backgroundColor = "white";
	}
	document.getElementById("subnav" + activeFrameIndex).style.color = "white";
	document.getElementById("subnav" + activeFrameIndex).style.backgroundColor = "#00763B";
}
// funtion to change the variable "active" up or down
function getNewFrameIndex( wheelDelta ) {
    if ( ( wheelDelta > 0 ) && ( activeFrameIndex > 1 ) ) {
        activeFrameIndex--;
    } else if ( ( wheelDelta < 0 ) && ( activeFrameIndex < maxFrameIndex ) )  {
        activeFrameIndex++;
    }
    return activeFrameIndex;
}

function handle( delta ) {
    var s = delta + ": ";
    var activeFrameName = "content" + getNewFrameIndex( delta );
	//alert(delta);
    panel.clearTimer().toElement($(activeFrameName));
	allblack()
}

function wheel( event ) {
	var delta = 0;
	if (scrolling > 0) {
		try{
			new Ajax('http://www.wagnerwagner.de/scrollcheck.php', {method: 'post', data: '&id=' + scrollingID + '&Wert=2'}).request();;
	 	}
		finally{
		
		}
		scrolling = 0;
	}
	if ( !event ) event = window.event;
	if ( event.wheelDelta ) {
		delta = event.wheelDelta/120;
		if ( window.opera ) delta = -delta;
	} else if ( event.detail ) {
		delta = -event.detail/3;
	}
	if ( delta ) handle( delta );
}

function scrollStats() {
	if (Navigation > 0) {
		try{
			new Ajax('http://www.wagnerwagner.de/scrollcheck.php', {method: 'post', data: '&id=' + scrollingID + '&Wert2=2'}).request();;
	 	}
		finally{
		
		}
		Navigation = 0;
	}
}

//start event listener

window.onload=function(){
	//Wheel Funktionen
	if ( window.addEventListener ) window.addEventListener( 'DOMMouseScroll', wheel, false );
	//window.onmousewheel = document.onmousewheel = wheel;
	document.onmousewheel = wheel;
	//window.onmousewheel = wheel;
	content = window.location.search;
	jumpto = content.replace("?jumpto=content", "");
	if(jumpto != "") {
		for (var i = 1; i < jumpto; i++) {
			handle( -0.3333333333333333333333);
		}
	} else {
		handle("1");
	}
	return false;
}

var scrollingID = Math.round(Math.random()*98765432);
var Wert = 1;
var scrolling = 1;
var Navigation = 1;
		try{
			new Ajax('http://www.wagnerwagner.de/scrollcheck.php', {method: 'post', data: '&id=' + scrollingID + '&Wert=1'}).request();;
		
	 	}
		finally{
		
		}





