$(document).ready(function() {

	// Document Ready Stuff Below (jQuery)
	
	// Open external links in a new tab
	$('a').live('click', function() {
		$("a[href*='http://']:not([href*='"+location.hostname+"'])")
			.attr("target","_blank").addClass('external');
	});
	
	// Add class to external links
	$("a[href*='http://']:not([href*='"+location.hostname+"'])").attr("target","_blank").addClass('external');
	
	// Add class to pdf downloads
	$("a[href*='pdf']").addClass('pdf_file');
	
	// initial stuff
	$('#splash .btn').hide().fadeInTimer();
	
	// error box
	$('#error a').click(function() {
		$(this).parent().fadeOut();
		return false;
	});
	
	// call page scroll function
	$('#nav a.nav_link, .registration').anchorAnimate();
		
	// make element clickable
	$('span.btn').hover(
		function () { $(this).addClass('hover'); },
		function () { $(this).removeClass('hover'); }
	); 
	
	// AJAX requests
	$('#nav ul ul a').subpage().subAnchor();
	$('.page .page_head ul li a').subpage().subAnchor();
	$('#speakers .image_menu a').externalNavSubpage();
	
	// Table hover effect
	$('td').bindHover();
	
	// Registration Buttons
	$('.reg a').attr("target","_blank").append('<span></span>').hover(
		function() {
			$(this).children().fadeOut();
		},
		function() {
			$(this).children().fadeIn();
		});
	
	// Stupid Shit
	$('#splash embed').click(function() {
		location.href='http://generationunleashed.com/home/';
	});
	
});