function init(){
	//initalize domMan
	dm = new domMan();
	
	//sets the current rotation of magazines to "development magazine", just a starting point
	if (document.getElementById("magazineHolder"))
	{
		document.getElementById("magazineHolder").curMag = "dev";
		//start running the change
		startList();
	}
}

function expandStory(whatNum)
{
	var currentStoryBox = document.getElementById("story"+whatNum);
	
	if (currentStoryBox.style.display != "block") {
		currentStoryBox.style.display = "block";
		document.getElementById("thumb"+whatNum).style.display = "none";
		dm.remInById("readFullLink" + whatNum);
		dm.addAtts("readFullLink" + whatNum, ["text:Hide Story"]);
	}
	else
	{
		currentStoryBox.style.display = "none";
		document.getElementById("thumb"+whatNum).style.display = "block";
		dm.remInById("readFullLink" + whatNum);
		dm.addAtts("readFullLink" + whatNum, ["text:Read Full Story"]);
	}
}

function popupStory(whatStory)
{
	document.getElementById("overlayCloseLink").story = whatStory;
	unHide("theOverlay");
	unHide("overlayContentHolder");
	unHide(whatStory);
}

function unpopStory(whatStory)
{
	//alert("hiding " + whatStory);
	hide("theOverlay");
	hide("overlayContentHolder");
	hide(whatStory);
}

function togBox(linkId, whatId)
{
	var curEl = document.getElementById(whatId);
	
	if (curEl.style.display != "block") {
		curEl.style.display = "block";
		if(linkId != null) dm.remInById(linkId);
		if(linkId != null) dm.addAtts(linkId, ["text:Minimize"]);
	}
	else
	{
		curEl.style.display = "none";
		if(linkId != null) dm.remInById(linkId);
		if(linkId != null) dm.addAtts(linkId, ["text:Expand"]);
	}	
}

function hide(id)
{
	elPath = document.getElementById(id);
	elPath.style.display = "none";
}

function unHide(id)
{
	elPath = document.getElementById(id);
	elPath.style.display = "block";
}

function createOverlay(idName)
{
	//possibly create a container for all the elemnts with a name so its easier to classify
	dm.addEl("div", "body", "theOverlay", ["class:overlay"]);
	dm.addEl("div", "body", "overlayContentHolder", ["class:overlayContentHolder"]);
	dm.addEl("div", "overlayContentHolder", idName, ["class:overlayContent"]);
	//dm.addEl("a", "overlayContentHolder", "closeOverlayLink", ["href:javascript:removeOverlay()", "text:Close"]);
}

function removeOverlay()
{
	dm.remElById("theOverlay");
	dm.remElById("overlayContentHolder");
}

function startList() {
	//alert("calling startList");
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("verticalMenu");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") 
			{
				//alert("adding mouseouts to: " + node.id);
				node.onmouseover=function() {
					this.className+=" over";
		 		}
		  		node.onmouseout=function() {
		  			this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
