$(function() {
// BOF
	
	
	/* right nav fading 
	
	
	$('#rightWidgetSidebar').children().fadeTo(500,0.5);
	
	
	
	$('#rightWidgetSidebar .widget').hover(function() {
		$(this).fadeTo(200,1);
	}, function() {
		$(this).fadeTo(500,0.5);
	});
	
	*/


/**/


// HIDEYSHOWY
	

   $('.hideyShowy').find('dd').hide().end().find('dt').click(function() {
     $(this).next().slideToggle();
   });
   
	
// BORDER COLOUR HOVER
	
	   $(".thumbnail, .thumbnail-small").mouseenter(function(){
      $(this).animate({ 
		 borderTopColor: "#dedede",
		 borderLeftColor: "#dedede",
		 borderRightColor: "#dedede",
		 borderBottomColor: "#dedede"
      }, 500 );
    }).mouseleave(function(){
          $(this).animate({ 
		 borderTopColor: "#fff",
		 borderLeftColor: "#fff",
		 borderRightColor: "#fff",
		 borderBottomColor: "#fff"
      }, 200 );
    }).click(function(){
          $(this).animate({ 
		 borderTopColor: "#FF2600",
		 borderLeftColor: "#FF2600",
		 borderRightColor: "#FF2600",
		 borderBottomColor: "#FF2600"
      }, 50 );
    });




	
// jQUERY TABS

		$('#tabs').tabs({ fx: {  opacity: 'toggle', duration: 200 } }); 
		
	
// INSERT ICONS INTO TITLES - hacky


	$(".widget_text h2").addClass("icon-blackspike");
	$(".widget_twitter h2").addClass("icon-twitter");
	$(".flickrpress h2").addClass("icon-flickr");
	$(".widget_recent_entries h2").addClass("icon-recent");	
	$(".widget_recent_comments h2").addClass("icon-comment");	
	$(".widget_catcloud h2").addClass("icon-tag");
	
	

// INSERT RSS FEED INTO NAV BAR - hacky
	
	$(".mainMenu ul").append("<li><a href='http://www.blackspike.com/?feed=rss2' title='RSS FEED' class='nav-rss-link'>rss</a></li>");
	
	
	
/* INSERT NEWER/OLDER INTO NAV BARS - hacky
	
	$(".navigationLeft a").text($('.navigationLeft a').text()+"OLDER "); 
	$(".navigationRight a").text($('.navigationRight a').text()+" NEWER"); 
*/
	
	
//	CYCLE WIDGETS
	
	$('#rightWidgetSidebar .twitter').cycle({ 
    fx:     'fade', 
    speed:   200, 
    timeout: 14000, 
    pause:   1 
	});

//	CYCLE WIDGETS
	
	$('.flickrpress-container').cycle({ 
    fx:     'fade', 
    speed:   200, 
    timeout: 7000, 
    pause:   1 
	});


// CYCLE GALLERY
	
	$('.fullWidthGallery ul').cycle({ 
    fx:     'fade', 
    next:   '.svw',
    speed:   200, 
    timeout: 10000, 
    pause:   1 ,	
    next:   '.galleryNext a', 
    prev:   '.galleryPrev a' 
	});



/* ANIMATE NAV BG COLOR

	$('.page_item a:not(.current_page_item a), .ui-state-default a:not(.ui-state-active a)').mouseover(function() {  
    $(this).animate({ backgroundColor: "#9C9C9C" }, "fast"); 
	$(this).animate({ color: "#fff" }, "fast"); 
	}).mouseout(function() {  
		$(this).animate({ backgroundColor: "#8C8C8C" }, "fast"); 
		$(this).animate({ color: "#C4C4C4" }, "fast"); 
	}).click(function() {  
		$(this).animate({ backgroundColor: "#FF5B19" }, "fast"); 
	}); 



	$('.current_page_item a, .ui-state-active a').mouseout(function() {  
		$(this).animate({ backgroundColor: "#FF2600" }, "fast"); 
		$(this).animate({ color: "#fff" }, "fast"); 	
	}).click(function() {  	
		$(this).animate({ backgroundColor: "#FF5B19" }, "fast"); 
	}); 
*/

// SEARCHBOX TEXT WATERMARK

$("#s").val("Click here to search");
$("#s").click(function () {	
      $(this).val("");
      
    });

	
// ZEBRA STRIPES

 $('tr:even').addClass('zebraStripes');	

 $('.csvTable tr:first').addClass('th');



// EOF  
});