$(document).ready(function(){
	
	$('.categories li').append('&raquo;');
	
	// ajax pagination
	$('.pagination a').live('click', function(){ // if not using wp-page-numbers, change this to correct ID
		var link = jQuery(this).attr('href');
					// #main is the ID of the outer div wrapping your posts
		var loadHt = $('#content').height();
		$('#content').css('height',loadHt);
		$('#content').html('<div class="loading"><h2><img src="/wp-content/themes/EMC2/images/ajax-loader.gif" /></h2></div>');
					// #entries is the ID of the inner div wrapping your posts
		$('#content').load(link+' .subContent')	
	});
	
	$('#s').val("search...");
	var $search = $('#s');//Cache the element for faster DOM searching since we are using it more than once
	original_val = $search.val(); //Get the original value to test against. We use .val() to grab value="Search"
	$search.focus(function(){ //When the user tabs/clicks the search box.
		if($(this).val()===original_val){ //If the value is still the default, in this case, "Search"
			$(this).val('');//If it is, set it to blank
		}
	})
	.blur(function(){//When the user tabs/clicks out of the input
		if($(this).val()===''){//If the value is blank (such as the user clicking in it and clicking out)...
			$(this).val(original_val); //... set back to the original value
		}
	});
	
});


function preload(arrayOfImages) {
    $(arrayOfImages).each(function(){
        $('<img/>')[0].src = this;
    });
}


