//
// DEFINE GLOBAL VARIABLES
////////////////////////
var scootersMenuPosition = 0;
var openHeaderBox;
var fadeMenuBox;

//
// RANDOM FUNCTIONS
////////////////////////
function setSrc(target,newsrc) {$(target).src=newsrc;}

//
// MENU BUTTON FUNCTIONS
////////////////////////
function showMenuBox(action) {
	if (action=="hide") {openHeaderBox.start({'height': 40});}
	else {
		if ($('menu-box').hasClass(action)==false) {
			if (action!="motorcycles") {$('menu-box').removeClass('motorcycles');}
			if (action!="scooters") {$('menu-box').removeClass('scooters');}
			if (action!="electric-bikes") {$('menu-box').removeClass('electric-bikes');}
			if (action!="apparel") {$('menu-box').removeClass('apparel');}
			if (action!="accessories") {$('menu-box').removeClass('accessories');}
			$('menu-box').addClass(action);
			var menu = action + ".html";
			$('menu-box').load(menu);
		}
		if ($('header-box').getStyle('height').toInt()==40) {openHeaderBox.start({'height': 151});}
	}
}
function buildMenus() {
	$('content-box').addEvent('mouseenter', function(){showMenuBox('hide');});
	$('menu-motorcycles').addEvent('mouseenter', function(){showMenuBox('motorcycles');});
	$('menu-scooters').addEvent('mouseenter', function(){showMenuBox('scooters');});
	$('menu-electricbikes').addEvent('mouseenter', function(){showMenuBox('electric-bikes');});
	$('menu-apparel').addEvent('mouseenter', function(){showMenuBox('apparel');});
	$('menu-accessories').addEvent('mouseenter', function(){showMenuBox('accessories');});
}
// Build colors and photos for Motorcycles
function buildV3colors() {
	$('v3black').addEvent('mouseenter', function(){setSrc('v3colors','set/colors/v-3-black.jpg');});
	$('v3blue').addEvent('mouseenter', function(){setSrc('v3colors','set/colors/v-3-blue.jpg');});
	$('v3green').addEvent('mouseenter', function(){setSrc('v3colors','set/colors/v-3-green.jpg');});
	$('v3red').addEvent('mouseenter', function(){setSrc('v3colors','set/colors/v-3-red.jpg');});
	$('v3silver').addEvent('mouseenter', function(){setSrc('v3colors','set/colors/v-3-silver.jpg');});
	$('v3white').addEvent('mouseenter', function(){setSrc('v3colors','set/colors/v-3-white.jpg');});
	$('v3yellow').addEvent('mouseenter', function(){setSrc('v3colors','set/colors/v-3-yellow.jpg');});
}
function buildV3photos() {
	$('v3thumb01').addEvent('mouseenter', function(){setSrc('v3photos','set/photos/v-3-photo-01.jpg');});
	$('v3thumb02').addEvent('mouseenter', function(){setSrc('v3photos','set/photos/v-3-photo-02.jpg');});
	$('v3thumb03').addEvent('mouseenter', function(){setSrc('v3photos','set/photos/v-3-photo-03.jpg');});
	$('v3thumb04').addEvent('mouseenter', function(){setSrc('v3photos','set/photos/v-3-photo-04.jpg');});
	$('v3thumb05').addEvent('mouseenter', function(){setSrc('v3photos','set/photos/v-3-photo-05.jpg');});
	$('v3thumb06').addEvent('mouseenter', function(){setSrc('v3photos','set/photos/v-3-photo-06.jpg');});
	$('v3thumb07').addEvent('mouseenter', function(){setSrc('v3photos','set/photos/v-3-photo-07.jpg');});
	$('v3thumb08').addEvent('mouseenter', function(){setSrc('v3photos','set/photos/v-3-photo-08.jpg');});
	$('v3thumb09').addEvent('mouseenter', function(){setSrc('v3photos','set/photos/v-3-photo-09.jpg');});
	$('v3thumb10').addEvent('mouseenter', function(){setSrc('v3photos','set/photos/v-3-photo-10.jpg');});
}
function buildV5colors() {
	$('v5black').addEvent('mouseenter', function(){setSrc('v5colors','set/colors/v-5-black.jpg');});
	$('v5blue').addEvent('mouseenter', function(){setSrc('v5colors','set/colors/v-5-blue.jpg');});
	$('v5burgundy').addEvent('mouseenter', function(){setSrc('v5colors','set/colors/v-5-burgundy.jpg');});
	$('v5green').addEvent('mouseenter', function(){setSrc('v5colors','set/colors/v-5-green.jpg');});
	$('v5orange').addEvent('mouseenter', function(){setSrc('v5colors','set/colors/v-5-orange.jpg');});
	$('v5red').addEvent('mouseenter', function(){setSrc('v5colors','set/colors/v-5-red.jpg');});
	$('v5silver').addEvent('mouseenter', function(){setSrc('v5colors','set/colors/v-5-silver.jpg');});
	$('v5white').addEvent('mouseenter', function(){setSrc('v5colors','set/colors/v-5-white.jpg');});
	$('v5yellow').addEvent('mouseenter', function(){setSrc('v5colors','set/colors/v-5-yellow.jpg');});
}
function buildV5photos() {
	$('v5thumb01').addEvent('mouseenter', function(){setSrc('v5photos','set/photos/v-5-photo-01.jpg');});
	$('v5thumb02').addEvent('mouseenter', function(){setSrc('v5photos','set/photos/v-5-photo-02.jpg');});
	$('v5thumb03').addEvent('mouseenter', function(){setSrc('v5photos','set/photos/v-5-photo-03.jpg');});
	$('v5thumb04').addEvent('mouseenter', function(){setSrc('v5photos','set/photos/v-5-photo-04.jpg');});
	$('v5thumb05').addEvent('mouseenter', function(){setSrc('v5photos','set/photos/v-5-photo-05.jpg');});
	$('v5thumb06').addEvent('mouseenter', function(){setSrc('v5photos','set/photos/v-5-photo-06.jpg');});
	$('v5thumb07').addEvent('mouseenter', function(){setSrc('v5photos','set/photos/v-5-photo-07.jpg');});
	$('v5thumb08').addEvent('mouseenter', function(){setSrc('v5photos','set/photos/v-5-photo-08.jpg');});
	$('v5thumb09').addEvent('mouseenter', function(){setSrc('v5photos','set/photos/v-5-photo-09.jpg');});
	$('v5thumb10').addEvent('mouseenter', function(){setSrc('v5photos','set/photos/v-5-photo-10.jpg');});
}
function buildLegacy250colors() {
	$('legacy250black').addEvent('mouseenter', function(){setSrc('legacy250colors','set/colors/legacy-250-black.jpg');});
	$('legacy250gunmetal').addEvent('mouseenter', function(){setSrc('legacy250colors','set/colors/legacy-250-gunmetal.jpg');});
	$('legacy250silver').addEvent('mouseenter', function(){setSrc('legacy250colors','set/colors/legacy-250-silver.jpg');});
	$('legacy250red').addEvent('mouseenter', function(){setSrc('legacy250colors','set/colors/legacy-250-red.jpg');});
}
function buildLegacy250photos() {
	$('legacy250thumb01').addEvent('mouseenter', function(){setSrc('legacy250photos','set/photos/legacy-250-photo-01.jpg');});
	$('legacy250thumb02').addEvent('mouseenter', function(){setSrc('legacy250photos','set/photos/legacy-250-photo-02.jpg');});
	$('legacy250thumb03').addEvent('mouseenter', function(){setSrc('legacy250photos','set/photos/legacy-250-photo-03.jpg');});
	$('legacy250thumb04').addEvent('mouseenter', function(){setSrc('legacy250photos','set/photos/legacy-250-photo-04.jpg');});
	$('legacy250thumb05').addEvent('mouseenter', function(){setSrc('legacy250photos','set/photos/legacy-250-photo-05.jpg');});
	$('legacy250thumb06').addEvent('mouseenter', function(){setSrc('legacy250photos','set/photos/legacy-250-photo-06.jpg');});
	$('legacy250thumb07').addEvent('mouseenter', function(){setSrc('legacy250photos','set/photos/legacy-250-photo-07.jpg');});
	$('legacy250thumb08').addEvent('mouseenter', function(){setSrc('legacy250photos','set/photos/legacy-250-photo-08.jpg');});
}
function buildXF200colors() {
	$('xf200black').addEvent('mouseenter', function(){setSrc('xf200colors','set/colors/xf-200-black.jpg');});
	$('xf200orange').addEvent('mouseenter', function(){setSrc('xf200colors','set/colors/xf-200-orange.jpg');});
	$('xf200silver').addEvent('mouseenter', function(){setSrc('xf200colors','set/colors/xf-200-silver.jpg');});
}
function buildXF200photos() {
	$('xf200thumb01').addEvent('mouseenter', function(){setSrc('xf200photos','set/photos/xf-200-photo-01.jpg');});
	$('xf200thumb02').addEvent('mouseenter', function(){setSrc('xf200photos','set/photos/xf-200-photo-02.jpg');});
	$('xf200thumb03').addEvent('mouseenter', function(){setSrc('xf200photos','set/photos/xf-200-photo-03.jpg');});
	$('xf200thumb04').addEvent('mouseenter', function(){setSrc('xf200photos','set/photos/xf-200-photo-04.jpg');});
	$('xf200thumb05').addEvent('mouseenter', function(){setSrc('xf200photos','set/photos/xf-200-photo-05.jpg');});
	$('xf200thumb06').addEvent('mouseenter', function(){setSrc('xf200photos','set/photos/xf-200-photo-06.jpg');});
	$('xf200thumb07').addEvent('mouseenter', function(){setSrc('xf200photos','set/photos/xf-200-photo-07.jpg');});
}
function buildXP200colors() {
	$('xp200black').addEvent('mouseenter', function(){setSrc('xp200colors','set/colors/xp-200-black.jpg');});
	$('xp200orange').addEvent('mouseenter', function(){setSrc('xp200colors','set/colors/xp-200-orange.jpg');});
	$('xp200white').addEvent('mouseenter', function(){setSrc('xp200colors','set/colors/xp-200-white.jpg');});
}
function buildXP200photos() {
	$('xp200thumb01').addEvent('mouseenter', function(){setSrc('xp200photos','set/photos/xp-200-photo-01.jpg');});
	$('xp200thumb02').addEvent('mouseenter', function(){setSrc('xp200photos','set/photos/xp-200-photo-02.jpg');});
	$('xp200thumb03').addEvent('mouseenter', function(){setSrc('xp200photos','set/photos/xp-200-photo-03.jpg');});
	$('xp200thumb04').addEvent('mouseenter', function(){setSrc('xp200photos','set/photos/xp-200-photo-04.jpg');});
	$('xp200thumb05').addEvent('mouseenter', function(){setSrc('xp200photos','set/photos/xp-200-photo-05.jpg');});
	$('xp200thumb06').addEvent('mouseenter', function(){setSrc('xp200photos','set/photos/xp-200-photo-06.jpg');});
}
// Build colors and photos for Scooters
function buildCFECharmcolors() {
	// CFECharm needs colors!
}
function buildCFECharmphotos() {
	$('cfecharmthumb01').addEvent('mouseenter', function(){setSrc('cfecharmphotos','set/photos/cfecharm-photo-01.jpg');});
}
function buildCFEJewelcolors() {
	// CFEJewel needs colors!
}
function buildCFEJewelphotos() {
	$('cfejewelthumb01').addEvent('mouseenter', function(){setSrc('cfejewelphotos','set/photos/cfejewel-photo-01.jpg');});
	$('cfejewelthumb02').addEvent('mouseenter', function(){setSrc('cfejewelphotos','set/photos/cfejewel-photo-02.jpg');});
	$('cfejewelthumb03').addEvent('mouseenter', function(){setSrc('cfejewelphotos','set/photos/cfejewel-photo-03.jpg');});
	$('cfejewelthumb04').addEvent('mouseenter', function(){setSrc('cfejewelphotos','set/photos/cfejewel-photo-04.jpg');});
	$('cfejewelthumb05').addEvent('mouseenter', function(){setSrc('cfejewelphotos','set/photos/cfejewel-photo-05.jpg');});
	$('cfejewelthumb06').addEvent('mouseenter', function(){setSrc('cfejewelphotos','set/photos/cfejewel-photo-06.jpg');});
	$('cfejewelthumb07').addEvent('mouseenter', function(){setSrc('cfejewelphotos','set/photos/cfejewel-photo-07.jpg');});
	$('cfejewelthumb08').addEvent('mouseenter', function(){setSrc('cfejewelphotos','set/photos/cfejewel-photo-08.jpg');});
	$('cfejewelthumb09').addEvent('mouseenter', function(){setSrc('cfejewelphotos','set/photos/cfejewel-photo-09.jpg');});
	$('cfejewelthumb10').addEvent('mouseenter', function(){setSrc('cfejewelphotos','set/photos/cfejewel-photo-10.jpg');});
}
function buildCFGlorycolors() {
	// CFGlory needs colors!
}
function buildCFGloryphotos() {
	$('cfglorythumb01').addEvent('mouseenter', function(){setSrc('cfgloryphotos','set/photos/cfglory-photo-01.jpg');});
	$('cfglorythumb02').addEvent('mouseenter', function(){setSrc('cfgloryphotos','set/photos/cfglory-photo-02.jpg');});
	$('cfglorythumb03').addEvent('mouseenter', function(){setSrc('cfgloryphotos','set/photos/cfglory-photo-03.jpg');});
	$('cfglorythumb04').addEvent('mouseenter', function(){setSrc('cfgloryphotos','set/photos/cfglory-photo-04.jpg');});
	$('cfglorythumb05').addEvent('mouseenter', function(){setSrc('cfgloryphotos','set/photos/cfglory-photo-05.jpg');});
	$('cfglorythumb06').addEvent('mouseenter', function(){setSrc('cfgloryphotos','set/photos/cfglory-photo-06.jpg');});
	$('cfglorythumb07').addEvent('mouseenter', function(){setSrc('cfgloryphotos','set/photos/cfglory-photo-07.jpg');});
	$('cfglorythumb08').addEvent('mouseenter', function(){setSrc('cfgloryphotos','set/photos/cfglory-photo-08.jpg');});
	$('cfglorythumb09').addEvent('mouseenter', function(){setSrc('cfgloryphotos','set/photos/cfglory-photo-09.jpg');});
	$('cfglorythumb10').addEvent('mouseenter', function(){setSrc('cfgloryphotos','set/photos/cfglory-photo-10.jpg');});
}
function buildDelivery50colors() {
	$('delivery50blue').addEvent('mouseenter', function(){setSrc('delivery50colors','set/colors/delivery-50-blue.jpg');});
	$('delivery50red').addEvent('mouseenter', function(){setSrc('delivery50colors','set/colors/delivery-50-red.jpg');});
}
function buildDelivery50photos() {
	$('delivery50thumb01').addEvent('mouseenter', function(){setSrc('delivery50photos','set/photos/delivery-50-photo-01.jpg');});
}
function buildDelivery150colors() {
	$('delivery150blue').addEvent('mouseenter', function(){setSrc('delivery150colors','set/colors/delivery-150-blue.jpg');});
	$('delivery150red').addEvent('mouseenter', function(){setSrc('delivery150colors','set/colors/delivery-150-red.jpg');});
}
function buildDelivery150photos() {
	$('delivery150thumb01').addEvent('mouseenter', function(){setSrc('delivery150photos','set/photos/delivery-150-photo-01.jpg');});
}
function buildKeyWestcolors() {
	$('keywestblack').addEvent('mouseenter', function(){setSrc('keywestcolors','set/colors/key-west-black.jpg');});
	$('keywestred').addEvent('mouseenter', function(){setSrc('keywestcolors','set/colors/key-west-red.jpg');});
	$('keywestyellow').addEvent('mouseenter', function(){setSrc('keywestcolors','set/colors/key-west-yellow.jpg');});
}
function buildKeyWestphotos() {
	$('keywestthumb01').addEvent('mouseenter', function(){setSrc('keywestphotos','set/photos/key-west-photo-01.jpg');});
	$('keywestthumb02').addEvent('mouseenter', function(){setSrc('keywestphotos','set/photos/key-west-photo-02.jpg');});
	$('keywestthumb03').addEvent('mouseenter', function(){setSrc('keywestphotos','set/photos/key-west-photo-03.jpg');});
	$('keywestthumb04').addEvent('mouseenter', function(){setSrc('keywestphotos','set/photos/key-west-photo-04.jpg');});
}
function buildLaserR9colors() {
	$('laserr9blue').addEvent('mouseenter', function(){setSrc('laserr9colors','set/colors/laser-r9i-blue.jpg');});
	$('laserr9green').addEvent('mouseenter', function(){setSrc('laserr9colors','set/colors/laser-r9i-green.jpg');});
	$('laserr9red').addEvent('mouseenter', function(){setSrc('laserr9colors','set/colors/laser-r9i-red.jpg');});
}
function buildLaserR9photos() {
	$('laserr9thumb01').addEvent('mouseenter', function(){setSrc('laserr9photos','set/photos/laser-r9i-photo-01.jpg');});
	$('laserr9thumb02').addEvent('mouseenter', function(){setSrc('laserr9photos','set/photos/laser-r9i-photo-02.jpg');});
	$('laserr9thumb03').addEvent('mouseenter', function(){setSrc('laserr9photos','set/photos/laser-r9i-photo-03.jpg');});
	$('laserr9thumb04').addEvent('mouseenter', function(){setSrc('laserr9photos','set/photos/laser-r9i-photo-04.jpg');});
}
function buildMadAss50colors() {
	// MadAss needs colors!
}
function buildMadAss50photos() {
	$('madass50thumb01').addEvent('mouseenter', function(){setSrc('madass50photos','set/photos/madass-50-photo-01.jpg');});
	$('madass50thumb02').addEvent('mouseenter', function(){setSrc('madass50photos','set/photos/madass-50-photo-02.jpg');});
	$('madass50thumb03').addEvent('mouseenter', function(){setSrc('madass50photos','set/photos/madass-50-photo-03.jpg');});
}
function buildCommuter250colors() {
	$('commuter250black').addEvent('mouseenter', function(){setSrc('commuter250colors','set/colors/commuter-250-black.jpg');});
	$('commuter250burgundy').addEvent('mouseenter', function(){setSrc('commuter250colors','set/colors/commuter-250-burgundy.jpg');});
	$('commuter250white').addEvent('mouseenter', function(){setSrc('commuter250colors','set/colors/commuter-250-white.jpg');});
	$('commuter250yellow').addEvent('mouseenter', function(){setSrc('commuter250colors','set/colors/commuter-250-yellow.jpg');});
}
function buildCommuter250photos() {
	$('commuter250thumb01').addEvent('mouseenter', function(){setSrc('commuter250photos','set/photos/commuter-250-photo-01.jpg');});
	$('commuter250thumb02').addEvent('mouseenter', function(){setSrc('commuter250photos','set/photos/commuter-250-photo-02.jpg');});
	$('commuter250thumb03').addEvent('mouseenter', function(){setSrc('commuter250photos','set/photos/commuter-250-photo-03.jpg');});
	$('commuter250thumb04').addEvent('mouseenter', function(){setSrc('commuter250photos','set/photos/commuter-250-photo-04.jpg');});
	$('commuter250thumb05').addEvent('mouseenter', function(){setSrc('commuter250photos','set/photos/commuter-250-photo-05.jpg');});
	$('commuter250thumb06').addEvent('mouseenter', function(){setSrc('commuter250photos','set/photos/commuter-250-photo-06.jpg');});
	$('commuter250thumb07').addEvent('mouseenter', function(){setSrc('commuter250photos','set/photos/commuter-250-photo-07.jpg');});
	$('commuter250thumb08').addEvent('mouseenter', function(){setSrc('commuter250photos','set/photos/commuter-250-photo-08.jpg');});
}
function buildPegasus150colors() {
	$('pegasus150burgundy').addEvent('mouseenter', function(){setSrc('pegasus150colors','set/colors/pegasus-150-burgundy.jpg');});
	$('pegasus150champagne').addEvent('mouseenter', function(){setSrc('pegasus150colors','set/colors/pegasus-150-champagne.jpg');});
	$('pegasus150silver').addEvent('mouseenter', function(){setSrc('pegasus150colors','set/colors/pegasus-150-silver.jpg');});
}
function buildPegasus150photos() {
	$('pegasus150thumb01').addEvent('mouseenter', function(){setSrc('pegasus150photos','set/photos/pegasus-150-photo-01.jpg');});
	$('pegasus150thumb02').addEvent('mouseenter', function(){setSrc('pegasus150photos','set/photos/pegasus-150-photo-02.jpg');});
	$('pegasus150thumb03').addEvent('mouseenter', function(){setSrc('pegasus150photos','set/photos/pegasus-150-photo-03.jpg');});
	$('pegasus150thumb04').addEvent('mouseenter', function(){setSrc('pegasus150photos','set/photos/pegasus-150-photo-04.jpg');});
	$('pegasus150thumb05').addEvent('mouseenter', function(){setSrc('pegasus150photos','set/photos/pegasus-150-photo-05.jpg');});
	$('pegasus150thumb06').addEvent('mouseenter', function(){setSrc('pegasus150photos','set/photos/pegasus-150-photo-06.jpg');});
	$('pegasus150thumb07').addEvent('mouseenter', function(){setSrc('pegasus150photos','set/photos/pegasus-150-photo-07.jpg');});
	$('pegasus150thumb08').addEvent('mouseenter', function(){setSrc('pegasus150photos','set/photos/pegasus-150-photo-08.jpg');});
}
function buildSiena150colors() {
	$('siena150black').addEvent('mouseenter', function(){setSrc('siena150colors','set/colors/siena-150-black.jpg');});
	$('siena150blue').addEvent('mouseenter', function(){setSrc('siena150colors','set/colors/siena-150-blue.jpg');});
	$('siena150pink').addEvent('mouseenter', function(){setSrc('siena150colors','set/colors/siena-150-pink.jpg');});
	$('siena150white').addEvent('mouseenter', function(){setSrc('siena150colors','set/colors/siena-150-white.jpg');});
}
function buildSiena150photos() {
	$('siena150thumb01').addEvent('mouseenter', function(){setSrc('siena150photos','set/photos/siena-150-photo-01.jpg');});
	$('siena150thumb02').addEvent('mouseenter', function(){setSrc('siena150photos','set/photos/siena-150-photo-02.jpg');});
	$('siena150thumb03').addEvent('mouseenter', function(){setSrc('siena150photos','set/photos/siena-150-photo-03.jpg');});
	$('siena150thumb04').addEvent('mouseenter', function(){setSrc('siena150photos','set/photos/siena-150-photo-04.jpg');});
	$('siena150thumb05').addEvent('mouseenter', function(){setSrc('siena150photos','set/photos/siena-150-photo-05.jpg');});
	$('siena150thumb06').addEvent('mouseenter', function(){setSrc('siena150photos','set/photos/siena-150-photo-06.jpg');});
	$('siena150thumb07').addEvent('mouseenter', function(){setSrc('siena150photos','set/photos/siena-150-photo-07.jpg');});
}
// Build colors and photos for Electric Bikes
function buildA2Bcolors() {
	// A2B Metro needs colors!
}
function buildA2Bphotos() {
	$('a2bmetrothumb01').addEvent('mouseenter', function(){setSrc('a2bmetrophotos','set/photos/a2b-metro-photo-01.jpg');});
	$('a2bmetrothumb02').addEvent('mouseenter', function(){setSrc('a2bmetrophotos','set/photos/a2b-metro-photo-02.jpg');});
	$('a2bmetrothumb03').addEvent('mouseenter', function(){setSrc('a2bmetrophotos','set/photos/a2b-metro-photo-03.jpg');});
	$('a2bmetrothumb04').addEvent('mouseenter', function(){setSrc('a2bmetrophotos','set/photos/a2b-metro-photo-04.jpg');});
}
function buildEuropacolors() {
	// Europa needs colors!
}
function buildEuropaphotos() {
	$('europathumb01').addEvent('mouseenter', function(){setSrc('europaphotos','set/photos/europa-photo-01.jpg');});
}
function buildPortiacolors() {
	// Portia needs colors!
}
function buildPortiaphotos() {
	$('portiathumb01').addEvent('mouseenter', function(){setSrc('portiaphotos','set/photos/portia-photo-01.jpg');});
}

