this.toptips = function(){	
	var xOffset, yOffset;
	/* screen height and width */
	var bodywidth = $(window).width();
		
	$("a").hover(function(e){

		/* getting image source from rel attrbute */
		var alt = $(this).attr("alt");
		if(typeof(alt)!="undefined"){
		
		$("body").append("<div id='tip'>"+ alt +"</div>");

		var imgwidth = $("#tip").width();
		
		xOffset = 15;
		if((bodywidth - e.pageX) < (bodywidth / 10)){
			yOffset = -30 - imgwidth;
		} else {
			yOffset = 20;
		}
		
		$("#tip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");
    		}
	},
	function(){
		$("#tip").remove();
    });

  	$("a").mousemove(function(e){
		$("#tip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});
$("img").hover(function(e){

		/* getting image source from rel attrbute */
		var alt = $(this).attr("alt");
		if((typeof(alt)!="undefined")&&(alt!="")){
		
		$("body").append("<div id='tip'>"+ alt +"</div>");

		var imgwidth = $("#tip").width();
		xOffset = 15;
		if((bodywidth - e.pageX) < (bodywidth / 10)){
			yOffset = -30 - imgwidth;
		} else {
			yOffset = 20;
		}
		
		$("#tip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");
    		}
	},
	function(){
		$("#tip").remove();
    });

  	$("img").mousemove(function(e){
		$("#tip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});					

$("span").hover(function(e){

		/* getting image source from rel attrbute */
		var alt = $(this).attr("alt");
		if(typeof(alt)!="undefined"){
		
		$("body").append("<div id='tip'>"+ alt +"</div>");

		var imgwidth = $("#tip").width();
		xOffset = 15;
		if((bodywidth - e.pageX) < (bodywidth / 10)){
			yOffset = -30 - imgwidth;
		} else {
			yOffset = 20;
		}
		
		$("#tip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");
    		}
	},
	function(){
		$("#tip").remove();
    });

  	$("span").mousemove(function(e){
		$("#tip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});					
};
