$(document).ready(function() {



	$('#Who_link').toggle(function(event) {
	
	          event.preventDefault();
	
	          $('#Who_div').fadeIn('slow');
	          $('#Who_link > span').html('[hide]'); },
	          
	          function(){$('#Who_div').fadeOut('slow');
	                             $('#Who_link > span').html('[view]');
	               
	
	});
	
	$('#Nav_link').toggle(function(event) {
	
	          event.preventDefault();
	
	          $('#Nav_div').fadeIn('slow'); 
	          $('#Nav_link > span').html('[hide]');},
	          
	          function(){$('#Nav_div').fadeOut('slow');
	                              $('#Nav_link > span').html('[view]');
	
	});
	
	$('#Author_link').toggle(function(event) {
	
	          event.preventDefault();
	
	          $('#Author_div').fadeIn('slow'); 
	          $('#Author_link > span').html('[hide]');},
	          
	          function(){$('#Author_div').fadeOut('slow');
	                              $('#Author_link > span').html('[view]');
	
	});
	
	
	
	function insertAd() {
	html = "<!--[if lt IE 8]>";
	html += "<div class='newMessage'>";
	html += '<img src="/images/ie8.jpg" width="50" height="50" style="float:left;margin:5px 15px;" />';
	html += "<br>There is a great new version of Internet Explorer 9 now - much faster, more secure, and with more features than ever! ";
	html += "At TruckingTruth we highly recommend you ";
	html += "<a href='http://www.kqzyfj.com/click-3215298-10760544' target='_blank'>";
	html += "download it free here</a> or ";
	html += '<a href="http://www.anrdoezrs.net/click-3215298-10760437" target="_blank"> add the free Yahoo toolbar</a>';
	html += ' for great new features!';
	html += '</div>';
	html += "<![endif]-->";
	
	$('div#content').prepend(html);
	$('.newMessage').show('slow');
	}
	
	setTimeout(insertAd, 3000);
	
	
	$('.viewMoreBlogs').click(function(e){
	           e.preventDefault();
	           $('.blogList').css('height','auto');
	           $('.viewMoreBlogs').remove();
	});

	//this opens and closes the menus
     $('.menuItem').click(function(e){
         if ($(e.target).is('.menuTitle')) { 
                 e.preventDefault(); 
                 if ($(this).children('.menuInner').hasClass('viewNow')) {
                      return $(this).children('.menuInner').removeClass('viewNow');
                 }
         $('.menuInner').removeClass('viewNow');
	     $(this).children('.menuInner').addClass('viewNow');
         
         }
	     
     });

        

});

