/* SPARKART */
/* Common Javascript Functions
----------------------------------------------------------------------------- */


	$(document).ready(function() {

		$('#sidebar').hide();
		$('#sidebar.headlines span').remove();

		if (page == "blog" || page == "index") {
	
			loadBlog();
	
		}
		
		if (navigator.platform.match('Win') || navigator.platform.match('Linux')) {

			$('body').addClass('pc');

		}

	});


	$(window).load(function() {

		function killSnakes() {

			$('#snakes').fadeOut('slow', function() {
				$('#snakes').remove();
			});
			
		}

		$(window).scroll(killSnakes);
		$(window).mousedown(killSnakes);

		// PLUGIN: CLIQUE ACTIONS (Replaces submit buttons with text links)
		try { $('input[type=submit]').cliqueActions(); } catch (error) { alert('Error: Missing Clique Actions Plugin'); }


/* TABS
----------------------------------------------------------------------------- */


	$('ul.tabs').tabs();


/* PAGE SPECIFIC FUNCTIONS
----------------------------------------------------------------------------- */

	
	if (page == "read" || page == "releases") {
	
		loadBlog();
		loadComments();	

	} else if (page == "write") {

		loadEditor();
	
	} else if (page == "welcome") {

		var last_initial = last_name.slice(0,1);
		var alias = first_name + last_initial;

		$('div.alias input').val(alias);
		$('div.picture p').text('Your picture will appear next to your comments. It can be anything: a picture of you, artwork, crazy photos, and other cool images. Pictures must be in JPEG (.jpg) format.');
	
	}

	loadFonts();
	$('#sidebar').show();


/* END FUNCTIONS
----------------------------------------------------------------------------- */


	});
