﻿
var currentlyShowing;
isShowing = false;

function openLink(xLink, xNewWindow) {
	if(xNewWindow) {
		newWin = window.open(xNewWindow);
	}
	
	else {
		document.location.href = xLink;
	}

}


function showMenuItems(id) {
	div = document.getElementById(id);
		
	if(div.style.display == "") {
		div.style.display = "none";
		isShowing = false;
	}
	
	else {
	
		if(isShowing) {
			currentlyShowing.style.display = "none";
		}

		currentlyShowing = div;
		div.style.display = "";
		isShowing = true;
	}

}

function getContactInfoMenuItems(width) {
	var theLinks = new Array(["Infrastructure", "infrastructure.html"], ["Development", "development.html"]);
		
	getMenuItems('contactinfoMenu', theLinks, width);
}


function getFAQsMenuItems(width) {
	var theLinks = new Array(["Infrastructure", "infrastructure.html"], ["Development", "development.html"]);
		
	getMenuItems('faqsMenu', theLinks, width);
}


function getPartnersMenuItems(width) {
	var theLinks = new Array(["Infrastructure", "infrastructure.html"], ["Development", "development.html"]);
		
	getMenuItems('partnersMenu', theLinks, width);
}


function getHostingServicesMenuItems(width) {
	var theLinks = new Array(["Design", "website_design.html"], ["Management/Maintenance", "management_maintenance.html"], ["Hosting", "hosting.html"]);
		
	getMenuItems('hostingservicesMenu', theLinks, width);
}


function getSmallBusinessMenuItems(width) {
	var theLinks = new Array(["Networking Services", "networking_services.html"], ["Desktop/Server Support", "desktop_server_support.html"], ["Data Backup Services", "data_backup_services.html"], ["Automation Services", "automation_services.html"], ["Training Services", "training_services.html"], ["Software Services", "software_services.html"]);
		
	getMenuItems('smallbusinessMenu', theLinks, width);
}


function getConsultingMenuItems(width) {
	var theLinks = new Array(["Advisory", "advisory.html"], ["Infrastructure", "infrastructure.html"], ["Systems Security", "systems_security.html"], ["Application Development", "application_development.html"]);
		
	getMenuItems('consultingMenu', theLinks, width);
}


function getMenuItems(id, theLinks, width) {

	theLinkStr = "";
	theLinkStr += '<div id="' + id + '" style="position:absolute; padding:0; margin:0; text-align:left; background-color:white; font-size:small; font-family:Verdana, Arial, Helvetica, sans-serif; width:' + width + 'px; border: 1px solid #d3d3d3; z-index:2; display:none;">';
	
	for(i = 0; i < theLinks.length; i++) {
		theLinkStr += '<span style="width:' + width + 'px; color:black;" onmouseover="selectPointer(this)"; onclick="openLink(\'' + theLinks[i][1] + '\')">' + theLinks[i][0] + '</span><br>';
	}
	
	document.write(theLinkStr);

}

function selectPointer(id) {
	id.style.cursor = "pointer";
}