function OpenFlash(flashfile, width, height){document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,47,0' width='"+width+"' height='"+height+"'><param name='movie' value='"+ flashfile +"' /><param name='wmode' value='transparent' /><param name='quality' value='high' /><param name='bgcolor' value='#000000'/><param name='loop' value='false' /><embed src='"+flashfile+"' loop='false' quality='high' bgcolor='#000000' width='"+width+"' height='"+height+"' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed></object>"); }
function OpenSurroundVideo(file, width, height, filepath){if (width == null || width == "")width="320"; if (height==null || height =="")height="240";  myvideo = "<object classid='clsid:928626A3-6B98-11CF-90B4-00AA00A4011F' type='application/x-oleobject' id='Surround1'" + " codebase='" + filepath+ "apps/svj/MSSurVid.cab#Version=1,2,0,20' width='" +width + "' height='" + height + "'>" + "<param name='SurroundRect' value='0,0,320,240' /><param name='Image' value='"+file+"'></param></object>";  document.write(myvideo); }
function OpenWindowsMedia(file){document.write("<embed type='application/x-mplayer2' name='MediaPlayer' autostart='true'  src='" + file + "'></embed>"); }
function OpenQuickTime(file, width, height){document.write("<embed PLUGINSPAGE='http:/" + "/www.apple.com/quicktime/download/' src='"+ file +"' width='"+width+"' height='"+height+"'></embed>"); }
//**********************************************Above are functions for activex components
function OpenPopup(div){var s = div.innerHTML;  var win = window.open("","_SlatePopup","directories=no,height=300,width=450,menubar=no,resizeable=no,scrollbars=no,status=no,toolbar=no");  var base = win.document.createElement("base");  base.target = "_new";  win.document.createStyleSheet("/css/shared.css");  win.document.body.topMargin = 0;  win.document.body.leftMargin = 0;  win.document.body.innerHTML = div.innerHTML;  var head = win.document.getElementsByTagName("head")(0);  base = head.insertBefore(base);  win.focus(); return; }/* Functions for Numeric Navigation scrolling */
var FirstChildNumNav;  var LastChildNumNav;  var MaxView;  
function InitNumericNav(){var children = NumericNavTable.children; var NumberedChildren = children.length-2; var child; MaxView = 9; var thisEntry = thisentry(0); var EntryId = Number(thisEntry.innerText); if (EntryId <= MaxView){EntryId = 1; }if (EntryId > 1){leftArrow.style.visibility = 'visible'; leftArrowBottom.style.visibility = 'visible'; }if (NumberedChildren > MaxView){if (NumberedChildren - EntryId < MaxView){EntryId = NumberedChildren - MaxView + 1; rightArrow.style.visibility = 'hidden'; rightArrowBottom.style.visibility = 'hidden'; }else{rightArrow.style.visibility = 'visible'; rightArrowBottom.style.visibility = 'visible'; }}for (i=1; (EntryId<(NumberedChildren+1) && i<=MaxView); i++){child = children(EntryId); childBottom = NumericNavTableBottom.children(EntryId); child.style.display = ''; childBottom.style.display = ''; if (i==1)FirstChildNumNav = child; EntryId++; }LastChildNumNav = child; return; }
function RightArrowNumNav(){leftArrow.style.visibility = 'visible'; leftArrowBottom.style.visibility = 'visible'; if (FirstChildNumNav.nextSibling != null){if (FirstChildNumNav.nextSibling.id != 'rightArrow'){FirstChildNumNav.style.display = 'none'; var id = FirstChildNumNav.id; document.all(id)(1).style.display = 'none'; FirstChildNumNav = FirstChildNumNav.nextSibling; }}if (LastChildNumNav.nextSibling != null){if (LastChildNumNav.nextSibling.id != 'rightArrow'){LastChildNumNav = LastChildNumNav.nextSibling; var id = LastChildNumNav.id; document.all(id)(1).style.display = ''; LastChildNumNav.style.display = ''; }}else return; if (LastChildNumNav.nextSibling.id == 'rightArrow'){rightArrow.style.visibility = 'hidden'; rightArrowBottom.style.visibility = 'hidden'; }return; }
function LeftArrowNumNav(){rightArrow.style.visibility = 'visible'; rightArrowBottom.style.visibility = 'visible'; if (LastChildNumNav.previousSibling != null){if (LastChildNumNav.previousSibling.id != 'leftArrow'){LastChildNumNav.style.display = 'none'; var id = LastChildNumNav.id; document.all(id)(1).style.display = 'none'; LastChildNumNav = LastChildNumNav.previousSibling; }}if (FirstChildNumNav.previousSibling != null){if (FirstChildNumNav.previousSibling.id != 'leftArrow'){FirstChildNumNav = FirstChildNumNav.previousSibling; var id = FirstChildNumNav.id; document.all(id)(1).style.display = ''; FirstChildNumNav.style.display = ''; }}else return; if (FirstChildNumNav.previousSibling.id == 'leftArrow'){leftArrow.style.visibility = 'hidden'; leftArrowBottom.style.visibility = 'hidden'; }return; }/* END Functions for Numeric Navigation scrolling */
function toolAction(action, id, tocid) {var title; var windowParam; if (id==''){var url = window.location.href; var idPos = url.indexOf("id="); if (idPos != -1){var ampPos = url.indexOf("&"); if (ampPos != -1)id = url.substring(idPos+3,ampPos); else id = url.substr(idPos+3); }}var URLParam = "?action="+action+"&id="+id; if (id=='toc')URLParam += "&tocid="+tocid; switch (action) {case 'print':title=''; windowParam = 'toolbar=no,location=no,directories=no,menubar=yes,status=no,resizable=yes,scrollbars=yes,width=640,height=480,'; window.open("/toolbar.aspx"+URLParam, title, windowParam); break; case 'email':title='Email'; windowParam = 'toolbar=no,location=no,directories=no,menubar=no,status=no,resizable=yes,scrollbars=no,width=490,height=470'; window.open("/toolbar.aspx"+URLParam, title, windowParam); break; }}/*End Toolbar Navigation *//* MSN Shell functions */
function showHideSidebar(){if(document.all)var iWidth = document.body.clientWidth; document.all.sidebarshell.style.display = (iWidth > 913 ? '' : 'none'); document.all.sidebarshell.style.height = document.body.scrollHeight - 1; }/* End MSN Shell functions *//* This function will resize the iframe so that there are no scrollbars */
function LoadIframe(el){var n = el.name; var h = document.frames(n).document.body.scrollHeight; el.height = h; window.focus(); }var MenuDelay = 50; var timerShowMenu; 
function IsLessThanIE55(){var version = window.navigator.appVersion; var pos = version.indexOf("MSIE"); if (pos != -1){var numberVersion = Number(version.substr(pos+5,3)); if (numberVersion < 5.5)return true; else return false; }else return false; }

var myimages=new Array()
function preloadimages()
{
  for (i=0;i<preloadimages.arguments.length;i++)
  {
    myimages[i]=new Image()
    myimages[i].src=preloadimages.arguments[i]
  }
}
 
//Comma seperated list, giving full path for each image to preload.
preloadimages("http://www.slate.com/images/redesign/nav_arrow_over.gif","http://www.slate.com/images/toolbox_images/enve_roll.gif","http://www.slate.com/images/toolbox_images/findiscuss_roll.gif","http://www.slate.com/images/toolbox_images/folder_roll.gif","http://www.slate.com/images/toolbox_images/papers_roll.gif","http://www.slate.com/images/toolbox_images/podcasting_roll.gif","http://www.slate.com/images/toolbox_images/print_roll.gif","http://www.slate.com/images/toolbox_images/rec_roll.gif","http://www.slate.com/images/redesign/bread_crumbing/bc_arrow_roll.gif", "http://www.slate.com/images/redesign/seo_roll.gif", "http://img.slate.com/images/redesign/flyout_rule.gif");

var ActiveMenu = null;
var closeMenu;
var MultipartHeadlines = new Array();
var CurrentEntry = null;
var recIsOpen = false;

function showMenu(menuNum) {
	clearTimeout(closeMenu);
	var whichMenu = parseInt(menuNum);	
	if (ActiveMenu != null) {
		document.getElementById("menuF" + ActiveMenu).style.backgroundColor="#603";
		document.getElementById("menuF" + ActiveMenu).style.color="#FFF";
	}
	document.getElementById("flyout_container").innerHTML = flyoutArray[whichMenu - 1];
	document.getElementById("menuF" + whichMenu).style.backgroundColor="#FFF";
	document.getElementById("menuF" + whichMenu).style.color="#000";
	ActiveMenu = whichMenu;
}
function hideMenu() {
	document.getElementById("flyout_container").innerHTML = "";
	document.getElementById("menuF" + ActiveMenu).style.backgroundColor="#603";
	document.getElementById("menuF" + ActiveMenu).style.color="#FFF";
	ActiveMenu = null;
}

function ToolbarRecommend(whichRec) {
	if (recIsOpen == false) {
		document.getElementById(whichRec).style.display="block";
		recIsOpen = true;
	} else {
		document.getElementById(whichRec).style.display="none";
		recIsOpen = false;
	}
}
function closeRec(whichRec) {
	document.getElementById(whichRec).style.display="none";
	recIsOpen = false;
}
function ToolbarMouseOver(whichMenu, rootpath) {
	var navImage = whichMenu + "_icon";
	var navAnchor = whichMenu + "_link";
	document.images[navImage].src = (rootpath + "/images/toolbox_images/" + whichMenu + "_roll.gif");
	document.getElementById(navAnchor).style.color = "#FF0";
}
function ToolbarMouseOut(whichMenu, rootpath) {
	var navImage = whichMenu + "_icon";
	var navAnchor = whichMenu + "_link";
	document.images[navImage].src = (rootpath + "/images/toolbox_images/" + whichMenu + ".gif");
	document.getElementById(navAnchor).style.color = "#FFF";
}
function PopulateMultipartArray(ArrayIndex, Headline, FromByline, ToByline, PubDate, thisHeadline) {
	var whichElement = parseInt(ArrayIndex);	
	MultipartHeadlines[whichElement] = [Headline,FromByline,ToByline,PubDate];
	if (thisHeadline == '1')
		CurrentEntry = whichElement;
}
function MultipartMouseOver(whichSwap, linkLocation, TopBottomSwitch) {
	whichElement = parseInt(whichSwap);
	TopOrBottom = "multipart" + TopBottomSwitch;
	
	if (MultipartHeadlines[whichElement][2] == 'null') {
	document.getElementById(TopOrBottom).innerHTML = ("<a href='" + linkLocation + "'><span class='to_from_author'>" + MultipartHeadlines[whichElement][1] + "</span><h2>" + MultipartHeadlines[whichElement][0] + "</h2><span class='dateline'>Posted " + MultipartHeadlines[whichElement][3] + "</span></a>");
	} else {
		document.getElementById(TopOrBottom).innerHTML = ("<a href='" + linkLocation + "'><span class='to_from_author'>" + MultipartHeadlines[whichElement][1] + "<br/>" + MultipartHeadlines[whichElement][2] + "</span><h2>" + MultipartHeadlines[whichElement][0] + "</h2><span class='dateline'>Posted " + MultipartHeadlines[whichElement][3] + "</span></a>");
	}
}
function MultipartMouseOut(TopBottomSwitch) {
	TopOrBottom = "multipart" + TopBottomSwitch;

	if (MultipartHeadlines[CurrentEntry][2] == 'null') {
		document.getElementById(TopOrBottom).innerHTML = ("<a href='#'><span class='to_from_author'>" + MultipartHeadlines[CurrentEntry][1] + "</span><h2>" + MultipartHeadlines[CurrentEntry][0] + "</h2><span class='dateline'>Posted " + MultipartHeadlines[CurrentEntry][3] + "</span></a>");
	} else {
		document.getElementById(TopOrBottom).innerHTML = ("<a href='#'><span class='to_from_author'>" + MultipartHeadlines[CurrentEntry][1] + "<br/>" + MultipartHeadlines[CurrentEntry][2] + "</span><h2>" + MultipartHeadlines[CurrentEntry][0] + "</h2><span class='dateline'>Posted " + MultipartHeadlines[CurrentEntry][3] + "</span></a>");
	}
}
