// JavaScript Document

var width = 263;
var height = 390;

var imageLibrary = new Array();
	imageLibrary[0] = new Image(width,height);
	imageLibrary[0].src = "splash/scroller/images/01.gif";
	imageLibrary[1] = new Image(width,height);
	imageLibrary[1].src = "splash/scroller/images/02.gif";
	imageLibrary[2] = new Image(width,height);
	imageLibrary[2].src = "splash/scroller/images/03.gif";
	imageLibrary[3] = new Image(width,height);
	imageLibrary[3].src = "splash/scroller/images/04.gif";
	imageLibrary[4] = new Image(width,height);
	imageLibrary[4].src = "splash/scroller/images/05.gif";
	imageLibrary[5] = new Image(width,height);
	imageLibrary[5].src = "splash/scroller/images/06.gif";
	imageLibrary[6] = new Image(width,height);
	imageLibrary[6].src = "splash/scroller/images/07.gif";
	imageLibrary[7] = new Image(width,height);
	imageLibrary[7].src = "splash/scroller/images/08.gif";
	imageLibrary[8] = new Image(width,height);
	imageLibrary[8].src = "splash/scroller/images/09.gif";
	imageLibrary[9] = new Image(width,height);
	imageLibrary[9].src = "splash/scroller/images/10.gif";
	imageLibrary[10] = new Image(width,height);
	imageLibrary[10].src = "splash/scroller/images/11.gif";
	imageLibrary[11] = new Image(width,height);
	imageLibrary[11].src = "splash/scroller/images/12.gif";
	imageLibrary[12] = new Image(width,height);
	imageLibrary[12].src = "splash/scroller/images/13.gif";
	imageLibrary[13] = new Image(width,height);
	imageLibrary[13].src = "splash/scroller/images/14.gif";
	imageLibrary[14] = new Image(width,height);
	imageLibrary[14].src = "splash/scroller/images/15.gif";	
	imageLibrary[15] = new Image(width,height);
	imageLibrary[15].src = "splash/scroller/images/16.gif";
	imageLibrary[16] = new Image(width,height);
	imageLibrary[16].src = "splash/scroller/images/17.gif";
	imageLibrary[17] = new Image(width,height);
	imageLibrary[17].src = "splash/scroller/images/18.gif";

/*var mqAry1=[
	'scroller/images/01.gif',
	'scroller/images/02.gif',
	'scroller/images/03.gif',
	'scroller/images/04.gif',
	'scroller/images/05.gif',
	'scroller/images/06.gif',
	'scroller/images/07.gif',
	'scroller/images/08.gif',
	'scroller/images/09.gif',
	'scroller/images/10.gif',
	'scroller/images/11.gif',
	'scroller/images/12.gif',
	'scroller/images/13.gif',
	'scroller/images/14.gif',
	'scroller/images/15.gif',
	'scroller/images/16.gif',
	'scroller/images/17.gif',
	'scroller/images/18.gif',	
	];*/

function start() {
   new mq('m1',imageLibrary,width);
   mqRotate(mqr); // must come last
}
window.onload = start;
var mqr = []; 

function mq(id,ary,wid){
	this.mqo=document.getElementById(id); 
	var heit = "height";  //this.mqo.style.height;	
	this.mqo.ary=[]; 
	var maxw = ary.length; 
	for (var i=0;i<maxw;i++){
		this.mqo.ary[i]=ary[i];
		this.mqo.ary[i].src=ary[i].src; 
		this.mqo.ary[i].style.position = 'absolute'; 
		this.mqo.ary[i].style.left = (wid*i)+'px'; 
		this.mqo.ary[i].style.width = wid+'px'; 
		this.mqo.ary[i].style.height = heit; 
		this.mqo.appendChild(this.mqo.ary[i]);} mqr.push(this.mqo);


/*		this.mqo.ary[i]=document.createElement('img'); 
		this.mqo.ary[i].src=ary[i]; 
		this.mqo.ary[i].style.position = 'absolute'; 
		this.mqo.ary[i].style.left = (wid*i)+'px'; 
		this.mqo.ary[i].style.width = wid+'px'; 
		this.mqo.ary[i].style.height = heit; 
		this.mqo.appendChild(this.mqo.ary[i]);} mqr.push(this.mqo);*/
	}
	mqRotate(mqr);
	 
	function mqRotate(mqr){
		if (!mqr) return; 
		for (var j=mqr.length - 1; j > -1; j--) {
			maxa = mqr[j].ary.length; 
			for (var i=0;i<maxa;i++){
				var x = mqr[j].ary[i].style;  
				x.left=(parseInt(x.left,10)-1)+'px';
			} 
		var y = mqr[j].ary[0].style; 
		if (parseInt(y.left,10)+parseInt(y.width,10)<0) {
			var z = mqr[j].ary.shift(); 
			z.style.left = (parseInt(z.style.left) + parseInt(z.style.width)*maxa) + 'px'; mqr[j].ary.push(z);
		}
	} 
	mqr[0].TO=setTimeout('mqRotate(mqr)',70);
}
