var win=null;


function NewWindow(winpage,winname,wwidth,wheight,placement,whoinfocus){
if(GrabCookie("superstone1") == "cookie1"){return;}
document.cookie="superstone1=cookie1; Path=/; Expires= " + FutureExpire(365.5);
if(placement=="center"){winleft=(screen.width)?(screen.width-wwidth)/2:100;wintop=(screen.height)?(screen.height-wheight)/2:100;}
else if((placement!='center') || placement==null){winleft=0;wintop=20}
settings="width=" + wwidth + ",height=" + wheight + ",top=" + wintop + ",left=" + winleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(winpage,winname,settings);
win.blur();}

function FutureExpire(numbofdays){
var futuredate = new Date();
futuredate.setTime(futuredate.getTime() + (86400001 * numbofdays * 2));
return futuredate ;
}

function GrabCookie (nameofcook) {
var sentcookname = nameofcook + "=";
var arglength = sentcookname.length;
var superstone1 = document.cookie.length;
var icount = 0;
while (icount < superstone1) {
  var jcount = icount + arglength;
  if (document.cookie.substring(icount, jcount) == sentcookname)
  return GrabCookValue (jcount);
  icount = document.cookie.indexOf(" ", icount) + 1;
  if (icount == 0) break; 
  }
  return null;
  }

function GrabCookValue (spacing) {
var b = document.cookie.indexOf (";", spacing);
if (b == -1){
  b = document.cookie.length;
  return unescape(document.cookie.substring(spacing, b));}
}