// Eliminate conflict with mootools
jQuery.noConflict();

// Eliminate the last "|" in the nav menus
function EliminateLine(input){
	jQuery(input).addClass('end');
};
jQuery(function(){
	EliminateLine('.top_nav li:last a');
	EliminateLine('#global_nav li:last');
	
	// remove sidebar border on bottom item
	jQuery('li.post_titles:last').css('border-bottom','none');
	
	//Homepage Scroller
	jQuery(".scrollable").scrollable().circular().autoscroll({autoplay:true});
});

// function to iterate through Author name and get profile picture string
function GetUserName(name) {
	jQuery(name).each(function(index) {
		var author_name = jQuery(this).html();
		author_name = remove_space( author_name );
		var author_names = author_name.split(',');
		var name_length = author_names.length;
		name_length = name_length - 1;
		var author_last = author_names[0];
		var author_first = author_names[name_length];
		var author_login = author_last;
		var author_initial = author_first.charAt(0);
		author_login = author_login + author_initial;
		author_login = author_login.toLowerCase();
		author_login = remove_dash(author_login);
		jQuery(this).before('<img src="/wordpress/wp-content/uploads/userphoto/' + author_login + '.jpg">');
	});
};

// Remove the "-" from the usernames
function remove_space( string ) {
	//return string.replace(" ", "");
	return string.split(' ').join('');
	
};
// Remove the "-" from the usernames
function remove_dash( string ) {
	return string.replace( "-", "");
	
};

