var pID = 0;
var linkArr = new Array();
linkArr[0] = "";
linkArr[1] = "";
linkArr[2] = "<div style='float:left;height:20px;width:242px'></div><a href='tribute550.htm' title='Tribute 550'>Tribute 550</a><a href='carioca646.htm' title='Carioca 694'>Carioca 694</a><a href='rollerteam600.htm' title='Roller Team 600'>Roller Team 600</a><a href='carioca656.htm' title='Carioca 656'>Carioca 656</a>";
linkArr[3] = "";
linkArr[4] = "<div style='float:left;height:20px;width:282px'></div><a href='hireprices.htm' title='Vehicle Hire'>Vehicle Hire</a><a href='#' title='Trailer Hire'>Trailer Hire</a><a href='addedextras.htm' title='Added extras'>Added extras</a><a href='#' title='Special offers'>Special offers</a><a href='meetandgreet.htm' title='Meet and greet'>Meet and greet</a>";
linkArr[5] = "";
linkArr[6] = "";
linkArr[7] = "";
linkArr[8] = "";

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

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


	var myFx = new Fx.Tween('scrollContent',{duration: '24000',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', '0px');
	});

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

	$('n1').addEvents({		
		'mouseenter': function(){
			this.src = "images/homeb.jpg";
		},
		'mouseleave': function(){
			if (pID != 1) {
				this.src = "images/homea.jpg";
			}
		}
	});
	$('n2').addEvents({		
		'mouseenter': function(){
			this.src = "images/aboutb.jpg";
		},
		'mouseleave': function(){
			if (pID != 2) {		
				this.src = "images/abouta.jpg";
			}
		}
	});
	$('n3').addEvents({		
		'mouseenter': function(){
			this.src = "images/motorhomesb.jpg";
		},
		'mouseleave': function(){
			if (pID != 3) {		
				this.src = "images/motorhomesa.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/trailerb.jpg";
		},
		'mouseleave': function(){
			if (pID != 4) {
				this.src = "images/trailera.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/hirepricesb.jpg";
		},
		'mouseleave': function(){
			if (pID != 5) {	
				this.src = "images/hirepricesa.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/motorhomesforsaleb.jpg";
		},
		'mouseleave': function(){
			if (pID != 6) {
				this.src = "images/motorhomesforsalea.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/galleryb.jpg";
		},
		'mouseleave': function(){
			if (pID != 7) {
				this.src = "images/gallerya.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/faqsb.jpg";
		},
		'mouseleave': function(){
			if (pID != 8) {
				this.src = "images/faqsa.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/contactusb.jpg";
		},
		'mouseleave': function(){
			if (pID != 9) {
				this.src = "images/contactusa.jpg";
			}
		}
	});

	$('specials').addEvents({		
		'click': function(){
			window.location = "http://www.xplore-it-uk.com/specialoffers.htm";
		}
	});

	$('fakeStoreButton').addEvents({		
		'click': function(){
			window.location = "http://www.xplore-it-uk.com/astore.htm";
		}
	});
});