function showDiv(divID)
{
	document.getElementById(divID).style.display = 'block';
}

function toggleDiv(divID)
{
	if(document.getElementById(divID).style.display == 'none')
	{
		document.getElementById(divID).style.display = 'block';
		document.getElementById('img' + divID).src = '/images/icons/collapse.gif';
	}
	else
	{
		document.getElementById(divID).style.display = 'none';
		document.getElementById('img' + divID).src = '/images/icons/expand.gif';	
	}
}


function postLead()
{
	var strName = document.getElementById('name').value;
	var strCompanyName = document.getElementById('companyName').value;
	var strEmail = document.getElementById('emailAddress').value;
	
	if(strName.length < 1 || strCompanyName.length < 1 || strEmail.length < 1)
	{
		alert('You must provide all fields except phone and comments.');
	}
	else{
		document.getElementById('theForm').submit();
	}

}


function clickNav(itemName)
{
	switch(itemName)
	{
		case 'btnHome':
		  window.location.href = '/site/start.asp';
		  break;
		case 'btnHomeFooter':
		  window.location.href = '/site/aboutus.asp';
		  break;
		case 'btnContactUs':
		  window.location.href = '/site/contactus.asp';
		  break;
		case 'btnContactUsFooter':
		  window.location.href = '/site/contactus.asp';
		  break;	  
		case 'btnAboutUs':
		  window.location.href = '/site/aboutus.asp';
		  break;
		case 'btnWhyMPW':
		  window.location.href = '/site/whympw.asp';
		  break;
		case 'btnServices':
		  window.location.href = '/site/services.asp';
		  break;
		case 'btnResources':
		  window.location.href = '/site/resources.asp';
		  break;
		case 'btnRadio':
		  window.location.href = '/site/radiooverview.asp';
		  break;
		case 'btnSocialMedia':
		  window.location.href = '/site/socialmediaoverview.asp';
		  break;
		case 'btnTV':
		  window.location.href = '/site/tvoverview.asp';
		  break;
		case 'btnOnline':
		  window.location.href = '/site/onlineoverview.asp';
		  break;		  			  	  		  
		default:
	  	  window.location.href = '/site/';

	}
}






var pageName = 'Home';

function pageOn(name)
{
	pageName = name;
	//highlightTab
	//divName
	//adivName
	tabOn('div'+name);
	var tab = document.getElementById('span'+name);
	//tab.setAttribute("class", "tabOn");
	tab.className = 'tabOn';
	//alert(tab.className);
}

function tabOn(theId)
{
	tabOff();
	var element = document.getElementById(theId);
	document.getElementById('tabSub').innerHTML = element.innerHTML;
	//a + theId .class = aSubOn
}

function tabOff()
{
	//alert(pageName);
	var element = document.getElementById('div'+pageName);

	document.getElementById('tabSub').innerHTML = element.innerHTML;
	//a + theId .class = aSub
	
}

function tabOn2(menuItem)
{
	//tabOff();
	//var element = document.getElementById(theId);
	//document.getElementById('tabSub').innerHTML = element.innerHTML;
	//a + theId .class = aSubOn
	var position = new Array(2);
	position = findPos(document.getElementById('span' + menuItem));
	position[0] = position[0] - 5;
	//alert(position[0] + ' ' + position[1]);
	document.getElementById('divPanel' + menuItem).style.left = position[0];
	document.getElementById('divPanel' + menuItem).style.top = position[1];	
	document.getElementById('divPanel' + menuItem).style.display = 'block';
	
	tabOn('div'+menuItem);
	var tab = document.getElementById('span'+menuItem);
	//tab.setAttribute("class", "tabOn");
	tab.className = 'tabOn';


}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function tabDelayOff2(menuItem)
{
	document.getElementById('divPanel' + menuItem).style.display = 'none';
	var tab = document.getElementById('span'+menuItem);
	//tab.setAttribute("class", "tabOn");
	tab.className = 'tabOff';

}

function tabDelayOff()
{
	tabOff();
	//document.getElementById('divPanelDevelopment').style.display = 'none';

	//setTimeOut('tabOff',3000);
}
