
$(document).ready(function() {



	//provide hover for hard to grab element below
	
	$('.more-link').hover(function() {
		$(this).css('color', 'black');	
	}, function() {
		$(this).css('color', '#1e90ff');
	});
	
	
	//provide hover for hard to grab element below
	
	$('a[rel=category tag]').hover(function() {
		$(this).css('color', 'black');	
	}, function() {
		$(this).css('color', '#1e90ff');
	});


	//open post anchors in new window

	//$('#blog_wrap a').attr('target', '_blank');
	
	$('.new_window').attr('target', '_blank');
	
	
	// set navigation hover effects
	
	$('.navigation a').hover(function() {
		$(this).addClass('hoverState');	
	}, function() {
		$(this).removeClass('hoverState');
	});
	
	// selected states
	
	var currentPage = window.location.href;
	/* console.log(currentPage); */
	
	if (currentPage.match('/blog/')) {
	
	$('.navigation a:last').addClass('selectedState').removeClass('hoverState');
	
	}
	
	else if (currentPage.match('/posts/')) {
	
	$('.navigation a:last').addClass('selectedState').removeClass('hoverState');
	}
	
	
	else if (currentPage.match('/?s=')) {
	
	$('.navigation a:last').addClass('selectedState').removeClass('hoverState');
	}
	else if (currentPage.match('http://www.robwalshonline.com/')) {
	
	$('.navigation a:first').addClass('selectedState').removeClass('hoverState');
	}
	
	// IMG HOVER
	
  // $('.single_title a IMG').hover(function() {
  //  $(this).css('opacity', '0.5');  
  // }, function() {
  //     $(this).css('opacity', '1');
  // });

	//style quotes
	
	$('blockquote').prepend('<span class="left_quote">&ldquo;</span>');
	
	$('blockquote').append('<span class="right_quote">&rdquo;</span>');
	
	//style citations
	
	$('#blog_wrap > .single_title > p > cite').wrap('<div class="cite_div"></div>'); // on single post page
	
	$('#blog_wrap > .blog_content > .post > p > cite').wrap('<div class="cite_div"></div>'); // on multiple posts page
	
	//$('cite').wrap('<div class="cite_div"></div>') this script wasn't specific enough
	
	
	
	// GET RID OF COMMENT INSTRUCTION BLOCK
	
	//$('.user_comments p:first').css('display', 'none'); this didn't work consistently
	
	//$('#blog_wrap > .single_title > p:last').css('display', 'none'); this didn't work consistently
	
	$('.user_comments p:contains(XHTML)').css('display', 'none');
	
	
	

	// SEARCH PAGE CSS
	
		// line up post h2 items
	
	if (currentPage.match('/?s=')) {
	
	$('.search_title > .search_results > .post > h2').css('margin-left','8px');
	
	$('.categories h2').css('margin-left', '0px');	
	
	$('.wp_sidebar li:first').css('font-style', 'italic' );
	
	
	}
	
		//give attachments a bg_texture
		$('div[id*=attachment]').addClass('attachment');
		
		
});

