/***********************************************
	General Javascripts
	Print Genie
	Author: Jeff Lowder
	Contact Number: 0419 350 760 (Australia)
	Date Started: 20/11/06
	
	Most functionality relies on JQuery
	Version: 1.7
***********************************************/
startList = function(){
    if (document.all && document.getElementById) {
        navRoot = document.getElementById("menu");
        if (document.getElementById("menu")) {
            for (i = 0; i < navRoot.childNodes.length; i++) {
                node = navRoot.childNodes[i];
                if (node.nodeName == "LI") {
                    node.onmouseover = function(){
                        this.className += " over";
                    }
                    node.onmouseout = function(){
                        this.className = this.className.replace(" over", "");
                    }
                }
            }
        }
    }
}
window.onload=startList;


//show a popup box
var showPopup = function(id,options) {
    options = (options !== undefined) ? options : {
        width : 500,
        height : 400
    };
	jQuery(id).dialog({
        modal: true,
        autoOpen:false,
        width: options.width,
        height: options.height,
        close: function(id){
            closePopup(id);
        },
		zIndex : 10000
    });
	jQuery(id).dialog('open');
}

//close a popup box
var closePopup = function(id) {
	jQuery(id).dialog('close');
}

jQuery.fn.log = function (msg) {
    if(console){
        console.log("%s: %o", msg, this);
      return this;
    }
};