$(function() {

	//ANIMATES EMAIL LINK ON ROLLOVER
	$("#footer .email").hover(function(){
    	$(this).stop().animate({
    		paddingLeft: "5px"
    	}, 400);
    }, function() {
    	$(this).stop().animate({
    		paddingLeft: 0
    	}, 400);
    });
    
    //EASY TOOLTIP
    //any anchors with title attribute
	$("a[title]").easyTooltip({
		xOffset: 10,
		yOffset: -20
		//content: 'or content here;' or use title attribute on link
	});
    
	//ADDS .ACTIVE CLASS TO ANCHOR OF CURRENT PAGE
	$(".nav a").each(function() {
   		if(this.href == window.location || this.href == document.location.protocol + "//" + window.location.hostname + window.location.pathname)
		$(this).addClass("active");
   	});
   	
   	//DISABLES LINKS WITH NO URL
   		//adds class to links with *
   		$('a[href*="*"]').addClass("disableLink");
   		//disables link
		$(".disableLink").click(function () {
    		return false;
		});
    
    //ADDS A DIV WITH CLASS CLEAR AFTER EVERY 2 ITEMS ON PRESS PAGE SINCE FLOATS NEED TO BE CLEARED
	$(document).ready(function(){
		$('#pressWrapper div:nth-child(2n)').after('<div class="clear">&nbsp;</div>');
	});

	//FIXES Z-INDEX ISSUE ON IE7, FOR LAYRING OF IMAGES AND FRAMES
		//http://www.vancelucas.com/blog/fixing-ie7-z-index-issues-with-jquery
		//only issue with IE7, restricted this to IE
	if ($.browser.msie) {
		var zIndexNumber = 1000;
	    $('img.over,span.under img').each(function() { //selector was just 'div' before
	    	$(this).css('zIndex', zIndexNumber);
	    	zIndexNumber -= 10;
	    });
	 };
   
    //APPENDS ACTIVE CLASS IMG WITH -CURRENT - SWITCHING IMAGE OUT FOR ACTIVE PAGE
    $(function(){ //something screwy here... nothing runs after it
    	imgsrc = $(".active").children("img").attr("src");
    	matches = imgsrc.match(/-current/);
    	if (!matches) {
    		imgsrcON = imgsrc.replace(/.jpg$/ig,"-current.jpg"); // strip off extension
    		$(".active").children("img").attr("src", imgsrcON);
    	}
    });
    
});