
jQuery.fn.tipbox = function(content, allowHtml, className){
	jQuery.fn.tipbox.created.id = "tipBox";
	$("body").append(jQuery.fn.tipbox.created);
	//set some properties for the tipBox division
	var tipBox = $(jQuery.fn.tipbox.created);
	tipBox.css({"position":"absolute","display":"none"});

	//functions
	function tipBoxShow(e){
		tipBox.css({"display":"block", "top":e.pageY+15, "left":e.pageX+15});
	}
	function tipBoxHide(){
		tipBox.css({"display":"none"});
	}

	//events for each element
	this.each(function(){
		$(this).mousemove(function(e){
			tipBoxShow(e);
			//update the content
			if(allowHtml)
				tipBox.html(content);
			else
				tipBox.text(content);
			//remove all classes for the tipBox before add a new one and to avoid the "append class"
			tipBox.removeClass();
			//set class if specified
			if(className) tipBox.addClass(className);
		});
		$(this).mouseout(function(){
			tipBoxHide();
		});
	});	
};

//create the element (avoiding create multiple divisions for the tipBox)
jQuery.fn.tipbox.created = document.createElement("div");

// functie pentru popup tabel

jQuery.fn.tipbox2 = function(content, allowHtml, className){
	jQuery.fn.tipbox2.created.id = "tipBox";
	$("body").append(jQuery.fn.tipbox2.created);
	//set some properties for the tipBox division
	var tipBox2 = $(jQuery.fn.tipbox2.created);
	tipBox2.css({"position":"absolute","display":"none"});
	//var inaltime = e.pageY+15;
	//functions
	function tipBoxShow2(e){
		tipBox2.css({"display":"block", "top":e.pageY-390, "left":e.pageX+20, "width":450});
	}
	function tipBoxHide2(){
		tipBox2.css({"display":"none"});
	}

	//events for each element
	this.each(function(){
		$(this).mousemove(function(e){
			tipBoxShow2(e);
			//update the content
			if(allowHtml)
				tipBox2.html(content);
			else
				tipBox2.text(content);
			//remove all classes for the tipBox before add a new one and to avoid the "append class"
			tipBox2.removeClass();
			//set class if specified
			if(className) tipBox2.addClass(className);
		});
		$(this).mouseout(function(){
			tipBoxHide2();
		});
	});	
};

//create the element (avoiding create multiple divisions for the tipBox)
jQuery.fn.tipbox2.created = document.createElement("div");