$().ready(function() {
	$('#coda-slider-1').codaSlider({
		autoSlide: true,
		autoSlideInterval: 4000,
		dynamicArrows: false,
		dynamicTabs: true,
		dynamicTabsPosition: "bottom",
		crossLinking: false
	});
	$(".tweet").tweet({
	    join_text: "auto",
	    username: "sgartsfest",
	    count: 1,
	    auto_join_text_default: "", 
	    auto_join_text_ed: "",
	    auto_join_text_ing: "",
	    auto_join_text_reply: "",
	    auto_join_text_url: "",
	    loading_text: "searching twitter..."
	});
	$("#gallery-view a").fancybox();
	$(".pop-yt-video").click(function() {
		$.fancybox({
				'padding'		: 0,
				'autoScale'		: false,
				'transitionIn'	: 'none',
				'transitionOut'	: 'none',
				'title'			: this.title,
				'width'		: 680,
				'height'		: 495,
				'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
				'type'			: 'swf',
				'swf'			: {
					'allowfullscreen'	: 'true'
				}
			});
	
		return false;
	});
	$(".pop-vm-video").click(function() {
		$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'			: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("([0-9])","i"),'moogaloop.swf?clip_id=$1'),
			'type'			: 'swf'
		});
 
		return false;
	});
	
	$(".popup").fancybox();
	
	$(function() {
		var zIndexNumber = 1000;
		$('div').each(function() {
			$(this).css('zIndex', zIndexNumber);
			zIndexNumber -= 10;
		});
	});
});


