
$.fn.cmtip = function(options) {
	$('body').append('<p id="cmtip" style="display: none;"><img id="cmtipArrow" /><strong><span></span></strong></p>' );
	
	// iterate and reformat each matched element
	return this.each(function() {
		if( !jQuery.browser.msie || jQuery.browser.version.substr(0,1) >= 7 ) {
			var title = $(this).attr('title');
			$(this).attr('title', '');
			$(this).hover(function() {
				var offset = $(this).offset();
				var o = $(window).width() - offset.left-24;
				$('p#cmtip').stop().css('opacity', 0).show();
				$('p#cmtip #cmtipArrow').attr("src", '/img/header/cmtip.png');
				$('p#cmtip span').html(title);
				$('p#cmtip')
					.css("top", offset.top+34+"px").css("right", o+"px")
					.stop()
					.fadeTo(100, 1);
			}, function() {
				$("p#cmtip").stop().fadeOut(100);
			});
		}
	});
};