/*
	Observers
*/

// search and subscribe buttons
Event.observe(window, 'load', function() {

	Event.observe('search_button', 'mouseover', function(e) {
		$('search_button').src = "/images/buttons/search_on.gif";
	});
	
	Event.observe('search_button', 'mouseout', function(e) {
		$('search_button').src = "/images/buttons/search.gif";
	});

	Event.observe('subscribe_button', 'mouseover', function(e) {
		$('subscribe_button').src = "/images/buttons/subscribe_on.gif";
	});
	
	Event.observe('subscribe_button', 'mouseout', function(e) {
		$('subscribe_button').src = "/images/buttons/subscribe.gif";
	});
	
});	

	
function initBlogRollTabs() 
{
	Event.observe(window, 'load', function() {

		/*Event.observe('link_blogroll', 'click', function(e) {
			$('link_blogroll').addClassName('active');
			$('link_top_categories').removeClassName('active');
			$('link_archive_dates').removeClassName('active');

			Element.show('blogroll');
			Element.hide('top_categories');
			Element.hide('archive_dates');
			Event.stop(e);
		});*/

		Event.observe('link_top_categories', 'click', function(e) {
			$('link_blogroll').removeClassName('active');
			/*$('link_top_categories').addClassName('active');*/
			$('link_archive_dates').removeClassName('active');

			/*Element.hide('blogroll');*/
			Element.show('top_categories');
			Element.hide('archive_dates');
			Event.stop(e);
		});

		Event.observe('link_archive_dates', 'click', function(e) {
			/*$('link_blogroll').removeClassName('active');*/
			$('link_top_categories').removeClassName('active');
			$('link_archive_dates').addClassName('active');

			/*Element.hide('blogroll');*/
			Element.hide('top_categories');
			Element.show('archive_dates');
			Event.stop(e);
		});

	});	
}

function initArticleTabs() 
{
	Event.observe(window, 'load', function() {

		Event.observe('link_commented', 'click', function(e) {
			$('link_commented').addClassName('active');
			
			$('link_recommended').removeClassName('active');

			Element.show('commented');
			
			Element.hide('recommended');
			Event.stop(e);
		});



		Event.observe('link_recommended', 'click', function(e) {
			$('link_commented').removeClassName('active');
			
			$('link_recommended').addClassName('active');

			Element.hide('commented');
			
			Element.show('recommended');
			Event.stop(e);
		});

	});	
}

function observeCommentFormButtons() 
{
	Event.observe(window, 'load', function() {

		Event.observe('preview_button', 'mouseover', function(e) {
			$('preview_button').src = "/images/buttons/preview_on.gif";
		});
		
		Event.observe('preview_button', 'mouseout', function(e) {
			$('preview_button').src = "/images/buttons/preview.gif";
		});

		Event.observe('post_comment_button', 'mouseover', function(e) {
			$('post_comment_button').src = "/images/buttons/post_comment_on.gif";
		});

		Event.observe('post_comment_button', 'mouseout', function(e) {
			$('post_comment_button').src = "/images/buttons/post_comment.gif";
		});
					
	});		
}

