 jQuery(document).ready(function() {

	jQuery.localScroll();
	
	// remove title attributes from menu display (still accessible to search engines ftw)
	jQuery('li.menu-item a').each(function(){
	     jQuery(this).removeAttr('title');
	 });               
	
	 jQuery('li.page_item a').each(function(){
	     jQuery(this).removeAttr('title');
	 });
	
	// add xhtml strict valid way to replace target=blank attribute for link
	// usage <a href="www.domain.com" rel="external">link</a>
	jQuery('a[rel="external"]').click( function() {
	window.open( jQuery(this).attr('href') );
	return false;
	});
	
	// add support to launch simple popup window
	// usage <a href="www.domain.com" class="popup">link</a>
	jQuery('a.popup').live('click', function(){
		newwindow=window.open(jQuery(this).attr('href'),'','height=500,width=980,scrollbars=yes');
		if (window.focus) {newwindow.focus()}
		return false;
	});
	
	jQuery('a.popup_medium').live('click', function(){
		newwindow=window.open(jQuery(this).attr('href'),'','height=480,width=640,scrollbars=yes');
		if (window.focus) {newwindow.focus()}
		return false;
	});
	
	jQuery('a.demowindow').live('click', function(){
		newwindow=window.open(jQuery(this).attr('href'),'','height=700,width=1024,scrollbars=yes');
		if (window.focus) {newwindow.focus()}
		return false;
	});
	
	// add a few cross browser transparency classes
	jQuery('.trans25').css('opacity', '0.25');
	jQuery('.trans50').css('opacity', '0.5');
	jQuery('.trans75').css('opacity', '0.75');
	
	// add odd and even classes to table rows
	jQuery('table.data_table tbody > tr:odd').addClass('odd');
	jQuery('table.data_table tbody > tr:even').addClass('even');
	
	// add additional class to first and last li's
	jQuery('li.widget ul li:first-child, .rg_topnav li:first-child').addClass('firstitem');
	jQuery('li.widget ul li:last-child, .rg_topnav li:last-child').addClass('lastitem');
	
	// hide the button and label on the search widget for this layout
	jQuery('.widget_search input#searchsubmit,.widget_search form#searchform label').hide();
	jQuery('#at_leftcol_content .at_entry_content form#searchform label').hide();
	
	jQuery('.gform_wrapper .gfield_required').html('* required');
	
	jQuery('.gfield_description').each(function(i,e){
	    fielddesc = jQuery('<div>').append(jQuery(e).clone()).remove().html();
	    jQuery(e).siblings('label.gfield_label').after(fielddesc);
	    jQuery(e).remove();
	});
	
	jQuery('.widget_twitter div.twitter-avatar').hide();
	jQuery('.widget_twitter span.in-reply-to-meta').hide();
	jQuery('.widget_twitter ul').after('<div class="rg_followlink"><a href=http://twitter.com/rocketgenius>follow Rocketgenius</a></div>');
	
	// add a flag to the post author comments
	jQuery('li.bypostauthor').prepend('<div class="authorflag">author</div>');
	
	// add a div to wrap the comment avatar
	jQuery('ol.commentlist li.comment div.vcard img.avatar').wrap('<div class="at_comment_avatar"></div>');
	
	
	
	

});


 
 

