var pID = 0;
var linkArr = new Array();
linkArr[0] = "";
linkArr[1] = "";
linkArr[2] = "";
linkArr[3] = "";
linkArr[4] = "";
linkArr[5] = "";
linkArr[6] = "";
linkArr[7] = "";
linkArr[8] = "";

var totalOffers = 5;
var offerHeight = 93;
var scrollTop = (totalOffers - 4) *  offerHeight;
scrollTop = scrollTop + 200;
if (BrowserDetect.browser == "Explorer") {
	scrollTop = scrollTop + 23;
}

window.addEvent('domready', function(){

	var myFx = new Fx.Tween('scrollContent',{duration: '15000',transition: Fx.Transitions.linear});
	var myFx2 = new Fx.Tween('scrollContent',{duration: '0',transition: Fx.Transitions.linear});
	var marginN = "-" + scrollTop + "px";
	myFx.start('margin-top', marginN);

	myFx.addEvent('onComplete', function(e){
		//alert("finished the 1st tween");
		myFx2.start('margin-top', '-23px');
	});


	myFx2.addEvent('onComplete', function(e){
		//alert("finished the 2nd tween");
		myFx.start('margin-top', marginN);
	});

	$('n1').addEvents({		
		'mouseenter': function(){
			// Always sets the duration of the tween to 1000 ms and a bouncing transition
			// And then tweens the height of the element
			this.src = "images/nav/workwearb.jpg";
		},
		'mouseleave': function(){
			if (pID != 1) {
				this.src = "images/nav/workweara.jpg";
			}
		}
	});
	$('n2').addEvents({		
		'mouseenter': function(){
			// Always sets the duration of the tween to 1000 ms and a bouncing transition
			// And then tweens the height of the element
			this.src = "images/nav/sportswearb.jpg";
		},
		'mouseleave': function(){
			if (pID != 2) {		
				this.src = "images/nav/sportsweara.jpg";
			}
		}
	});
	$('n3').addEvents({		
		'mouseenter': function(){
			// Always sets the duration of the tween to 1000 ms and a bouncing transition
			// And then tweens the height of the element
			this.src = "images/nav/funandeventb.jpg";
		},
		'mouseleave': function(){
			if (pID != 3) {		
				this.src = "images/nav/funandeventa.jpg";
			}
		}
	});
	$('n4').addEvents({		
		'mouseenter': function(){
			// Always sets the duration of the tween to 1000 ms and a bouncing transition
			// And then tweens the height of the element
			this.src = "images/nav/hospitalityb.jpg";
		},
		'mouseleave': function(){
			if (pID != 4) {
				this.src = "images/nav/hospitalitya.jpg";
			}
		}
	});
	$('n5').addEvents({		
		'mouseenter': function(){
			// Always sets the duration of the tween to 1000 ms and a bouncing transition
			// And then tweens the height of the element
			this.src = "images/nav/koolartb.jpg";
		},
		'mouseleave': function(){
			if (pID != 5) {	
				this.src = "images/nav/koolarta.jpg";
			}
		}
	});
	$('n6').addEvents({		
		'mouseenter': function(){
			// Always sets the duration of the tween to 1000 ms and a bouncing transition
			// And then tweens the height of the element
			this.src = "images/nav/onlinebrochureb.jpg";
		},
		'mouseleave': function(){
			if (pID != 6) {
				this.src = "images/nav/onlinebrochurea.jpg";
			}
		}
	});
	$('n7').addEvents({		
		'mouseenter': function(){
			// Always sets the duration of the tween to 1000 ms and a bouncing transition
			// And then tweens the height of the element
			this.src = "images/nav/storeb.jpg";
		},
		'mouseleave': function(){
			if (pID != 7) {
				this.src = "images/nav/storea.jpg";
			}
		}
	});
	$('n8').addEvents({		
		'mouseenter': function(){
			// Always sets the duration of the tween to 1000 ms and a bouncing transition
			// And then tweens the height of the element
			this.src = "images/nav/aboutusb.jpg";
		},
		'mouseleave': function(){
			if (pID != 8) {
				this.src = "images/nav/aboutusa.jpg";
			}
		}
	});
	$('n9').addEvents({		
		'mouseenter': function(){
			// Always sets the duration of the tween to 1000 ms and a bouncing transition
			// And then tweens the height of the element
			this.src = "images/nav/findusb.jpg";
		},
		'mouseleave': function(){
			if (pID != 9) {
				this.src = "images/nav/findusa.jpg";
			}
		}
	});
	$('n10').addEvents({		
		'mouseenter': function(){
			// Always sets the duration of the tween to 1000 ms and a bouncing transition
			// And then tweens the height of the element
			this.src = "images/nav/contactb.jpg";
		},
		'mouseleave': function(){
			if (pID != 10) {
				this.src = "images/nav/contacta.jpg";
			}
		}
	});

});