$(document).ready(function(){ /// the DOM-ready thing covers the first four snippets

//================== manually and automatically designated internal and external links with icons
$(function(){
$('a[href^="http://"]').addClass('external').attr('target','_blank');
$('a[href^="https://"]').addClass('external').attr('target','_blank');
$('.external').attr('target','_blank');
$('a[href$=pdf]').addClass('pdfLink').attr('target','_blank');
$('a[href$=doc]').addClass('wordLink').attr('target','_blank');
});

//================= Simple but very nice toggle/fade with opacity
// Fade Slider Toggle plugin copyright(c) 2009, Cedric Dugas
// http://www.position-relative.net
// Licenced under the MIT Licence
jQuery.fn.fadeSliderToggle = function(settings) {
 	/* Damn you jQuery opacity:'toggle' that dosen't work!~!!!*/
 	 settings = jQuery.extend({
		speed:200,
		easing : "swing"
	}, settings)
	caller = this
 	if($(caller).css("display") == "none"){
 		$(caller).animate({
 			opacity: 1,
 			height: 'toggle'
 		}, settings.speed, settings.easing);
	}else{
		$(caller).animate({
 			opacity: 0,
 			height: 'toggle'
 		}, settings.speed, settings.easing);
	}
}; 

//================= Floaty Engage Tooltip
//** http://www.arcinspirations.com/
	$('a.tooltip').hover(function(){
		tipText = $(this).attr('title');
		$(this).attr('title','');
		$('body').append('<div id="tooltip">'+tipText+'</div>');
		$('#tooltip').css({opacity:0}).animate({opacity:0.8});
		$().mousemove(function(e){
			$('#tooltip').css({left:e.pageX + 20, top:e.pageY - 70}); // defines the relative position
		});
	},function(){
		$(this).attr('title', tipText);
		$('#tooltip').remove();
	});

}); /// the DOM ready thing thats covers all the above snippets
