var originalFontSize;
var h = window.location.host.toLowerCase();
	
$(document).ready(function(){
     $("a[href^='http']:not([href*='" + h + "']), a[href$='.pdf']").attr("target", "_blank");
	 $('a[href^="http://"]').addClass('externalLink');
	 $("img").parent().removeClass('externalLink');
	 $('a[href^="mailto:"]').addClass('emailLink');
	 $('a[href*=.pdf]').attr({"target":"_blank"});
	 $('a[href*=.pdf]').addClass('pdfLink');
	 $('a[href*=.eps]').addClass('epsLink');
     $("li:last-child").addClass('last');
     $("li:first-child").addClass('first');
	 $("#localNav ul:first-child").addClass('p7TMM');

	$('input.clearme').focus(function() {
    	$(this).val("");
  	});

  // Reset Font Size
  originalFontSize = $('html').css('font-size');
  getCookieSetFont();
  
  
  $(".resetFont").click(function(){
	  $('html').css('font-size', originalFontSize);
	  clearFontCookie();
  });
  
  // Increase Font Size
  $(".increaseFont").click(function(){
  	var currentFontSize = $('html').css('font-size');
 	var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*1.2;
	$('html').css('font-size', newFontSize);
	setFontCookie();
	return false;
  });
  
  // Decrease Font Size
  $(".decreaseFont").click(function(){
  	var currentFontSize = $('html').css('font-size');
 	var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*0.8;
	$('html').css('font-size', newFontSize);
	setFontCookie();
	return false;
  });
});

function setFontCookie()
{
	var currentFontSize = $('html').css('font-size');
	$.cookie("fontsize", parseFloat(currentFontSize, 10), { path: '/'} );
}

function getCookieSetFont()
{
	var newFontSize =  $.cookie("fontsize") + "px";
	if (newFontSize != "nullpx")
		$('html').css('font-size', newFontSize);
}

function clearFontCookie()
{
	$.cookie("fontsize", parseFloat(originalFontSize, 10), { path: '/'} );
}

function loadScripts()
{
	var message = "I wish Kristin would stop putting the loadScripts() function in her body tags";	
}