//
// MENU SCROLL FUNCTIONS
////////////////////////
function scrollMenu(article,direction,motion) {
	if (article=="scooters") {
		startPosition = scootersMenuPosition;
		endPosition = -500;
	}
	rightArrow = article + '-arrow-right';
	leftArrow = article + '-arrow-left';
	startPosition = $('menu-inner').getStyle('left').toInt();
	if (startPosition < 0) {$(leftArrow).setStyle('visibility','visible');}
	if (startPosition >= 0) {$(leftArrow).setStyle('visibility','hidden');}
	if (startPosition > endPosition) {$(rightArrow).setStyle('visibility','visible');}
	if (startPosition <= endPosition) {$(rightArrow).setStyle('visibility','hidden');}
	if (motion == "stop" || (startPosition == 0 && direction == "left") || (startPosition == endPosition && direction == "right")) {
		clearTimeout(t);return;}
	if (direction == "left") {startPosition++;startPosition++;} else {startPosition--;startPosition--;}
	$('menu-inner').setStyle('left',startPosition);
	t = setTimeout("scrollMenu(\""+article+"\",\""+direction+"\")", 10);
	if (startPosition == 0 || startPosition == endPosition) {clearTimeout(t);
		if (startPosition == 0) {$(leftArrow).setStyle('visibility','hidden');}
		if (startPosition == endPosition) {$(rightArrow).setStyle('visibility','hidden');}
	}
}

