var url = document.location.href;
var filename = url.slice(url.lastIndexOf('\/')+1);

if (filename == "index.html" || !filename) {
	var initwidth = 10;
	var initright = 480;
	var initcolor = '#FFF';
} else if (filename == "about.html" || filename == "about.html#") {
	var initwidth = 34;
	var initright = 410;
	var initcolor = '#A51642';
} else if (filename == "inproduction.html" || filename == "inproduction.html#") {
	var initwidth = 79;
	var initright = 321;
	var initcolor = '#A51642';
} else if (filename == "completed.html" || filename == "completed.html#") {
	var initwidth = 135;
	var initright = 176;
	var initcolor = '#A51642';
} else if (filename == "development.html" || filename == "development.html#") {
	var initwidth = 74;
	var initright = 92;
	var initcolor = '#A51642';
} else if (filename == "team.html" || filename == "team.html#") {
	var initwidth = 28;
	var initright = 54;
	var initcolor = '#A51642';
} else if (filename == "contact.html" || filename == "contact.html#") {
	var initwidth = 44;
	var initright = 0;
	var initcolor = '#A51642';
};


window.addEvent('domready', function(){						
		
	var sliderFx = new Fx.Styles('slider',{duration: 400});
	
	sliderFx.set({
		'background-color': initcolor,
		'right': initright,
		'width': initwidth
	});
	
	if (filename != "index.html" && filename) {
		$('home').addEvent('mouseenter', function(){	
			sliderFx.stop();
			sliderFx.start({
				'background-color': '#000',
				'right': 454,
				'width': 29
			});
		});
	};
	
	if (filename != "about.html" && filename != "about.html#") {
		$('about').addEvent('mouseenter', function(){			
			sliderFx.stop();
			sliderFx.start({
				'background-color': '#000',
				'right': 410,
				'width': 34
			});
		});
	};
	
	if (filename != "inproduction.html" && filename != "inproduction.html#") {
		$('inproduction').addEvent('mouseenter', function(){			
			sliderFx.stop();
			sliderFx.start({
				'background-color': '#000',
				'right': 321,
				'width': 79
			});
		});
	};
	
	if (filename != "completed.html" && filename != "completed.html#") {
		$('completed').addEvent('mouseenter', function(){			
			sliderFx.stop();
			sliderFx.start({
				'background-color': '#000',
				'right': 176,
				'width': 135
			});
		});
	};
	
	if (filename != "development.html" && filename != "development.html#") {
		$('development').addEvent('mouseenter', function(){			
			sliderFx.stop();
			sliderFx.start({
				'background-color': '#000',
				'right': 92,
				'width': 74
			});
		});
	};
	
	if (filename != "team.html" && filename != "team.html#") {
		$('team').addEvent('mouseenter', function(){			
			sliderFx.stop();
			sliderFx.start({
				'background-color': '#000',
				'right': 54,
				'width': 28
			});
		});
	};
	
	if (filename != "contact.html" && filename != "contact.html#") {
		$('contact').addEvent('mouseenter', function(){			
			sliderFx.stop();
			sliderFx.start({
				'background-color': '#000',
				'right': 0,
				'width': 44
			});
		});
	};
	
	$('menu').addEvent('mouseleave', function(){	
		sliderFx.stop();
		sliderFx.start({
			'background-color': initcolor,
			'right': initright,
			'width': initwidth
		});
	});
	
});
