// FancyTips, an (not quite) extension of mootools Tips
// Enables more formatting of the tip contents than what xhtml validation
// with Tips allows.
//
// Example HTML:
//
// <a href="link.html" class="tooltips">
//		Link text
//		<span class="tipcontents">
//			<img src="images/an_image.jpg" alt="An image" />
//			<strong>More formatting is allowed here</strong>
//		</span>
//	</a>
//
// Javascript:
//	
//	var my_tips = new FancyTips($$('.tooltips'));
//
var FancyTips = new Class({
	initialize: function (elements, options) {
		this.setOptions({
			"tipcontents": ".tipcontents"
		},options);
 
		elements.each(function (element) {
			contents_element = element.getElement(this.options.tipcontents);
			if (contents_element) {
				//element.setProperty('title', contents_element.innerHTML);
				element.setProperty('title', contents_element.innerHTML);
			}
		}, this);
 
		this.tips = new Tips(elements, options);
	}
});
 
FancyTips.implement(new Options);
