// JavaScript Document - Slideshow & Open

var closeINT;
var closeDelay = 500;
var closeID = null;
var openID = null;

var imagePosition = 0;
var imageSpeed = 0;
var imageLength = 0;
var imageWindow = null;

function MoveImages(){
	if (imageSpeed == 0) return;
	imagePosition = ((imagePosition + imageSpeed) > (imageLength - 980)) ? (imageLength-980) : (imagePosition + imageSpeed);
	imagePosition = (imagePosition < 0) ? 0 : imagePosition;
	document.getElementById('rbBilderHolder').style.left = (0-imagePosition) + "px";
}

function SetSpeed(speedValue){
	imageSpeed = speedValue;
}

function Open(articleID, imageWidth, imageHeight){	
	if(imageWidth.length == 0 || imageHeight.length == 0) return false;
	imageWindow = window.open(BasePath + articleID + '.html', 'imageWindow', 'scrollbars=no,height=' + imageHeight + ',width=' + imageWidth + ',location=no,resizable=no,status=no,toolbar=no');
	imageWindow.focus();
}

function back() {
	if(window.name == "imageWindow") {window.close();} else {top.location.replace("http://www.renabrugger.de/");}
}
