/**
* Animate pioniers header... no rocket science here!
*	by me@daantje.nl
*/

//1548px - 967px = 581px
//200 - 163 = 37



var step = 0;
var l = '';
var gg = 0;
var tstep = 500;
var headerTmr;

var lastX = 0

function animateHeader(){
	//move background... look at the msie sollution... hate msie!
	if(l == 'left')
		step--;
	else
		step++;

	obj = document.getElementById('headerBackground');
    if(!document.all){
		obj.style.left = step + 'px';
		obj.style.top = '0px';
		ieT = ieR = ieB = ieL = null;
  	}else{
		ieT = 0;
		ieR = step + 967;
		ieB = 163;
		ieL = step;

     	obj.style.clip = "rect("+ieT+" "+ieR+" "+ieB+" "+ieL+")";
		obj.style.left = ((ieL * -1) + document.getElementById('container').offsetLeft) + 'px';
    	obj.style.width = ieR + 'px';
    }

	//move puppet...
	gg++;
	if(gg==3){
		if(document.all){
			if(l == 'left')
				tstep++;
			else
				tstep--;
		}else{
			if(l == 'left')
				tstep--;
			else
				tstep++;
        }
        gg=0;
	}

	obj2 = document.getElementById('header_l2');
	obj2.style.left = (tstep + document.getElementById('container').offsetLeft) + 'px';

	//switch direction
	if(step == -581 || ieR == 967)
		l = 'right';
	else if(step == 0 || ieR == 1548)
		l = 'left';
}



//start the animation onload...
window.onload = function(){
/*
	if(document.all)
		l = 'right';
    else
		l = 'left';
//    animateHeader();      //don't anim, just place... have memory leak! &*^%!@#&*
	//do next step...
 	if(headerTmr)
 		headerTmr = window.clearInterval(headerTmr);
  	headerTmr = window.setInterval(function(){animateHeader();},10);
*/
}