/*-------------------------- BROWSER DETECTION --------------------------*/

function dom_browser() {
	// browser identification based on dom capabilities
	this.myNav = this.navigator;
	this.version = this.navigator.appVersion;
	this.name = this.navigator.appName;
	this.userAgt = this.navigator.userAgent;
	this.ns4 = (document.layers) ? true : false;
	this.ns6 = (this.navigator.userAgent.indexOf("Netscape6") != -1) ? true : false;
	this.dom = (document.getElementById) ? true : false;
	this.ie4 = (document.all) ? true : false;
	this.mac = (this.version.indexOf("Mac") != -1) ? true : false;
	this.ie = (this.version.indexOf("MSIE") != -1) ? true : false;
	this.windows = (this.version.indexOf("Windows") != -1) ? true : false;
	this.hasPlugins = (this.navigator.plugins) ? true : false;
	this.ie6 = (this.version.indexOf("MSIE") != -1 && this.version.indexOf("6") != -1) ? true : false; 
	
	this.ie55 = (this.version.indexOf("MSIE 5.5") != -1) ? true : false;
	this.ie5 = (this.version.indexOf("MSIE 5.01") != -1) ? true : false;
	this.ns = (this.userAgt.indexOf("Netscape") != -1) ? true : false;
	this.ff = (this.userAgt.indexOf("Firefox") != -1) ? true : false;
	this.safari = (this.userAgt.indexOf("Safari") != -1) ? true : false;
}

dom_browser();


/*------------------------- CALL TWEEN SLIDE -------------------------*/

//var totalCharacters = 4;
var characterWidth = 490;
var currentCharacter = 0;
var totalVrNu = 0;
var t;
function moveRight(totalCharacters) {
	var myObj = document.getElementById("clientListWrap");
	if (myObj != null && typeof(myObj) != "undefined") {
	// element object exists..
		var fromX = 0 - eval(currentCharacter * characterWidth);
		if (currentCharacter > 0) {
			currentCharacter--;
		} else {
			currentCharacter = totalCharacters - 1;
		}
		var toX = 0 - eval(currentCharacter * characterWidth);
		//if IE 5.0
			if (ie5) {
				// just static move
				myObj.style.left = toX+'px';				
			} else {
				//tween move
				t1 = new Tween(myObj.style,'left',Tween.strongEaseOut,fromX,toX,0.8,'px');
				t1.start();
				//alert(myObj.style.left);
			}	
			startSlideShow(totalCharacters)			
	} else {
	// element not found..
	}
}

function moveLeft(totalCharacters) {
	
	var myObj = document.getElementById("clientListWrap");
	if (myObj != null && typeof(myObj) != "undefined") {
	// element object exists..
	//alert("schuif");
		var fromX = 0 - eval(currentCharacter * characterWidth);
		if (currentCharacter < totalCharacters -1) {
			currentCharacter++;
		} else {
			currentCharacter = 0;
		}
		var toX = 0 - eval(currentCharacter * characterWidth);
		// if IE 5.0
			if (ie5) {
				// just static move
				myObj.style.left = toX+'px';
			}
			else {
				//tween move
				t1 = new Tween(myObj.style,'left',Tween.strongEaseOut,fromX,toX,0.8,'px');
				t1.start();
				//alert(myObj.style.left);
			}
			startSlideShow(totalCharacters)
	} else {
	// element not found..
	}
}

function moveLeftSlide(totalCharacters) {
	
	var myObj = document.getElementById("clientListWrap");
	if (myObj != null && typeof(myObj) != "undefined") {
	// element object exists..
	//alert("schuif");
		var fromX = 0 - eval(currentCharacter * characterWidth);
		if (currentCharacter < totalCharacters -1) {
			currentCharacter++;
		} else {
			currentCharacter = 0;
		}
		var toX = 0 - eval(currentCharacter * characterWidth);
		// if IE 5.0
			if (ie5) {
				// just static move
				myObj.style.left = toX+'px';
			}
			else {
				//tween move
				t1 = new Tween(myObj.style,'left',Tween.strongEaseInOut,fromX,toX,1.4,'px');
				t1.start();
				//alert(myObj.style.left);
			}
	} else {
	// element not found..
	}
}



function doAmove(){
	moveLeftSlide(totalVrNu);
	t= window.setTimeout('doAmove()',5000);
}

function startSlideShow(totalCharacters){
	clearTimeout(t);
	totalVrNu = totalCharacters;
	//var myInterval = window.setInterval(moveRight(totalCharacters)),3000);
	t = window.setTimeout('doAmove()',5000);
}
