jQuery.fn.tipbox = function(content, allowHtml, className){
	jQuery.fn.tipbox.created.id = "tipBox";
	$('#photowebcont').append(jQuery.fn.tipbox.created);
	//set some properties for the tipBox division
	var tipBox = $(jQuery.fn.tipbox.created);
	tipBox.css({"position":"absolute","opacity":"0","top":"15px", "left":"15px"});

	//functions
	function tipBoxShow(e){
		tipBox.fadeTo("normal", 0.7);
	}
	function tipBoxHide(){
		tipBox.fadeTo("normal", 0);
	}

	//events for each element
	this.each(function(){
		$(this).mouseover(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");

