function openpopup(popurl){
winpops=window.open(popurl,"","width=400,height=565,")
}

function startMyMenu(mySection) {
	var myMenu = new ClickMenu('menu');
	if (mySection=="aston") {myMenu.box1click('menu-1');}
	
	if (mySection=="michael") {myMenu.box1click('menu-2');}
	if (mySection=="andrew") {myMenu.box1click('menu-3');}
	if (mySection=="allnm") {myMenu.box1click('menu-4');}
	if (mySection=="john") {myMenu.box1click('menu-5');}
	if (mySection=="mary") {myMenu.box1click('menu-6');}
	if (mySection=="what we do") {myMenu.box1click('menu-7');}
	if (mySection=="contact us") {myMenu.box1click('menu-8');}
	}

/* mygosuMenu
 * 1.3.0 edited
 * (c) 2003,2004 Cezary Tomczak, edited 2005 R Dewhurst
 * http://gosu.pl/software/mygosumenu.html
 * BSD (revised)
 */

function ClickMenu(id) {
    this.box1Hover = true;
    this.box2Hover = true;

    this.init = function() {
        if (!document.getElementById(this.id)) {
            alert("Element '"+this.id+"' does not exist in this document. ClickMenu cannot be initialized");
            return;
        }
        this.parse(document.getElementById(this.id).childNodes, this.tree, this.id);
    }

    this.parse = function(nodes, tree, id) {
		var sub_num;
		var subid;
		sub_num = 0;
        for (var i = 0; i < nodes.length; i++) {
            if (nodes[i].nodeType != 1) {
                continue;
            }
 			if ("box1" == nodes[i].className.substr(0, 4)) {
				sub_num = sub_num + 1;
				subid = id + "-" + sub_num;
                nodes[i].id = subid;
                tree[tree.length] = new Array();
                eval('nodes[i].onmouseover = function() { self.box1over("'+nodes[i].id+'"); }');
                eval('nodes[i].onmouseout = function() { self.box1out("'+nodes[i].id+'"); }');
                eval('nodes[i].onclick = function() { self.box1click("'+nodes[i].id+'"); }');
            }            
            if ("section" == nodes[i].className) {
                nodes[i].id = subid + "-section";
                tree = tree[tree.length - 1];
            }
            if (nodes[i].childNodes) {
                this.parse(nodes[i].childNodes, tree, subid);
            }
        }
    }

    this.box1over = function(id) {
        if (!this.box1Hover) return;
        if (!document.getElementById(id)) return;
        document.getElementById(id).className = (this.id_openbox == id ? "box1-open-hover" : "box1-hover");
    }

    this.box1out = function(id) {
        if (!this.box1Hover) return;
        if (!document.getElementById(id)) return;
        document.getElementById(id).className = (this.id_openbox == id ? "box1-open" : "box1");
    }

    this.box1click = function(id) {
        if (!document.getElementById(id)) {
            return;
        }
        var id_openbox = this.id_openbox;
        if (this.id_openbox) {
            if (!document.getElementById(id + "-section")) {
                return;
            }
            this.hide();
            if (id_openbox == id) {
                if (this.box1hover) {
                    document.getElementById(id_openbox).className = "box1-hover";
                } else {
                    document.getElementById(id_openbox).className = "box1";
                }
            } else {
                document.getElementById(id_openbox).className = "box1";
            }
        }
        if (id_openbox != id) {
            this.show(id);
            var className = document.getElementById(id).className;
            if ("box1-hover" == className) {
                document.getElementById(id).className = "box1-open-hover";
            }
            if ("box1" == className) {
                document.getElementById(id).className = "box1-open";
            }
        }
    }

    this.show = function(id) {
        if (document.getElementById(id + "-section")) {
            document.getElementById(id + "-section").style.display = "block";
            this.id_openbox = id;
        }
    }

    this.hide = function() {
        document.getElementById(this.id_openbox + "-section").style.display = "none";
        this.id_openbox = "";
    }

    var self = this;
    this.id = id;
    this.tree = new Array();
    this.id_openbox = "";
    this.init();
}
