$(document).ready(function() {
	
	/* TOOLTIP */
	$('.toolTip').hover(
		function() {
		
		this.tip = this.title; 
		var offset = $(this).offset();	

		var zmax = 1;
		zmax = zmax+1;
		$(this).css( 'zIndex', zmax );

		boxHtml = '<div class="toolTipWrapper">'
				+'<div class="toolTipTop">Info</div>'
				+'<div class="toolTipMid">'
					+this.tip
				+'</div>'
			+'</div>';

		
		$("body").append(boxHtml);
		
		try	{
			if(cssconfigurator) {
			
					/* Initial inside Configurator Tooltip Colors */		
					$(".toolTipWrapper").css('border', "1px solid " + $("#frm_cl_bg_box").val() );
					
					$(".toolTipTop").css('backgroundColor', $("#frm_cl_head_box").val() );
					$(".toolTipTop").css('color', $("#frm_f_cl_head").val() );	
					
					$(".toolTipMid").css('backgroundColor', $("#frm_cl_bg_page").val() );		
					$(".toolTipMid").css('color', $("#frm_f_cl_flow2").val() );	
			}	
		}
		catch (err){}
		
		
		this.title = "";
		this.width = $(this).width();
		left = offset.left+20;
		toolTipWrapperWidth = $('.toolTipWrapper').width();
		toolTipWrapperHeight = $('.toolTipWrapper').height();

		if(left+toolTipWrapperWidth>jQuery(window).width()) left = left-200;

		if ( parseInt($.browser.version) == 6 ) {
			   
				var iframe = $('<iframe />')
                    .css({
                        position: 'absolute',
                        width: toolTipWrapperWidth+'px',
                        height: toolTipWrapperHeight+'px',
                        left: left+'px',
                        top: offset.top+'px',
						zIndex: 100,
						filter:'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)'
                    })
                    .attr('id', "divShim")
                    .appendTo($("body"));
		};
		
		
		$('.toolTipWrapper').css({top:offset.top, left:left})
		$('.toolTipWrapper').fadeIn(300);
	},
	function() {
		$('.toolTipWrapper').fadeOut(100);
		$('.toolTipWrapper').remove();
		if ( $.browser.version == "6.0" ) $('#divShim').remove();
		
		this.title = this.tip;
		}
	);

});