function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
  offset = document.cookie.indexOf(search);
  if (offset != -1) {  // if cookie exists
    offset += search.length;
    end = document.cookie.indexOf(";", offset); // set index of beginning of value
    if (end == -1) end = document.cookie.length;  // set index of end of cookie value
    returnvalue=unescape(document.cookie.substring(offset, end));
    }
   }
  return returnvalue;
}

var numstyles = 1;

function setstyle(what){ 
  document.cookie="aclupastyle="+what+"; path=/";

}

function switch_style (what) {
  setstyle(what);
  window.location=window.location;
}

var cookienum;
if (get_cookie("aclupastyle")!="") {
  cookienum = get_cookie("aclupastyle");
  cookienum = parseInt(cookienum);
  if (cookienum >= numstyles)
  	cookienum = 1;
  else
  	cookienum = cookienum + 1;
  }
else {
  cookienum = 1;
}

setstyle (cookienum);

document.write ('<link href="/styles/' + cookienum + '.css" type="text/css" rel="stylesheet">');
