
function getOverallX(oElement) {
	var iReturnValue = 0;
	while(oElement != null) {
		iReturnValue += oElement.offsetLeft;
		oElement = oElement.offsetParent;
	}
	return iReturnValue;
}
function getOverallY(oElement) {
	var iReturnValue = 0;
	while(oElement != null) {
		iReturnValue += oElement.offsetTop;
		oElement = oElement.offsetParent;
	}
	return iReturnValue;
}

function getParentX(oElement) {
	return oElement.offsetLeft;
}
function getParentY(oElement) {
	return oElement.offsetTop;
}

function step(val, step, timeout) {
	if (stop == 1) return;
	oCObj = $('obj'+objnr);
	if (!oInhalt.style.left || oInhalt.style.left=='undefined' || oInhalt.style.left=='NaN') {
		oInhalt.style.left = '0px';
	}
	val = parseInt(oInhalt.style.left)+step;

	oInhalt.style.left = val+'px';

	
	if (getParentX(oInhalt) <= -oCObj.width) {
	
		oInhalt.style.left = val+oCObj.width;
		objnr++;
		oInhalt.removeChild(oInhalt.childNodes[0]);
		addobj();
		setTimeout('step('+val+','+step+', '+timeout+')',timeout);
		return;
	}
	if (timeout>0)
		setTimeout('step('+val+','+step+', '+timeout+')',timeout);
}
function stopticker() {
	if (stop == 1) return;
	stop = 1;
	return;
}
function startticker() {
	if (stop != 1) return;
	stop = 0;
	step(0, -1, 1);
}
function initticker(val) {
	stop = 1;
	objcount = 0;
	for (i=0;i<val;i++) {
		addobj();
	}
}
function addobj() {
	pic = objcount%12;
	oInhalt.innerHTML = oInhalt.innerHTML+'<img id="obj'+objcount+'" class="test" src="img/wb'+pic+'.png">';
	objcount++;
}
function gettotalobjwidth() {
	val = 0;
	return val;
}