function getCookie(cName){
    if (document.cookie.length > 0) {              
    begin = document.cookie.indexOf(cName+"=");       
    if (begin != -1) {           
      begin += cName.length+1;       
      end = document.cookie.indexOf(";", begin);
      if (end == -1) end = document.cookie.length;
        return unescape(document.cookie.substring(begin, end));
    } 
  }
  return null;
}

function setCookie(cName, value, expiredays) {
var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));

  document.cookie = cName + "=" + escape(value) + 
  ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}

function delCookie (cName) {
  if (getCookie(cName)) {
    document.cookie = cName + "=" +
    "; expires=Thu, 01-Jan-1970 00:00:01 GMT";
  }
}

function featureCookie()
{
 times_visited=eval(getCookie('times_visited'))+1;
 setCookie('times_visited',times_visited,365); 
 if (times_visited==1) 
 	{
	document.write("<div class='networkerad' onclick=\"window.open('http://www.youtube.com/profile_videos?user=CiscoLive2008','_blank');_hbPageView('Networkers','/CISCOLIVE/PROMOS/');\"><div class='networkcontent'><div class='vidhighlight'><img src='images/blogbtn.gif' alt='video hightlight' border='0'/></div><h3>Cisco Live Video Blogs</h3><p>Watch the Cisco Live Video Blogs. New video blogs will be added as we get closer to the conference date.</p></div></div>");
 	}
 else if (times_visited==2) 
 	{
	document.write("<div class='networkerad' onclick=\"location.href='index.php?showToolbarPage=3&showToolbarItem=106';_hbPageView('Networkers','/CISCOLIVE/PROMOS/');\"><div class='networkcontent'><div class='vidhighlight'><img src='images/bluemanbtn.gif' alt='video hightlight' border='0'/></div><h3>Blue Man Group</h3><p>Don't miss Blue Man Group at this year's Customer Appreciation Event.</p></div></div>");
	}
 else if (times_visited>=3) 
 	{
	delCookie('times_visited');
	document.write("<div class='networkerad' onclick=\"location.href='index.php?showToolbarPage=3&showToolbarItem=105';_hbPageView('Networkers','/CISCOLIVE/PROMOS/');\"><div class='networkcontent'><div class='vidhighlight'><img src='images/benbtn.gif' alt='video hightlight' border='0'/></div><h3 style='font-size:14px;'>Closing Keynote Speaker Ben Stein</h3><p>Learn more about our guest speaker, actor/writer/columist Ben Stein.</p></div></div>");
	}
 else
 {
	return null;
 }

}
