/**
 * Power-Starter Effects JS
 */

var left = new Array();
var right = new Array();

$(document).ready(function() {
	
	$('ul.firstNav li').each(function() {
		//$(this).css('opacity', 0.1).animate({opacity: 1}, 1000);
		var ref = $(this).find('a').attr('class');
		left[ref] = $(this).find('a').css('left');
	});
	$('ul.secondNav li').each(function() {
		//$(this).css('opacity', 0).animate({opacity: 1}, 1000);
		var ref = $(this).find('a').attr('class');
		right[ref] = $(this).find('a').css('left');
	});
	
	
	$('ul.firstNav li').mouseover(function() {
		if ($(this).attr('class') == 'active') {
			return false;
		}
		$(this).find('a').animate({left: parseInt($(this).find('a').css('left'))-8}, 300);
	});
	$('ul.firstNav li').mouseout(function() {
		if ($(this).attr('class') == 'active') {
			return false;
		}
		var ref = $(this).find('a').attr('class');
		$(this).find('a').animate({left: parseInt(left[ref])}, 300);
	});
	
	$('ul.secondNav li').mouseover(function() {
		if ($(this).attr('class') == 'active') {
			return false;
		}
		$(this).find('a').animate({left: parseInt($(this).find('a').css('left'))+8}, 300);
	});
	$('ul.secondNav li').mouseout(function() {
		if ($(this).attr('class') == 'active') {
			return false;
		}
		var ref = $(this).find('a').attr('class');
		$(this).find('a').animate({left: parseInt(right[ref])}, 300);
	});

});

