$(document).ready(function()
{
	jQuery("#step_control").show();
	
	jQuery(".step").bind("click", function()
	{
		var t  = jQuery(this).attr("href"),
			th = jQuery(t).height(),
			c  = jQuery(".step.active").attr("href"),
			ch = jQuery(c).height();

		jQuery("#steps").css({height : ch}).animate({opacity : 0, height: 0}, 200);

		setTimeout('jQuery("#steps li").hide(); jQuery("'+ t +'").show(); jQuery("#steps").animate({opacity : 1, height : jQuery("'+ t +'").height()+30}, 200);', 200);
		
		
		jQuery(".step").removeClass("active");
		jQuery(this).addClass("active");
		
		return false;
	});
	
	jQuery("#pokreni, #pokreni_2").bind("click", function()
	{
		jQuery("#overlay, #video").fadeIn(200);
		jQuery("#a").fadeOut(200);
		
		return false;
	});
	
	jQuery("#back").bind("click", function()
	{
		jQuery("#overlay, #video").fadeOut(200);
		
		return false;
	});
	
	jQuery("#q").bind("click", function()
	{
		jQuery("#overlay, #video").fadeOut(200);
		jQuery("#a").fadeIn(200);
		
		return false;
	});
	
	jQuery("#zatvori").bind("click", function()
	{
		jQuery("#overlay, #a").fadeOut(200);
		
		return false;
	});
	
	/*jQuery(document).keydown( function(e)
	{
		if (e.keyCode == 27)
		{
			if( jQuery("#video:visible") )
				jQuery("#video").fadeOut(200);
		
			if( jQuery("#a:visible") )
				jQuery("#a").fadeOut(200);
		}
	});
	
	jQuery(document).bind("click", function()
	{
		if( jQuery("#video:visible") )
			jQuery("#video").fadeOut(200);
		
		if( jQuery("#a:visible") )
			jQuery("#a").fadeOut(200);
	});*/
});
