/**
 * @author Starchild
 */
$(document).ready(function() {
	$('ul#mainMenu li.topNav').mouseenter(function() {
		var elem = $(this).find('img:first');
		elem.attr("src", elem.attr("over"));
	});
	
	$('ul#mainMenu li.topNav').mouseleave(function() {
		var elem = $(this).find('img:first');
		elem.attr("src", elem.attr("out"));
	});
	
	$('ul#productMenu li').mouseenter(function() {
		var elem = $(this).find('img');
		elem.attr("src", elem.attr("over"));
	});
	
	$('ul#productMenu li').mouseleave(function() {
		var elem = $(this).find('img');
		elem.attr("src", elem.attr("out"));
	});
	
	$('a#bsystem').mouseenter(function(){
		//log.debug('Showing system');
		try {
			document.getElementById("flashContent").showSystem();
		} catch (err) {}
	});
	$('a#btractorSystem').mouseenter(function(){
		//log.debug('Showing tractor');
		try {
			document.getElementById("flashContent").showTractor();
		} catch (err) {}
	});
	$('a#bstakeSystem').mouseenter(function(){
		//log.debug('Showing snow stake');
		try {
			document.getElementById("flashContent").showSnowStake();
		} catch (err) {}
	});
	$('a#bstakeSystem, a#bsystem, a#btractorSystem').mouseleave(function() {
		try {
			document.getElementById("flashContent").hideAll();
		} catch (err) {}
	});
	
	$('a#next').click(function() {
		window.history.forward();
		return false;
	});
	$('a#previous').click(function() {
		window.history.back();
		return false;
	});
});