function CIntro() {
	var m_aImages;
	var m_iCount;
	var m_iIsRight;
	var m_iWaitTimeSlow;
	var m_iWaitTimeLong;
	var m_oTimeout;
	this.m_iIsRight = 0;
	this.m_iCount = 0;
	this.m_iWaitTimeSlow = 300;
	this.m_iWaitTimeLongOff = 1000;
	this.m_iWaitTimeLongOn = 5000;
	this.m_aImages = new Array();

	this.addGrafic = function(p_strTarget) {
		this.m_aImages[this.m_aImages.length] = p_strTarget;
	}

	this.preLoadGrafics = function() {
		var oBild;

		for ( var i = 0; i < this.m_aImages.length; i++) {
			// alert ("preload" + i)
			oBild = new Image(32, 32);
			oBild.src = this.m_aImages[i];
			document.getElementById('imgpreload').src = this.m_aImages[i];
		}
	}

	this.fadeInNext = function() {
		var myThis;
		// alert("fadeInNext" + this.m_iCount);
		// alert (this.m_iCount);
		if (this.m_iCount < this.m_aImages.length) {

			myThis = this;
			if (this.m_iIsRight == 0) {
				this.m_iIsRight = 1;
				document.getElementById('imgleft').src = this.m_aImages[this.m_iCount];
				this.m_iCount = this.m_iCount + 1;
				$("#imgleft").fadeIn("slow");
				this.m_oTimeout = window.setTimeout( function() {
					myThis.fadeInNext();
				}, myThis.m_iWaitTimeSlow);
			} else {
				this.m_iIsRight = 0;
				document.getElementById('imgright').src = this.m_aImages[this.m_iCount];
				this.m_iCount = this.m_iCount + 1;
				$("#imgright").fadeIn("slow");
				this.m_oTimeout = window.setTimeout( function() {
					myThis.fadeOutNext();
				}, myThis.m_iWaitTimeLongOn);
			}
		}
		else
		{
			this.m_iCount = 0;
			myThis = this;
			this.m_oTimeout = window.setTimeout( function() {
				myThis.fadeInNext();
			}, 0);
		}

	}

	this.fadeOutNext = function() {
		var myThis;
		var myUrl;
		// alert("fadeOutNext" + this.m_iCount);
		myThis = this;
		if (this.m_iIsRight == 0) {
			this.m_iIsRight = 1;
			myUrl = myThis.m_aImages[this.m_iCount];
			$("#imgleft")
					.fadeOut(
							"slow",
							function() {
								document.getElementById('imgleft').src = myUrl;
							});
			this.m_oTimeout = window.setTimeout( function() {
				myThis.fadeOutNext();
			}, 0);
		} else {
			this.m_iIsRight = 0;
			myUrl = myThis.m_aImages[this.m_iCount+1];
			$("#imgright")
					.fadeOut(
							"slow",
							function() {
								document.getElementById('imgright').src = myUrl;
							});
			this.m_oTimeout = window.setTimeout( function() {
				myThis.fadeInNext();
			}, myThis.m_iWaitTimeLongOff);
		}

	}

}

var g_oIntro = new CIntro();
// alert("new CIntro");
