<!-- ************* -->
<!--    SCRIPTS    -->
<!-- ************* -->


	//
	//  The following functions are used by the
	//  "Our Services" page to set the service-block
	//  elements visible and not visible.
	//
	
	// A global variable for the list of services ids
	var services = [
		"finance-office-services",
		"financial-management",
		"government-benefits",
		"human-resources",
		"information-systems",
		"insurance-reviews",
		"investment-advisory",
		"financial-planning",
		"property-planning",
		"reconfiguration-services"
		];
	

	function set_top_hidden() {
	// Run onLoad for all service_blocks
	// alert('set_top_hidden called');

		// If a specific service is in the link,
		//   leave that one visible.
		// Else, leave the "first" service visible.

		// Set the default visible service
		visible_service = services[0];
		// Indicate no specific service requested
		requested_service = ' ';
		// Set the pattern for matching the URL
		url = /\w\.html(#)([\w,-]+)/;

		// Check for service in URL
		if (document.URL.search(/\#\w+/) > 0) {
			// If so, get it
			// requested_service = 'insurance-reviews'; 
			parsed_url = document.URL.match(url);
			requested_service = parsed_url[2];
			
			// Set the "top" element id to the 
			//  requested service id so that the
			//  page will display at the top.

			// top_link = document.getElementById("top-link");
			// top_link.name = requested_service;
			window.scroll(0,0);
		}
		
		if (requested_service != ' ')
			visible_service = requested_service;

		
		// Set each service "hidden"
		//   unless it's specifically asked for.
		for (var i = 0; i < services.length; i++) {
			var the_service = document.getElementById(services[i]);
			
			if (services[i] != visible_service)
				the_service.style.visibility = "hidden";
			the_service.style.position = "absolute";
			the_service.style.top = "0px";
			
			// Set the corresponding link href
			var the_link_id = services[i] + "_link";
			var the_link = document.getElementById(the_link_id);
			// the_link.href = "#";
		}
	}

	function set_service_visible(requested_service) {
		// alert("The service passed was: " + requested_service);
		var services_left = document.getElementById("services-left");
		var services_box = document.getElementById("services-box");
		
		for (var i = 0; i < services.length; i++) {
			var current_service = document.getElementById(services[i]);
			
			if (requested_service == services[i]) 
				current_service.style.visibility = "visible"
			else 
				current_service.style.visibility = "hidden";
		}
		// scroll_location = document.getElementById('services-left').offsetTop;
		// window.scroll(scroll_location,0)
	}


	function print_styled_eaddr(name, domain, tld, style)
	{
		document.write("<a href=\"&#109;&#97;&#105;&#108;&#116;&#111;");
		document.write(":" + name + "&#64;");
		document.write(domain + "." + tld + "\">");
		document.write("<span class=\"" + style + "\">");
		document.write(name + "&#64;" + domain + "." + tld);
		document.write("<\/span>");
		document.write("<\/a>");
	}
	function print_eaddr(name, domain, tld, label)
	{
		document.write("<a href=\"&#109;&#97;&#105;&#108;&#116;&#111;");
		document.write(":" + name + "&#64;");
		document.write(domain + "." + tld + "\">");
		if (label=="default" | !label) {
			document.write(name + "&#64;");
			document.write(domain + "." + tld);
			} else {
			document.write(label);
		}
		document.write("<\/a>");
	}
	





/*
function print_eaddr(name, domain, tld, label)
{
	document.write("<a href=\"&#109;&#97;&#105;&#108;&#116;&#111;");
	document.write(":" + name + "&#64;");
	document.write(domain + "." + tld + "\">");
	if (label=="default" | !label) {
		document.write(name + "&#64;");
		document.write(domain + "." + tld);
		} else {
		document.write(label);
	}
	document.write("<\/a>");
}

function imgSwap(oImg)
{
   var strOver  = "_on"    // image to be used with mouse over
   var strOff = "_off"     // normal image
   var strImg = oImg.src
   if (strImg.indexOf(strOver) != -1) 
      oImg.src = strImg.replace(strOver,strOff)
   else
      oImg.src = strImg.replace(strOff,strOver);
}
	


function random_integer(max_num)
// Writes a random integer between 0 and max_num-1
//  where max_num < 100.
{
	rand_int = Math.floor(((Math.random() * 100 * max_num) % max_num));
	document.write(rand_int);
}
*/