// JavaScript Document

//variables for email obfuscation
var emGenName = "info";
var emHost1 = "nextsteps";
var emHost2 = "marketing.com";

var emTing = "gary";
var emWong = "kim";
var emWalsh = "maire";
var emPopalardo = "mike";
var emSelby = "thea";
var emThomas = "lisa";
var emBickle = "deb";

// Function to open quote popup
function popQuote(whichQuote) {
	quoteWin=window.open(whichQuote,"quotes","width=500,height=475,toolbar=no,scrollbars=no,menubar=no,resize=no,status=no,left=10,top=10");
	quoteWin.focus();
	}

//show or hide the "Other Services" sections
function toggleSection(currSection) {
	if (document.getElementById) {
	thisMenu = document.getElementById(currSection).style;
		if (thisMenu.display == "block") {
			thisMenu.display = "none";
		}
		else { thisMenu.display = "block" }
		return false;
	}
	else {
		return true;
	}
}


/* Function to reveal submenu in IE from http://www.alistapart.com/articles/hybrid */
startList = function() {
	if (document.all && document.getElementById) {
		navRoot = document.getElementById("NSMmenu");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
			node.onmouseout=function() {
				this.className=this.className.replace
				(" over", "");
				}
			}
		}
	}
	if (location.search && location.search.length > 1) {
		showApp(location.search.substring(1));
	}
}
window.onload=startList;


//make the apps page work
function showApp(whichApp) {
	document.getElementById('appTips').style.display='none';
	document.getElementById('appCaseStudies').style.display='none';
	document.getElementById('appWebinars').style.display='none';
	document.getElementById('appReports').style.display='none';
	document.getElementById('appDigimags').style.display='none';
	document.getElementById('appPodcasts').style.display='none';
	document.getElementById('appNews').style.display='none';
	document.getElementById('appCalendar').style.display='none';

	if (document.getElementById) {
		document.getElementById(whichApp).style.display='block';
	}
}

//plays the mp3s
// Pop-Up Embedder Script by David Battino, www.batmosphere.com; Object tag implementation by Mark Levitt, http://digitalmedia.oreilly.com
var UniqueID = 10; // Make each link open in a new window.
var newWinOffset = 20; // Position of first pop-up

function playMe(mp3name,mp3url) {
	PlayWin = window.open('',UniqueID,'width=400,height=120,top=' + newWinOffset +',scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
	PlayWin.focus();
	
	var	winContent = "<HTML><HEAD><TITLE>" + mp3name + "</TITLE><LINK HREF='sheets/NSMstyles.css' REL='stylesheet' TYPE='text/css'></HEAD>";
		winContent += "<BODY id='mp3Player'>";
		winContent += "<p><img src='images/NextStepsLogo.gif'>";
		winContent += "<p>" + mp3name + "<br><OBJECT width='300' height='42'>";
		winContent += "<param name='SRC' value='" +  mp3url + "'>";
		winContent += "<param name='AUTOPLAY' VALUE='true'>";
		winContent += "<param name='CONTROLLER' VALUE='true'>";
		winContent += "<param name='BGCOLOR' VALUE='#FFFFFF'>";
		winContent += "<EMBED SRC='" + mp3url + "' AUTOSTART='TRUE' LOOP='FALSE' WIDTH='300' HEIGHT='42' CONTROLLER='TRUE' BGCOLOR='#FFFFFF'></EMBED>";
		winContent += "</OBJECT></P>";
		winContent += "</BODY></HTML>";
	
	PlayWin.document.write(winContent);
	PlayWin.document.close(); // "Finalizes" new window
	UniqueID = UniqueID + 1;
	newWinOffset = newWinOffset + 20; // subsequent pop-ups will be this many pixels lower.
}

