/* DHTML START */
//browser testen
function browserDetector(){ 
    this.version = navigator.appVersion;
    this.dom = document.getElementById ? 1 : 0;
    this.ie5 = (this.version.indexOf("MSIE 5") > -1 && this.dom) ? 1 : 0; 
    this.ie4 = (document.all && !this.dom) ? 1 : 0; 
    this.ns5 = (this.dom && parseInt(this.version) >= 5) ? 1 : 0; 
    this.ns4 = (document.layers && !this.dom) ? 1 : 0; 
    this.browser = (this.ie5 || this.ie4 || this.ns4 || this.ns5);
	this.mac = ((this.version.indexOf("MAC") > -1) || (this.version.indexOf("Macintosh") > -1) || (this.version.indexOf("PPC") > -1)) ? 1 : 0;
	this.pc = !this.mac;
    return this;
} 

bd = new browserDetector();
var speed=80;
var loop, timer;
var initialised;
var stepCount = 0;
 
function MakeObject(obj,nest){ 
    nest = (!nest) ? '' : 'document.' + nest + '.'; 
    this.element = bd.dom ? document.getElementById(obj) : bd.ie4 ? document.all[obj] : bd.ns4 ? eval(nest+'document.'+obj) : 0; 
    this.css = bd.dom ? document.getElementById(obj).style : bd.ie4 ? document.all[obj].style : bd.ns4 ? eval(nest+'document.'+obj) : 0; 
    this.scrollHeight = bd.ns4 ? this.css.document.height : this.element.offsetHeight;
    this.clipHeight = bd.ns4 ? this.css.clip.height : this.element.offsetHeight;
    
	this.scrollWidth = bd.ns4 ? this.css.document.width : this.element.offsetWidth;
    this.clipWidth = bd.ns4 ? this.css.clip.width : this.element.offsetWidth;	
    this.left = MoveAreaLeft;
    this.right = MoveAreaRight; 	
    this.up = MoveAreaUp;
    this.down = MoveAreaDown; 
    this.MoveArea = MoveArea; 
    this.x; 
    this.y; 
    this.obj = obj + "Object";
    eval(this.obj + "=this"); 
    return this;
}

function MoveArea(x,y){
    this.x = x;
	this.y = y; 
    this.css.left = this.x; 
    this.css.top = this.y; 
} 
 
function MoveAreaRight(move, imageid){
	if(this.x > -this.scrollWidth + objContainer.clipWidth && stepCount < 10){ 
		stepCount++;
	    	this.MoveArea(this.x - move,0);
   		if(loop) setTimeout(this.obj + ".right(" + move + ", " + imageid + ")", speed);
	} else {
		stepCount = 0;
		showSIMG(refSIMG[imageid]);
	}
} 

function MoveAreaLeft(move, imageid){
	if(this.x < 0 && stepCount < 10){ 
		stepCount++;
	    	this.MoveArea(this.x - move,0); 
   		if(loop) setTimeout(this.obj + ".left(" + move + ", " + imageid + ")", speed);
	} else {
		stepCount = 0;
		showSIMG(refSIMG[imageid]);
	}
} 
 
function MoveAreaDown(move){
	if(this.y > -this.scrollHeight + objContainer.clipHeight){ 
	    this.MoveArea(0,this.y - move);
   		if(loop) setTimeout(this.obj + ".down(" + move + ")", speed);
	} 
} 

function MoveAreaUp(move){ 
	if(this.y < 0){ 
	    this.MoveArea(0, this.y - move); 
   		if(loop) setTimeout(this.obj + ".up(" + move + ")", speed);
	} 
}  
 
function PerformScroll(speed, direction, imageid){
	if(initialised){ 
		loop = true;
		if (direction == 'up') objScroller.up(speed);
		if (direction == 'down') objScroller.down(speed);
		if (direction == 'left') objScroller.left(speed, imageid);
		if (direction == 'right') objScroller.right(speed, imageid);						
		//if(speed > 0) objScroller.down(speed);
		//else objScroller.up(speed);
	} 
} 
 
function CeaseScroll(){ 
    loop = false;
    if(timer) clearTimeout(timer); 
} 
/* DHTML ENDE */
