/**
* Simple Horizontal Scroll v0.1
* By: me@daantje.nl
* last update: Sun Dec 24 00:13:19 CET 2006
*
*	Documentation: Copy & paste
*	License: LGPL
*	Support: some.
*/

var scrllTmr;
var counter = 0;
var totalCount = 5;
var lftHldr = 0;
var pauseScroll = 0;
var lft = 0;
var w = 0;
var cw = 0;
function windowscroll(){
	
	if(document.getElementById('scroll') != null){
		//set style
		document.getElementById('scroll').style.overflow = 'hidden';
		document.getElementById('scrollevent'+counter).style.float = 'left';
		document.getElementById('scrollevent'+counter).style.position = 'relative';
	
		//get canvas
		document.getElementById('scrollevent'+counter).style.display = "inline";
		cw = parseInt(document.getElementById('scroll').offsetWidth);
		w = parseInt(document.getElementById('scrollevent'+counter).offsetWidth);
		//start scroll
		lft = w;
		
		document.getElementById('scrollevent'+counter).style.left = lft + "px";
		scrollStep(cw,w,lft);
	}
}
function scrollStep(cw,w,lft){
		
		//calc and do step
		if(lft == 0 || lft == 1){
			setTimeout('scrollStep(cw,w,' + (lft - 1) + ')',3000);
			return;
		}
		if(lft < (w * -1)){
			document.getElementById('scrollevent'+counter).style.display = "none";
			counter++;
			
			if(counter == totalCount){
				counter = 0;
			}
			if(document.getElementById('scrollevent'+counter) == null) {
				counter = 0;
			}
			document.getElementById('scrollevent'+counter).style.display = "inline";
			w = parseInt(document.getElementById('scrollevent'+counter).offsetWidth);
			lft = w;
		}
		document.getElementById('scrollevent'+counter).style.left = lft + "px";
		//wait and do next...
		if(scrllTmr){
			clearTimeout(scrllTmr)
		}
		scrllTmr = setTimeout('scrollStep(cw,w,' + (lft - 2) + ')',1);
		
}










var scrllTmr1;
var lftHldr1 = 0;
var pauseScroll1 = 0;
function windowscroll1(){
	if(document.getElementById('scroll1') != null){
		//set style
		document.getElementById('scroll1').style.overflow = 'hidden';
		document.getElementById('scrollme1').style.float = 'left';
		document.getElementById('scrollme1').style.position = 'relative';
	
		//get canvas
		document.getElementById('scrollme1').style.display = "inline";
		cw1 = parseInt(document.getElementById('imgLeft').offsetWidth);
		w1 = parseInt(document.getElementById('scrollme1').offsetWidth);
		//start scroll
		lft1 = cw1;
		document.getElementById('scrollme1').style.left = lft1 + "px";
		scrollStep1(cw1,w1,lft1);
		
	}
}
function scrollStep1(cw1,w1,lft1){
		//calc and do step
		if(lft1 < w1 * -1){
			document.getElementById('scrollme1').style.display = "none";

			document.getElementById('scrollme1').style.display = "inline";
			w1 = parseInt(document.getElementById('scroll1').offsetWidth);
			lft1 = w1;
		}
		document.getElementById('scrollme1').style.left = lft1 + "px";
		//wait and do next...
		if(scrllTmr1){
			clearTimeout(scrllTmr1)
		}
		scrllTmr1 = setTimeout('scrollStep1(cw1,w1,' + (lft1 - 1) + ')',20);
}