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']:not([href*='" + h + "'])").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');
	 $('body').addClass($.client.os);
	 $('body').addClass($.client.browser);
     $("tr:even").addClass('even');
     $("tr:odd").addClass('odd');
	 $('input.clearme').focus(function() {
    	$(this).val("");
  	});
	
	$(".page-item-150").children('a').text("Events");
//$('.rounded').corners("8px");

  // 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 dropNav(cntr)
{
	if ($(cntr).val() != '')
		window.location = $(cntr).val();
}


