/*-----------------------------------------------------------------------------------------------*/
/*                                      SIMPLE jQUERY TOOLTIP                                    */
/*                                      VERSION: 1.1                                             */
/*                                      AUTHOR: jon cazier                                       */
/*                                      EMAIL: jon@3nhanced.com                                  */
/*                                      WEBSITE: 3nhanced.com                                    */
/*-----------------------------------------------------------------------------------------------*/

$(document).ready(function() {
    Tooltip();
});

function Tooltip() {

    var zmax = 100;
    $('.toolTip').hover(



		function() {

		    this.tip = this.title;

		    // Claus putter ind //
		    zmax = zmax + 1;
		    $(this).css('zIndex', zmax);
		    // Claus slut //



		    $(this).append(



			'<div class="toolTipWrapper">'
				+ '<div class="toolTipTop"></div>'
				+ '<div class="toolTipMid">'
					+ this.tip
				+ '</div>'
				+ '<div class="toolTipBtm"></div>'
			+ '</div>'
		);
		    this.title = "";
		    this.width = $(this).width();

		    $(this).find('.toolTipWrapper').css({ left: this.width - 123 })
		    $('.toolTipWrapper').fadeIn(300);
		},
	function() {
	    $('.toolTipWrapper').fadeOut(100);
	    $(this).children().remove();
	    this.title = this.tip;
	}
	);


    $('.toolTipLeft').hover(



		function() {

		    this.tip = this.title;

		    // Claus putter ind //
		    zmax = zmax + 1;
		    $(this).css('zIndex', zmax);
		    // Claus slut //



		    $(this).append(



			'<div class="toolTipWrapper">'
				+ '<div class="toolTipTop"></div>'
				+ '<div class="toolTipMid">'
					+ this.tip
				+ '</div>'
				+ '<div class="toolTipBtm"></div>'
			+ '</div>'
		);
		    this.title = "";
		    this.width = $(this).width();

		    $(this).find('.toolTipWrapper').css({ left: this.width - 80 })
		    $('.toolTipWrapper').fadeIn(300);
		},
	function() {
	    $('.toolTipWrapper').fadeOut(100);
	    $(this).children().remove();
	    this.title = this.tip;
	}
	);
}