/*	ChillTip Version 1.1 - Packed
	by Christopher Hill - (http://www.chillwebdesigns.co.uk/)
	Last Modification: 27/09/10
	For more information, visit: (http://www.chillwebdesigns.co.uk/chilltip.html)
	Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
	- Free for use in both personal and commercial projects
	- Attribution requires leaving author name, author link, and the license info intact */																																		    
	// Settings for modification.													.
	BackgroundColor 	= "#000000"; // ChillTip background color in (hex)		
	BorderColor 		= "#333333"; // ChillTip border colour in (hex)			
	TextColor			= "#FFFFFF"; // ChillTip main font colour in (hex)		
	TextSize			= "11px";  	 // ChillTip content text size in (pixels)	
	BackgroundOpacity 	= "85";	 	 // ChillTip opacity in (0-100%)	
	MaxWidth			= "145px";   // Maximum width of ChillTip in (pixels)	
	FadeTime			= 500;		 // ChillBox fade in time (milliseconds)
	
	// The colors below can be changed to get the colour you desire
	ColorOne			= "#0033FF"; // This is color Blue in (hex)
	ColorTwo			= "#FF00CC"; // This is color Pink in (hex)
	ColorThree			= "#33CC00"; // This is color Green in (hex)
	ColorFour			= "#9900FF"; // This is color purple in (hex )	
	ColorFive			= "#FF0000"; // This is color Red in (hex)
	ColorSix			= "#FFFF00"; // This is color Yellow in (hex)
function addtips()
{
    $j('.ChillTip').mouseover(function ()
    {
        $j('body').append('<div class="title"></div>');
        var title = $(this).attr("title");
        $j('.title').append('<p>' + title + '</p>');
        $j('.title').css(
        {
            background: BackgroundColor,
            border: '2px solid',
            borderColor: BorderColor,
            display: 'none',
            fontFamily: 'Arial,Helvetica,sans-serif',
            height: 'auto',
            minWidth: '10px',
            maxWidth: MaxWidth,
            position: 'absolute',
            width: 'auto',
            Zindex: '1001'
        });
        if (BackgroundOpacity == '100')
        {
            $j('.title').fadeIn(FadeTime)
        }
        else
        {
            $j('.title').css("filter:", "alpha(opacity=BackgroundOpacity)").css("-moz-opacity", "0." + BackgroundOpacity).css("-khtml-opacity", "0." + BackgroundOpacity).css("opacity", "0." + BackgroundOpacity);
            $j('.title').fadeIn(FadeTime)
        }
        $j('a,img').css(
        {
            cursor: 'pointer'
        });
        $j('span.one').css(
        {
            color: ColorOne
        });
        $j('span.two').css(
        {
            color: ColorTwo
        });
        $j('span.three').css(
        {
            color: ColorThree
        });
        $j('span.four').css(
        {
            color: ColorFour
        });
        $j('span.five').css(
        {
            color: ColorFive
        });
        $j('span.six').css(
        {
            color: ColorSix
        });
        $j('.title p').css(
        {
            color: TextColor,
            float: 'left',
            margin: '0',
            padding: '10px',
            textAlign: 'justify',
            fontSize: TextSize,
            width: 'auto'
        });
        if ($j.browser.msie && $j.browser.version <= 6)
        {
            $j('.title').css(
            {
                width: MaxWidth
            })
        }
        this.tip = this.title;
        this.title = ""
    });
    $j('.ChillTip').mousemove(function (e)
    {
        var border_top = $j(window).scrollTop(),
            border_right = $j(window).width(),
            offset = 15,
            left_pos, top_pos;
        if (border_right - (offset * 2) >= $j('.title').width() + e.pageX)
        {
            left_pos = e.pageX + offset
        }
        else
        {
            left_pos = border_right - $j('.title').width() - offset
        }
        if (border_top + (offset * 2) >= e.pageY - $j('.title').height())
        {
            top_pos = border_top + offset
        }
        else
        {
            top_pos = e.pageY - $j('.title').height() - offset
        }
        $j('.title').css(
        {
            left: left_pos,
            top: top_pos
        })
    });
    $j('.ChillTip').mouseout(function ()
    {
        $j('.title').remove();
        this.title = this.tip
    })
}
