$(document).ready(function() {
	
	// Hide Last Menu Item Delimiter
	$("#super-header li:last").html($("#super-header li:last").html().replace("</a>|","</a>"));
	
	// Move Next Page Button
	$('.next').parent().css({"position" : "absolute", "right" : "0"});
	
	// Open external links in new Window/Tab
	$("a[href^='http:']").not("[href*='" + window.location.host + "']").attr('target','_blank');
	
	// Add print-this Class to Printer Friendly link
	$(".printfriendly").parent().addClass("print-this");
	
	// Fade
	$('.fadeThis').append('<span class="hover"></span>').each(function () {
		var $span = $('> span.hover', this).css('opacity', 0);
		$(this).hover(function () {
			$span.stop().fadeTo(300, 1);
		}, function () {
			$span.stop().fadeTo(300, 0);
		});
	});
	
	// Sliding Doors Button Fade Like a Total Baller
	$('.button').each(function () {
		$('span', this).addClass('sd');
		$(this).append('<span class="hover"></span><span class="sd2"></span>');
		var thisHover = $(".hover", this);
		$('.sd', this).clone().removeClass('sd').addClass('overlay').appendTo(thisHover);
		var $span = $('> span.hover', this).css('opacity', 0);
		var $span2 = $('> span.sd2', this).css('opacity', 0);
		$(this).hover(function () {
			$span.stop().fadeTo(200, 1);
			$span2.stop().fadeTo(200, 1);
		}, function () {
			$span.stop().fadeTo(200, 0);
			$span2.stop().fadeTo(200, 0);
		});
	});
	
	// Input value switcher
	$('#s').focus(function () {
		if ($('#s').val() == 'Search PowerYourPractice.com') {
			$('#s').val('');
			$('#s').css({'color' : '#484848', 'font-weight' : 'bold'}); //active
		}
	});
	
	$('#s').blur(function () {
		if ($('#s').val() == '') {
			$('#s').val('Search PowerYourPractice.com');
			$('#s').css({'color' : '#979797', 'font-weight' : 'normal'}); //inactive
		}
	});
	
});
