
function start_mq() {
   new mq('m1',mqAry1,restaurant);
   mqRotate(mqr);
}

// Continuous Image Marquee
// copyright 24th July 2008 by Stephen Chapman
// http://javascript.about.com
// permission to use this Javascript on your web page is granted
// provided that all of the code below in this script (including these
// comments) is used without any alteration
var mqr=[];
function mq(id,ary,restaurant){
	this.mqo=document.getElementById(id);
	var heit=this.mqo.style.height;
	this.mqo.onmouseout=function(){
		mqRotate(mqr);
	};
	this.mqo.onmouseover=function(){
		clearTimeout(mqr[0].TO);
	};
	this.mqo.ary=[];
	var maxw=ary.length;
	for(var i=0;i<maxw;i++){

		this.mqo.ary[i]=document.createElement('div');		
		this.mqo.ary[i].innerHTML='<a href="gallery.php?id='+restaurant+'"><img src="img.php?width=100&height=100&bg=ffffff&file='+ary[i]+'" border="0" class="mq_item"></a>';
		this.mqo.ary[i].style.position='absolute';
		this.mqo.ary[i].style.left=(120*i)+'px';
		this.mqo.ary[i].style.width='100px';
		this.mqo.ary[i].style.height=heit;
		this.mqo.appendChild(this.mqo.ary[i]);

	}
	mqr.push(this.mqo);
}

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)-1)+'px';
		}
		var y=mqr[j].ary[0].style;
		if(parseInt(y.left)+parseInt(y.width)<0){
			var z=mqr[j].ary.shift();
			z.style.left=(parseInt(z.style.left)+parseInt(z.style.width)*maxa+maxa*20)+'px';
			mqr[j].ary.push(z);
		}
	}
	mqr[0].TO=setTimeout('mqRotate(mqr)',10);
}
