/**
 * @author Grzegorz Kolasa
 */

jQuery.noConflict();
jQuery(document).ready(function() {
	jQuery("div.button").hover(function() {
		jQuery(this).children("div.back").children("div.backLeft").animate( {
			width : "12px"
		}, 50, function() {
			jQuery(this).siblings("div.backRight").animate( {
				width : "12px"
			}, 50, function() {
				jQuery(this).siblings("div.backCenter").animate( {
					width : "100px"
				}, 100);
			});
		});

		jQuery(this).children("a.link").animate( {
			marginLeft : "10px"
		}, 50, function() {
			jQuery(this).animate( {
				marginLeft : "-10px"
			}, 100, function() {
				jQuery(this).animate( {
					marginLeft : "0px"
				}, 50);
			});
		});
	}, function() {
		jQuery(this).stop();
		jQuery(this).children("div.back").animate( {
			marginLeft : "124px"
		}, 300, function() {
			jQuery(this).children().css("width", "0px");
			jQuery(this).css("margin-left", "0px");
		});

		jQuery(this).children("a.link").animate( {
			marginLeft : "-10px"
		}, 50, function() {
			jQuery(this).animate( {
				marginLeft : "10px"
			}, 50, function() {
				jQuery(this).animate( {
					marginLeft : "0px"
				}, 50);
			});
		});
	});
});