$(function() {
	$("#tabs").tabs({ fx: { duration:'normal', opacity:'toggle' } });
	$("#accordion").accordion({ autoHeight:false, collapsible:true });
	$("#gallerylink").click(function () {
		window.location.href = this.href;
		$("#firstimage").triggerHandler('click');
	});
	
	// tweet.seaofclouds.com
	$("body#home").each(function(index) {
		$("#col_tweets").tweet({
			loading_text: '@capeotwaylight on Twitter ...',
			count: 1,
			username: "capeotwaylight",
			avatar_size: 48,
			outro_text: "@capeotwaylight on Twitter",
			time_prefix: ""
		});
		$("#opera_tweets").tweet({
			loading_text: '@otwaysopera on Twitter ...',
			count: 1,
			username: "otwaysopera",
			avatar_size: 48,
			outro_text: "@otwaysopera on Twitter",
			time_prefix: ""
		});
	});

	$("body#twitter").each(function(index) {
		$("#tweets").tweet({
			count: 20,
			username: "capeotwaylight",
			time_prefix: ""
		});
	});
	
	// television effects
	function blip() {
		$('body#videos img#static').fadeIn(50);
		$('body#videos img#static').fadeOut(150);
	}
	
	$(window).bind("load", function() { 
		$("body#videos img#static").delay(2000);
		$('body#videos img#static').fadeOut(350);
		$('body#videos img#static').fadeIn(300);
		$('body#videos img#static').fadeOut(250);
		$('body#videos img#static').fadeIn(100);
		$('body#videos img#static').fadeOut(250);
		setInterval(blip,20000);
	});

});