//
// ANIMATION FUNCTIONS
////////////////////////
function buildNavAnimations() {
	openHeaderBox = new Fx.Morph('header-box', {duration: 750});
	fadeMenuBox = new Fx.Morph('menu-box', {duration: 1000, transition: Fx.Transitions.Circ.easeOut});
	fadeMenuBox.addEvent('onComplete', function(){$('menu-box').setStyle('opacity', '1.0');});
}

//
// INITIAL SETUP
////////////////////////
window.addEvent('domready', function() {
	buildNavAnimations();
	buildMenus();
	// Build colors and photos for Motorcycles
	if (currentPage=="v3colors") {buildV3colors();}
	if (currentPage=="v3photos") {buildV3photos();}
	if (currentPage=="v5colors") {buildV5colors();}
	if (currentPage=="v5photos") {buildV5photos();}
	if (currentPage=="legacy250colors") {buildLegacy250colors();}
	if (currentPage=="legacy250photos") {buildLegacy250photos();}
	if (currentPage=="xf200colors") {buildXF200colors();}
	if (currentPage=="xf200photos") {buildXF200photos();}
	if (currentPage=="xp200colors") {buildXP200colors();}
	if (currentPage=="xp200photos") {buildXP200photos();}
	// Build colors and photos for Scooters
	if (currentPage=="cfecharmcolors") {buildCFECharmcolors();}
	if (currentPage=="cfecharmphotos") {buildCFECharmphotos();}
	if (currentPage=="cfejewelcolors") {buildCFEJewelcolors();}
	if (currentPage=="cfejewelphotos") {buildCFEJewelphotos();}
	if (currentPage=="cfglorycolors") {buildCFGlorycolors();}
	if (currentPage=="cfgloryphotos") {buildCFGloryphotos();}
	if (currentPage=="delivery50colors") {buildDelivery50colors();}
	if (currentPage=="delivery50photos") {buildDelivery50photos();}
	if (currentPage=="delivery150colors") {buildDelivery150colors();}
	if (currentPage=="delivery150photos") {buildDelivery150photos();}
	if (currentPage=="keywestcolors") {buildKeyWestcolors();}
	if (currentPage=="keywestphotos") {buildKeyWestphotos();}
	if (currentPage=="laserr9colors") {buildLaserR9colors();}
	if (currentPage=="laserr9photos") {buildLaserR9photos();}
	if (currentPage=="madass50colors") {buildMadAss50colors();}
	if (currentPage=="madass50photos") {buildMadAss50photos();}
	if (currentPage=="commuter250colors") {buildCommuter250colors();}
	if (currentPage=="commuter250photos") {buildCommuter250photos();}
	if (currentPage=="pegasus150colors") {buildPegasus150colors();}
	if (currentPage=="pegasus150photos") {buildPegasus150photos();}
	if (currentPage=="siena150colors") {buildSiena150colors();}
	if (currentPage=="siena150photos") {buildSiena150photos();}
	// Build colors and photos for Electric Bikes
	if (currentPage=="a2bmetrocolors") {buildA2Bcolors();}
	if (currentPage=="a2bmetrophotos") {buildA2Bphotos();}
	if (currentPage=="europacolors") {buildEuropacolors();}
	if (currentPage=="europaphotos") {buildEuropaphotos();}
	if (currentPage=="portiacolors") {buildPortiacolors();}
	if (currentPage=="portiaphotos") {buildPortiaphotos();}
});