// mootools 1.2 version
startList = function() 
{
	if(Browser.Engine.trident4) 
	{
		var navRoot = $("nav");
		var chNodes = navRoot.getChildren();
		
		chNodes.each(function(node) {
			node = $(node);
			if(node.get('tag') == "li") {
				node.addEvent('mouseover', function() {
					this.addClass('over');
				});
				node.addEvent('mouseout', function() {
					this.removeClass('over');
				});				
			}
		});
	}
}

window.addEvent('domready', function() {
	startList();
});

function pageTools(printer, email){
	document.write('<div id="pageTools">');
	if(printer == 1) {
		document.write('<img class="page_tool" src="images/icons/icon_sml_print.gif" alt="Print page" onclick="window.print();" onmouseover="this.style.cursor=\'pointer\'" border="0" />');
	}
	if(email == 1) {
		document.write('<img class="page_tool" src="images/icons/icon_sml_email.gif" alt="Email page" onmouseover="this.style.cursor=\'pointer\'" border="0" />');
	}
	document.write('</div>');
}

function changeLogo(name,path,action){
	if(action == 1){
		document.getElementById(name).src = path + 'images/design/logos/' + name + '.gif';
	}else{
		document.getElementById(name).src = path + 'images/design/logos/' + name + '_grey.gif';
	}
}

function wmPopup() {
	window.open('http://www.profinvest.com.au/clients/the_wealthmaker/popup.php','The_Wealthmaker','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no, width=690,height=400,left=200,top=60');
}

/** Present the user with a dialog prompt asking to confirm the requested action **/
function confirmAction(question, action, type){
	var confirmprompt = confirm(question);
	if(confirmprompt){
		if(type=='href'){
			window.location.href=(action);
		}else if(type=='submit'){
			document.action.submit();
		}
	}else{
		 /**
		  * Removed because it caused refresh issues when posted data exists
		  * location.reload(true);
		  */
		 return false;
	}
}