// on dom ready 
$(function(){
	$('.top').scrollAnchors();	
	$(function(){
		$("a[rel='external']").attr('target','_blank');
	})
});



jQuery.fn.extend ({

	slideFadeToggle: function(speed, easing, callback) {
	  	return this.each(function() {
			$(this).animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback);
		}); 
	},
	
	showHideElement: function(target, callback) {
		return this.each(function() {
			($(target).hasClass('show')) ? $(target).show() : $(target).hide();
			$(this).click(function(){
				if(target) {
					$(target).slideFadeToggle('fast', null, callback).toggleClass("show").toggleClass("hide");
				}  else {
					$(this).slideFadeToggle('fast', null, callback).toggleClass("hide").toggleClass("show");
				}
			});
 
		});
	},
	
	toggleText: function(a, b) {
		return this.each(function() {
			$(this).text($(this).text() == a ? b : a);
		});
	},
	
	scrollAnchors: function() {
		return this.each(function() {
				$(this).click(function(){
					$(document).scrollTo(0,500,{easing:'easeOutSine'});
					return false;
				});
		});
	}

	
});
