var pic = new Array()
var img2= new Array()

pic[0] = new banner("3ddgames/racing/Pimp%20My%20Ride/jocuri2.jpg", 113, "/spiele-3d-shockwave-Pimp-My-Ride.htm", "Pimp My Ride MTV-Spiel ", "Pimp My Ride MTV-Spiel ");pic[1] = new banner("3ddgames/action/Munch%20Madness/jocuri2.jpg", 113, "/spiele-3d-shockwave-Munch-Madness.htm", "action games online ", "action games online ");pic[2] = new banner("3ddgames/action/Police%20Chopper/jocuri2.jpg", 113, "/spiele-3d-shockwave-Police-Chopper.htm", "Shockwave 3D-Spiel mit einem Polizei-Hubschrauber, wie ein Flugzeug zu fliegen ", "Shockwave 3D-Spiel mit einem Polizei-Hubschrauber, wie ein Flugzeug zu fliegen ");pic[3] = new banner("3ddgames/puzzle/Carnival%20Jackpot/jocuri2.jpg", 113, "/spiele-3d-shockwave-Carnival-Jackpot.htm", "Ballspiele 3d ", "Ballspiele 3d ");pic[4] = new banner("3ddgames/puzzle/Pokemon%20Memory/jocuri2.jpg", 113, "/spiele-3d-shockwave-Pokemon-Memory.htm", "Pokemon Memory Spiel Kinder ", "Pokemon Memory Spiel Kinder ");

function banner(name, width, link, alt, titlu){
	this.name = name
	this.width = width + 10
	this.link = link
	this.alt = alt;
	this.titlu = titlu;
}

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()",0)
	}	
}

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

for (ii=0;ii<kk;ii++){
document.write("<a href = " + pic[ii].link + " target=\"_parent\" title=\"" + pic[ii].titlu + "\"><img class=\"bordura\" alt=\"" + pic[ii].alt + "\" style=position:absolute;top:0;left:" + myLeft[ii]  + "; src=" + pic[ii].name + " onMouseOver=stop() onMouseOut=go()></a>")
}