$.fn.callout = function (options) {

	return this.each(function (index) {
		var $this = $(this);
		var $a = $('a', $this);
				
		var xpos = Number($this.attr('xpos'));
		var ypos = Number($this.attr('ypos'));
		var type = $this.attr('type');
		
		if (type == undefined) type = 'BL';
		
		$this.css('position', 'absolute');
		
		var imgLeft = '';
		var imgRight = '';
		var dX = 0;
		var dY = 0;
		
		switch (type.toUpperCase()) {
			case 'BL':
				imgLeft = 'tooltip_start_B.png';
				imgRight = 'tooltip_end.png';
				/*
				dX = 11;
				dY = -39;
				*/
				break;
			case 'TL':
				imgLeft = 'tooltip_start_T.png';
				imgRight = 'tooltip_end.png';
				/*
				dX = 11;
				dY = -6;
				*/
				break;
			case 'BR':
				imgLeft = 'tooltip_start.png';
				imgRight = 'tooltip_end_B.png';
				/*
				if ($.browser.msie) {
					dX = 11 + 36 - $a.attr('offsetWidth');
				} else {
					dX = 11 - Number($a.css('width').replace('px',''));
				}
				dY = -39;
				*/
				break;
			case 'TR':
				imgLeft = 'tooltip_start.png';
				imgRight = 'tooltip_end_T.png';
				/*
				if ($.browser.msie) {
					dX = 11 + 36 - $a.attr('offsetWidth');
				} else {
					dX = 11 - Number($a.css('width').replace('px',''));
				}
				dY = -6;
				*/
				break;
		}
		
		$this.css('left', (xpos + dX).toString() + 'px');
		$this.css('top', (ypos + dY).toString() + 'px');		
		
		$this.addClass(type.toUpperCase());
		//$this.css('background', 'url(images/' + imgRight + ') no-repeat right top');
		//$a.css('background', 'url(images/' + imgLeft + ') no-repeat left top');
		
		$this.fadeIn(500);
	});
	
}