// Highlights the current page's link
menu_items = new Object();
var menu_count = 0;
function build_menu(div_id) {
			menudiv = document.getElementById(div_id);
			menudiv.innerHTML = '';
			for (i=0; i< menu_count; i++) {
				menudiv.innerHTML += '<div id="' + menu_items[i].name + "_head" + '" class="topmenuh" onclick="changebody(' + "'" + menu_items[i].name  + "'" + ')"><a href="?' + menu_items[i].name + '" onclick="return false;">' + menu_items[i].description + '</a></div>';	
			}
		}
// Highlights the current page's link
function currentmenu(name) {
		build_menu("topmenu");
		changetotopmenucurrent = document.getElementById(name + '_head');
		changetotopmenucurrent.setAttribute('id','topmenucurrent');
                if(name == "services")
                {
                    document.getElementById("dropdowntaba").style.color = "#000000";
                }
                else
                {
                    document.getElementById("dropdowntaba").style.color = "#ffffff";
                }
}
//Changes the body inside the page
function changebody(name) {
	new_location = document.location.href.split("#");
	currentmenu(name);
	document.location.href = new_location[0] + "#" + name;
        xml_fetch( name + ".xml","innerbody","");
}

function changebodywithanchor(name,anchor) {
	new_location = document.location.href.split("#");
	currentmenu(name);
	document.location.href = new_location[0] + "#" + name;
        xml_fetch(name + ".xml","innerbody",anchor);
}

function menu_item(name, description) {
	this.name = name;
	this.description = description;
	menu_count++;
}

function loadLightBox() {
        $(document).ready(function(){
                $("a[rel='group1']").colorbox();
        });
}

function opendropdown() {
        document.getElementById('dropdown').style.display = 'block';
}

function closedropdown() {
        document.getElementById('dropdown').style.display = 'none';
}


