$(document).ready(function() {


	// PNGfix!
	$(document).pngFix();


	// Firsts and Lasts...
	$("#primary .post:last-child").addClass("post-last");
	$(".colBox-recent ul li:first-child").remove();


	$(".contexty li a").addClass("clearfix");



	// Enh, tweak markup for the home page only
	// Won't need these for real WP implementation...
	/*
	var logotext = $("body.home #logo").text();
	$("body.home #logo a").remove();
	$("body.home #logo").prepend(logotext);
	$("body.home #nav").remove();

	if($(".pageHeadline").text() == "Nate Cardozo, David Albright") {
		$("#nav .episodes").addClass("selected");
	} else if ($(".pageHeadline").text() == "About Culture Shocks") {
		$("#nav .about").addClass("selected");
	} else {
		$("#nav .listen").addClass("selected");
	}
	*/


	// Patching up the default markup of the Links list.
	if($("dl.friends").length != 0) {
		$("dl.friends h2").remove();
		$("dl.friends span").unwrap();
		$("dl.friends span dt,dl.friends span dd").unwrap();
	}


	// Tooltips
	$(".colBox-recent .contexty li,.colBox-related .contexty li").tooltip({ 
	    track: true,
	    delay: 0,
	    showURL: false,
	    showBody: " - ",
	    fade: 100
	});

	// The H3 in "About" needs some intervention.
	$("#post-6641 h3").addClass("t06");


	// Modifying the podcasting plugin ("PowerPress")
	if($(".powerpress_player").length != 0) {
		var url = $(".powerpress_link_d").attr("href");
		$(".download a").attr("href",url);
		$("p.powerpress_links").remove();
	}

	// Give some RELs to those poor links that desire it
	$(".friends a").attr("rel","external");

	// Open links in external window
    $('a[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });


	// The H3 in "About" should be "About Americans United"
	$(".page-id-6641 .colBox-essay h3").addClass("t06");


	// Stylize the "Tagged In:" box
	$(".tagsBox").mouseover(function(){
		$(this).addClass("tagsBox-lit");
	}).mouseout(function(){
		$(this).removeClass("tagsBox-lit");
	});


	// Stylize the "AddThis" box
	$(".addthis_toolbox").mouseover(function(){
		$(this).addClass("addthis-lit");
	}).mouseout(function(){
		$(this).removeClass("addthis-lit");
	});


	// Hover switch for search button
	$("#searchsubmit").mouseover(function(){
		var pathHover = "http://www.cultureshocks.com/gamma/wp-content/themes/shockified/style/css/i/search_btn_hover.gif";
		$(this).attr("src",pathHover);
	}).mouseout(function(){
		var pathDormant = "http://www.cultureshocks.com/gamma/wp-content/themes/shockified/style/css/i/search_btn.gif";
		$(this).attr("src",pathDormant);
	});
	



	// Give the search field some default text
	$("#searchform #s").attr("value","Search Episodes");


	// Light up the search field during fun search times
	$("#searchform").addClass("searchform");
	$("#searchform #s").mouseover(function(){
		$("#searchform").addClass("searchform-hovered");
	}).mouseout(function(){
		$("#searchform").removeClass("searchform-hovered");
	});
	$("#searchform #s").focus(function(){
		$(this).attr("value","");
		$("#searchform").addClass("searchform-lit");
	}).blur(function(){
		$("#searchform").removeClass("searchform-lit");
	});










});