$(document).ready(function(){
	

		$('#photo-video #main-col a').fancyZoom(
			{directory: 'http://dev.bloodtyperagu.com/imgs/zoom'}
		);

	
	if ($("#start_animation").parent().parent().parent().parent().prepend("<div id='animation' class='hide'></div>")) {
		window.setTimeout('$("#animation").fadeIn(2500)', 2000);
	}

	
	// photo & video manipulation
	$('#photo-video #main-col a').each(function(){
		$(this).find("object").remove();
		$(this).find("embed").remove();
	});
		
	// beginning animation
	$(".home-block").hide().children().hide();
	window.setTimeout('$("#frank-jar").fadeIn(700,function(){$(".home-block").attr("class","home-block").animate({width: "toggle"},700,"",function(){ $(this).children().fadeIn(700); });});', 1200);
	
	// auto current links
	var href = (window.location.pathname).split("/");
	$("#menu a").each(function(){
		var thisHref = $(this).attr("href").split("/");
		if (href[1]==thisHref[1]) { $(this).parent().addClass("current"); }
	});

	// neat little photo trick
	$("#main-col .alignleft img").after("<span class='pic-bottom'></span>");
	$("#main-col img.alignleft").wrap("<div class='alignleft'></div>").after("<span class='pic-bottom'></span>");
	$("#partners li img").after("<span class='pic-bottom'></span>");
	$("#tickets #side-col img").after("<span class='pic-bottom'></span>");
	
	$(".commentmetadata a").click(function() {
		return false;
	});
	
	// striping
	$("tr:odd").addClass('alt');

	$('#fancy div').each(function(){
		$(this).find("object").siblings("img").remove();
		$(this).find("embed").siblings("img").remove();
	});
	$("#top").click(function() {
		$("html:not(:animated),body:not(:animated)").animate({ scrollTop: 0}, 1100 );
		return false;
	});
	
	// cast scroll effect
	$("#cast-creative #side-col a").click(function() {
		var scroll = $(this).attr('href');
		$.scrollTo( scroll, 800 );
	});

	$("#back-to-top").click(function() {
		var scroll = $(this).attr('href');
		$.scrollTo( scroll, 800 );
		return false;
	});
	
	$('#quotes').cycle({ 
		timeout: 8000, 
		speed: 1500});

	
	$("#photo-video #hide-til-loaded").removeClass('hide');
	
	/*
	$("#menu a").click(function(){
		$("#menu li").attr('class','');
		$(this).parent().attr('class','current');
		$("#ragu-wall-wrap").slideUp(700,function() {
			$("#menu-bg").fadeIn(700);
		})
		return false;
	});
	$("#logo").click(function(){
		$("#menu li").attr('class','');
		$("#menu-bg").fadeOut(700,function() {
			$("#ragu-wall-wrap").slideDown(700);
		})
		return false;
	});
	*/
	
	
});
