/**
 * ASSOB Members Stylsheet
 * 
 * @package ASSOB Members website
 * @subpackage Template
 * @author sm2.com.au
 * @version 1.0
 * @copyright SM2 2008.
 * @created 2008-04-21
 */



/**
 * Start manipulating the DOM as soon as the DOM is ready
 */
window.addEvent('domready', function(e){
	// Mark this page as enhanced:
	$E('body').addClass('enhanced');
	
	// Make sure the content area is taller than the main menu:
	var mainmenu = $E('#mainmenu ul.sm2MainMenu');
	var content = $E('#mainbody .container');
	if(mainmenu.offsetHeight > content.offsetHeight) {
		if (window.ie6) {
			content.setStyle('height', mainmenu.offsetHeight);
		} else {
			content.setStyle('min-height', mainmenu.offsetHeight);
		}
	}
	
	// Wrap the first word of each heading with a strong tag:
	$$('h1', '.contentheading', '.componentheading', '#subcontent h3').each(function(el){
		elem = el;
		while(elem.hasChild()) {
			elem = elem.getFirst();
		}
		text = elem.getText();
		words = text.trim().split(/\s/);
		if(words.length > 0) {
			complete = new Array();
			for(var i = 0; i < words.length; i++) {
				if(i == 0) {
					complete[complete.length] = '<strong>' + words[i] + '</strong>';
				} else {
					complete[complete.length] = words[i];
				}
			}
			elem.innerHTML = complete.join(' ').trim();
		}
	});
});