$(document).ready( function() {
	
	// Set first and last classes for li tags in sidebar
	$("#sideNavWrapper ul li:first").addClass("first");
	$("#sideNavWrapper ul li:last").addClass("last");
	
	// Auto display QuickSMS plugin if form was submitted
	if($('#quickSMSConfirmation').text() != "") {
		$('#quickSMSContainer').show();
	}
		
	// Handle all external links with [rel=external] set - send to new window :-)
	$('A[rel="external"]').click( function() {
		window.open( $(this).attr('href') );
		return false;	
	});
	
	// Make links from Sociable plugin open externally
	$('div.sociable ul li a').attr('rel','external nofollow').click( function() {
		window.open( $(this).attr('href') );
		return false;	
	});
	
	// Add nofollow and external to link love from cFormsII
	$('.linklove').attr('rel','external nofollow').click( function() {
		window.open( $(this).attr('href') );
		return false;	
	});
	
	// Add nofollow and external to links in popup
	$('body.popup a').attr('rel','external nofollow').click( function() {
		window.open( $(this).attr('href') );
		return false;	
	});
	
	// Determine current blog post and set link as current in sidenav
	//   iff the current artlicle is in the recent post list!
	$("#sideNavWrapper ul li:contains('" + $("#col1.isPost h1:first").html() + "')").addClass("current_page_item");
		
});

/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}


