var base_url = 'http://www.cmmc.org/';

function checkInfoPages() {
	if (window.location.href == base_url + 'info.html') {return 'true';}
	else if (window.location.href == base_url + 'card.html') {return 'true';}
	else if (window.location.href == base_url + 'news.taf') {return 'true';}
	else if (window.location.href.indexOf('/about-') >= 0) {return 'true'; alert('about');}
	else if (window.location.href.indexOf('/customer-service-') >= 0) {return 'true';}
	else if (window.location.href.indexOf('/patient-') >= 0) {return 'true';}
	else if (window.location.href.indexOf('/vendor-') >= 0) {return 'true';}
	else if (window.location.href.indexOf('/info-') >= 0) {return 'true';}
	else if (window.location.href.indexOf('/volunteer-') >= 0) {return 'true';}
	else {return 'false';}
}

function checkTrainingPages() {
	if (window.location.href == base_url + 'training.html') {return 'true';}
	else if (window.location.href.indexOf('/emp-') >= 0) {return 'true';}
	else if (window.location.href.indexOf('/nuc_med_') >= 0) {return 'true';}
	else if (window.location.href.indexOf('/train_rt_') >= 0) {return 'true';}
	else {return 'false';}
}


	
function checkResourcesPages() {
	if (window.location.href == base_url + 'resources.html') {return 'true';}
	else if (window.location.href == base_url + 'reslinks.taf') {return 'true';}
	else if (window.location.href == base_url + 'video-library.html') {return 'true';}
	else if (window.location.href == base_url + 'resourcelogin.taf') {return 'true';}
	else if (window.location.href == base_url + 'mgtresourcelogin.taf') {return 'true';}
	else if (window.location.href == base_url + 'cmmc-bylaws2.html') {return 'true';}
	else if (window.location.href.indexOf('/res-') >= 0) {return 'true';}
	else {return 'false';}
}

function mainMenuDisplays() {
	if (checkInfoPages() == 'true') {document.getElementById('info_group').style.display = "inline";}
	if (checkTrainingPages() == 'true') {document.getElementById('training_group').style.display = "inline";}
	if (checkResourcesPages() == 'true') {document.getElementById('resources_group').style.display = "inline";}
}


// window.onload = mainMenuDisplays;

if(document.addEventListener) document.addEventListener("DOMContentLoaded", mainMenuDisplays, false);
else 
{
    document.write("<scr" + "ipt id=__ie_onload defer src=javascript:void(0)><\/scri" + "pt>");
    var script = document.getElementById("__ie" + "_onlo" + "ad");
    script.onreadystatechange = function() 
    {
        if(this.readyState == "complete") mainMenuDisplays();       
    }
}
