/*
 * @project: Flyweb JS
 * @author: Superfly <http://www.flyweb.at>
 *
 * @created: October 2009
 * 
 */


$(document).ready(function() {
	
	/*
	 * navi animation 
	 */
	$("#navi li").hover(
		
		function() {
			var e = this;
			var pix = "";
			var bounce = -4; /* end bounce pix*/
			var bounce1 = 0; /* start bounce pix*/
			
			if( e.id == "tab1" )
				pix = -471;
			
			if( e.id == "tab2" )
				pix = -283;
			
			if( e.id == "tab3" )
				pix = -94;

			if( $(e).hasClass("active")){
				pix = pix+94;
				bounce1 = 0;
			}
			$(e).stop().animate(
					{backgroundPosition: bounce1+"px "+pix+"px" }, 
					250
					, 
					function() {
						$(e).animate({ backgroundPosition: bounce+"px "+pix+"px" }, 250);
					}
			);

		},
		function(){
			var e = this;
			var pix = "";
			var bounce = -24; /* end bounce pix*/
			var bounce1 = -29; /* start bounce pix*/
			
			if( e.id == "tab1" )
				pix = -471;
			
			if( e.id == "tab2" )
				pix = -283;
			
			if( e.id == "tab3" )
				pix = -94;

			if( $(e).hasClass("active")){
				pix = pix+94;
				bounce = -4;
				bounce1 = -10;
			}
			$(e).stop().animate(
					{ backgroundPosition: bounce1+"px "+pix+"px" }, 
					250
					, 
					function() {
						$(e).animate({ backgroundPosition: bounce+"px "+pix+"px" }, 250);
					}
			);
		
		}

	);	
	
});


//$("#nav-shadow li").hover(function() {

//var e = this;
//$(e).find("a").stop().animate({ marginTop: "-14px" }, 250, function() {
//	$(e).find("a").animate({ marginTop: "-10px" }, 250);
//});
//$(e).find("img.shadow").stop().animate({ width: "80%", height: "20px", marginLeft: "8px", opacity: 0.25 }, 250);
//},function(){
//var e = this;
//$(e).find("a").stop().animate({ marginTop: "4px" }, 250, function() {
//	$(e).find("a").animate({ marginTop: "0px" }, 250);
//});
//$(e).find("img.shadow").stop().animate({ width: "100%", height: "27px", marginLeft: "0", opacity: 1 }, 250);

//});

