function getCookie(sName)
{
  // cookies are separated by semicolons
  var aCookie = document.cookie.split("; ");
  for (var i=0; i < aCookie.length; i++)
  {
    // a name/value pair (a crumb) is separated by an equal sign
    var aCrumb = aCookie[i].split("=");
    if (sName == aCrumb[0]) 
      return unescape(aCrumb[1]);
  }

  // a cookie with the requested name does not exist
  return null;
}


function openFortyToo(s,p,t){
if (!t || t==undefined) { t='FortyToo' }

h=window.screen.height;
nb=false;
if (h < 700){ // Netbook scroll mode
    nbc=getCookie("netbook");
    if (nbc=="on") nb=true;
    else if (nbc=="off") nb=false;
    else {
		nb=confirm("DISPLAY IS LESS THAN 800px HIGH\n\nUse the scrolling FortyToo for NetBook\ninstead of the scalable Desktop version?");    	
     }
}
if (nb){
    date=new Date();
    date.setMonth(date.getMonth()+1);
	document.cookie="netbook=on; expires=" + date.toGMTString();
 	window.open("http://fortytoocomments.com/comments/netbook.php?site="+s+"&page="+p,"_blank", 	"width=720,height=550,resizable=yes,scrollbars=yes");
 }
else {
	h=Math.min(h,800);
	w=(h/800)*700;
	window.open("http://fortytoocomments.com/comments/comments.php?site="+s +"&page="+p , "_blank", "height="+h+",width="+w+",resizable=yes");
}
}