
// run scripts on load
$(function()
{
	// hide JS related content
	$('html').addClass('JS');
	
	// set external links
	$('a[rel=external]').attr('target', '_blank');
	$('a[href^="http://"]').each(function(){
		if($(this).attr('href').indexOf('http://www.thinkup.org/') < 0)
		{
			$(this).attr('target', '_blank');
		}
	});
	
	
	
	// show/hide pencil on resize
	showPencil();
	$(window).bind('resize', showPencil);
	function showPencil()
	{
		if($(window).width() > 1150) $('#pencil').show().css('height', '535px');
			else $('#pencil').hide();
	}
	
	// set quick search box
	$('#quick-search input.query').focus(function()
	{
		$(this).attr('value', '');
	});
	
	// set the scroll to top links
	$('div#stamp').click(function()
	{
		$.scrollTo(0, 0, {duration: 650});
		return false;
	});
	
	// project tabs
	if($('#project-nav').length > 0 ){
		$('#project-nav').tabs();
	}
	
	// news opener
	/*
	$('body.pg-news a.news-opener').click(function(){
		$(this).parent().prev().slideToggle(500);
		return false;
	});
	*/
	
});
