/*
 * Url preview script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */

tooltipInit = function(){	
	/* CONFIG */
		xOffset = 5;
		yOffset = -10;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$("a.tooltip-item").hoverIntent(function(e){
		/*this.t = this.title;
		this.title = "";*/	
		
		
		switch(this.rel){
            case 'Graffiti':
                text = 'Click here to <br/> graffitize your look!';
                break;
            case 'Sprite Puzzle':
                text = 'Get all puzzled up  <br/> with the new Sprite Puzzle';
                break;
			case 'GUC':
			case 'BUE':
				text = '21st - 25th Feb';
				break;			
			case 'Cairo University':
			case 'Ain Shams':
				text = '7th - 11th March';
				break;
			case 'AUC':
			case 'MIU':
				text = '28th Feb - 4th March';
				break;
		
		}
		
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<div id='tooltip'><span style='color: #5ab74c'>"+ this.rel + "</span><br>" + text +"</div>");								 
		
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");
		
		return false;
    },
	function(){		
		$("#tooltip").hide().remove();
		return false;
    });	
	
	/*$("a.tooltip-item").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});	*/
};

