/**
Vertigo Tip by www.vertigo-project.com
Requires jQuery
*/

this.vtip = function(logos) {    
    this.xOffset = -4; // x distance from mouse
    this.yOffset = -140; // y distance from mouse       
    
    $(".vtip").unbind().hover(    
        function(e) {
            this.t = this.title;
            this.i = this.id;
            this.title = ''; 
            this.top = (e.pageY + yOffset); this.left = (e.pageX + xOffset);
			
			var linkId = this.id + '_link';
			
			$('#'+linkId).addClass('selected');
            
            $('body').append( '<div id="vtip"><table><tr><td><div id="logo_'+this.i+'" class="map_dot_logo"></div>' + this.t + '</td></tr></table></div>' );
            $('#vtip').css("top", this.top+"px").css("left", this.left+"px").fadeIn("fast");
            
        },
        function() {
            this.title = this.t;
			var linkId = this.id + '_link';
            $('#'+linkId).removeClass('selected');
            $("#vtip").fadeOut("fast").remove();
        }
    ).mousemove(
        function(e) {
            this.top = (e.pageY + yOffset);
            this.left = (e.pageX + xOffset);
			
            $("#vtip").css("top", this.top+"px").css("left", this.left+"px");
        }
    );            
    
};



jQuery(document).ready(function($){
	vtip();
	$('.comm_link').hover(
	function () {
		var dotId = $(this).attr('id');
		dotId = dotId.substring(0, dotId.length-5);
		$('#'+dotId).addClass('selected');
	},
	function () {
		var dotId = $(this).attr('id');
		dotId = dotId.substring(0, dotId.length-5);
		$('#'+dotId).removeClass('selected');
	}
)
})
