<!--
function setCookie(name, value) {
	var expire = new Date();
	var today = new Date();
	expire.setTime(today.getTime() + 1000*60*60*24*4);
	document.cookie = name + "=" + escape(value) + "; path=/"   + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()))
}

function getCookie(Name) {
	var search = Name + "="
	if (document.cookie.length > 0) {// if there are any cookies
		offset = document.cookie.indexOf(search)
		if (offset != -1) { // if cookie exists
			offset += search.length;
			// set index of beginning of value
			end = document.cookie.indexOf(";", offset)
			// set index of end of cookie value
			if (end == -1)
				end = document.cookie.length
			return unescape(document.cookie.substring(offset, end))
		}
	}
}

function getMemberName(x) {
	// Check for new style cookie
	offset = x.indexOf("cacheusername=");
	if (offset != -1) { // new cookie
		offset += 14; // set beginning of value
		end = x.indexOf("&", offset); // end
		if ( end == -1 ) end = x.length; // get to end of string
		return unescape(x.substring(offset, end));
	}
	else {
		start = (x.indexOf(";") + 1);
		end = x.indexOf(";", start);
		var name = x.substr(start, (end - start));
		return name
	}
}



function popUp(link, width, height) {

	var popUpWindow = window.open(link,"popUp",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+width+',height='+height);

}


function cj_window(a_path) {
	article_window=window.open(a_path,'article_window','width=415,height=550,scrollbars=yes,resize=yes,target=_top');
	if (document.images) {article_window.focus();}
}


setCookie("successpage", document.location.pathname)

//came from fdn2 save article confirm, pcm save article	
function ProcessSForm() {
	var topic = document.sform.topic.value;
	if(topic.length > 0) {
		document.sform.submit();
	}
	else {
		window.alert("Please enter a topic to save this article under.");
	}
}	

//came from fdn2 save article, pcm save article	
function goToReseachLibrary(research_url)
{
  window.close(self);
  self.opener.location = research_url;
  self.opener.focus();
}

//from pcm display article detail
function OpenSlideshowWindow(slideshow_name, winWidth, winHeight,isScrollbar)
{
LeftPosition = (winWidth) ? (winWidth) : 0;
TopPosition = (winHeight) ? (winHeight): 0;
settings = 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=' + winHeight + ',width=' + winWidth
hWin = window.open(slideshow_name, "SlideshowPopup", settings, false);
hWin.focus();
if (hWin.opener == null) hWin.opener = self;
}


//came from eweek display article detail,fdn2 display article detail,fdn2 display downloads,foundation display downloads,pcm display article detail, pcm display downloads
function AlterActionAndSubmit()
{
if (document.toc_form.toc_select.value != "")
	{
	toc_select_index = document.toc_form.toc_select.selectedIndex;
	toc_select_value = document.toc_form.toc_select.options[toc_select_index].value;

	document.toc_form.action = toc_select_value;
	document.toc_form.submit();
	}
}

//came from eweek display article detail and fdn2 display article detail
function jumpToOpinion(newLoc){
	//from eweek display category archive list
	newPage = newLoc.options[newLoc.selectedIndex].value;
	if (newPage != ""){
		window.location.href = newPage;
	}
}

//came from fdn2 display review an article
function submit_review() {
	document.frm_site_review.status.value = "Approved";
	document.frm_site_review.submit();
}

//from data process add topic
function gobacktoResearchCenter()
{
	window.close(self);
	self.opener.location = document.where_to.go_to.value;
	self.opener.focus();
}



var HeaderMoreLink_clearTimer;
function HeaderMoreLink_hideAdSpace(){
	// Set a timer to clear
	HeaderMoreLink_clearTimer = window.setTimeout('HeaderMoreLink_hideAdSpaceDo()', 375);
}

function HeaderMoreLink_resetAdTimer(){
	// User has moused over the adspace, so set the clear the timer
	window.clearTimeout(HeaderMoreLink_clearTimer);
}

function HeaderMoreLink_hideAdSpaceDo(){
	document.getElementById("HeaderMoreLink_AdSpace").style.visibility = "hidden";
	document.getElementById("HeaderMoreLink_AdSpace").style.display = "none";
}

function HeaderMoreLink_showAd(){
	HeaderMoreLink_resetAdTimer();
	// Unhide the parent div so we see the whole thing
	document.getElementById("HeaderMoreLink_AdSpace").style.visibility = "visible";
	document.getElementById("HeaderMoreLink_AdSpace").style.display = "block";
}




function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

// for now, hardcoded to PCMAG for backward compatibility
function PlayerWin(episode)
{

	window.open('http://zdpub.vo.llnwd.net/o2/ziffdavisplayer/flvplayer2.html?show=PCMAG&movie=' + episode,'Player','location=0,status=0,resizable=0,scrollbars=1,width=890,height=760');

}

// Carousel functions
function openCarousel(){

  $("#carousel_container").animate( { height:"280" } );

}

function closeCarousel(){

  var carousel_container=document.getElementById("carousel_container");
  carousel_container.style.height=100;


}

// -->

