jQuery.noConflict();


jQuery(document).ready(function() {
  jQuery(".top_nav").click(function() {
  	if (jQuery(this).is('.active')) {
		jQuery(this).toggleClass('active');	
		jQuery("#logo").css( { "margin-top": (20) + "px"} );	
 	} else {
		jQuery('.active').removeClass('active'); 			
		jQuery(this).toggleClass('active');
		var height = jQuery(this).find("div").height();
		jQuery("#logo").css( { "margin-top": (height + 20) + "px"} );
	}
  });

	// get logo on archive in right place 	
	var height = jQuery('.active').find("div").height();
	jQuery("#logo").css( { "margin-top": (height + 20) + "px"} );
  
   jQuery("#boxes").click(function() {
     jQuery(".listing").fadeOut();
     jQuery(".thumbs").fadeIn();
   });

   jQuery("#list").click(function() {
     jQuery(".thumbs").fadeOut();
     jQuery(".listing").fadeIn();
   });

   jQuery("#section").click(function() {
     jQuery("#navigations").toggle();
   });
   
	/* hover for featured posts 	*/



	jQuery(".selected_post").mouseover(function() {
		//get the position of the placeholder element
		var pos = jQuery(this).offset();  
		var width = jQuery(this).width();
		var height = jQuery(this).height();		
		jQuery('#hovertitle').html( jQuery(this).find('span.content').html() )
		var mwidth = jQuery('#hovertitle').width();		
		
		// swap image
        //var src = jQuery(this).find("img").attr("src").match(/[^\.]+/) + "_color.jpg";
        //jQuery(this).find("img").attr("src", src);
		
		
		//show the menu directly over the placeholder
		jQuery("#hovertitle").css( { "left": (pos.left + 115 - mwidth/2) + "px", "top": (pos.top + 250 - height/2 - 10) + "px" } );
		jQuery("#hovertitle").show();
  	});

	jQuery("#content, #header, #header, #subscribe_follow, #premier_sponsor").mouseover(function() {
		jQuery("#hovertitle").hide();
	});

	jQuery("#rap").mouseleave(function() {
		jQuery("#hovertitle").hide();
	});


});


 
