var expdate = new Date ();
var style = "";
//expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000)); // 24 hrs from now 
expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); // 1 year
//SetCookie ("useFlash", "yes", expdate);
//SetCookie ("useJS", "yes", expdate);
//SetCookie ("style", "main");
//SetCookie ("Japanese", "no");
//SetCookie ("", "",expdate);
//document.write ("useFlash = " + GetCookie("useFlash") + "<br>");
//document.write ("useJS = " + GetCookie("useJS") + "<br>");
//document.write ("Japanese = " + GetCookie("Japanese") + "<br>");
style = GetCookie("style");
if (style == null)
{
	style = 'sakura';
}
document.write ('<link rel=\"stylesheet\" type=\"text/css\" href=\"css/' + style + '.css\">');

function winstat(msg){
	window.status=msg;
}
function newWin (loc){
	window.open(loc, 'Vashon', 'width=550,height=300');
}

function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

// "Internal" function to return the decoded value of a cookie
//
function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return null;
}


function DeleteCookie (name,path,domain) {
  if (GetCookie(name)) {
    document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}