$(document).ready(function() {


	// Firsts and Lasts...
	$("#primary .post:last-child").addClass("post-last");



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



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


	$("#searchsubmit").mouseover(function(){
		var pathHover = "/alpha/wp-content/themes/wallofseparation/style/css/i/search_button_hover.jpg";
		$(this).attr("src",pathHover);
	}).mouseout(function(){
		var pathDormant = "/alpha/wp-content/themes/wallofseparation/style/css/i/search_button_dormant.jpg";
		$(this).attr("src",pathDormant);
	});


	// Splitting "All Tags" list into two columns
	// Credit for this solution here: http://upsidestudio.com/web/splitcol/
	$('.wp-tag-cloud,.monthsDump').each(function() {
		if($(this).is("ol")) { var ordered = true; }
		var colsize = Math.round($(this).find("li").size() / 2);
		$(this).find("li").each(function(i) {
		     if (i>=colsize) {
		          $(this).addClass('right_col');
		     }
		});
		if(ordered) {
		     $(this).find('.right_col').insertAfter(this).wrapAll("<ol class='splitcol' start='" + (colsize+1) + "'></ol>").removeClass("right_col");
		} else {
		     $(this).find('.right_col').insertAfter(this).wrapAll("<ul class='splitcol'></ul>").removeClass("right_col");
		}
	});







});