
var pic = new Array()

function banner(name, width, link){
	this.name = name
	this.width = width
	this.link = link
   }

pic[0] = new banner('slideshow/1.jpg',112,'slideshow/1.jpg')
pic[1] = new banner('slideshow/2.jpg',112,'slideshow/2.jpg')
pic[2] = new banner('slideshow/3.jpg',112,'slideshow/3.jpg')
pic[3] = new banner('slideshow/4.jpg',112,'slideshow/4.jpg')
pic[4] = new banner('slideshow/5.jpg',112,'slideshow/5.jpg')
pic[5] = new banner('slideshow/6.jpg',112,'slideshow/6.jpg')
pic[6] = new banner('slideshow/7.jpg',112,'slideshow/7.jpg')
pic[7] = new banner('slideshow/8.jpg',112,'slideshow/8.jpg')
pic[8] = new banner('slideshow/9.jpg',112,'slideshow/9.jpg')
pic[9] = new banner('slideshow/10.jpg',112,'slideshow/10.jpg')
pic[10] = new banner('slideshow/0.gif',112,'slideshow/0.gif')


var speed = 50

var kk = pic.length
var ii
var hhh
var nnn
var myInterval
var myPause
var mode = 0


var imgArray = new Array(kk)
var myLeft = new Array(kk)

for (ii=0;ii<kk;ii++){
imgArray[ii] = new Image()
imgArray[ii].src = pic[ii].name
imgArray[ii].width = pic[ii].width

	hhh=0 
	for (nnn=0;nnn<ii;nnn++){
		hhh=hhh+pic[nnn].width
	}
	myLeft[ii] = hhh
}

function ready(){
	for (ii=0;ii<kk;ii++){ 
		if (document.images[ii].complete == false){
			return false	
			break
		}
	}
return true
}


function startScrolling(){
	if (ready() == true){		
		window.clearInterval(myPause)
		myInterval = setInterval("autoScroll()",speed)	
	}
}	
	

function autoScroll(){
	for (ii=0;ii<kk;ii++){
		myLeft[ii] = myLeft[ii] - 1
		
	if (myLeft[ii] == -(pic[ii].width)){
		hhh = 0
		for (nnn=0;nnn<kk;nnn++){
			if (nnn!=ii){
				hhh = hhh + pic[nnn].width
			}			
		}
		myLeft[ii] =  hhh
	}
		
				
		document.images[ii].style.left = myLeft[ii]
	}
	mode = 1
}

function stop(){
	if (mode == 1){
		window.clearInterval(myInterval)
	}
	if (mode == 0){
		window.clearInterval(myPause)
	}	
}

function go(){
	if (mode == 1){
		myInterval = setInterval("autoScroll()",speed)
	}
	if (mode == 0){
		myPause = setInterval("startScrolling()",1000)
	}	
}

myPause = setInterval("startScrolling()",1000)


function clickIE4(){
if (event.button==2){
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("return false")

