/**
 * zwobNewsRotator v1.0
 *
 * 23.10.2009 09:42:00
 */
var zwobNewsRotator = {

	interval:5000,

	init:function () {

		this.switchRotate(true);

		$("#News1").bind("mouseover", function() {zwobNewsRotator.switchRotate(false);} ).bind("mouseout", function() {zwobNewsRotator.switchRotate(true);} )
		$("#News2").bind("mouseover", function() {zwobNewsRotator.switchRotate(false);} ).bind("mouseout", function() {zwobNewsRotator.switchRotate(true);} )

		// Starten mit News1
		this.activate(1);

	},
	activate:function(n) {

		if (!this.bRotate) return;

		if (n==1) {
			$("#News1").fadeIn("slow");
			$("#News2").fadeOut("slow");
			$("#News3").fadeOut("slow");
		}
		else if (n==2) {
			$("#News2").fadeIn("slow");
			$("#News3").fadeOut("slow");
			$("#News1").fadeOut("slow");

		}
	},
	switchRotate:function(b) {
		this.bRotate = b;
	},

	// Hilfsvariabel:Aktive News
	nc:0,	
	// Rotation durch Timeout-Steuerung
	doRotate:function() {
		this.nc++;
		if(this.nc>2) this.nc=1;
		
		zwobNewsRotator.activate(this.nc);
		setTimeout( "zwobNewsRotator.doRotate()", this.intervall );
	},
	// Rotationsintervall im Millisekunden setzen
	setIntervall:function(ms) {
		this.intervall = ms;
	}
}
