function change_picture() {
 var h, n, p
 h=(new Date()).getHours();
 if(h==0) {h = 24};
 n=Math.ceil(h/3);
 p=(n<10)?"0"+n+".jpg":n+".jpg";
 document.write("<img src='"+p+"' width='235' height='295' align='right'>");
}

function check_refeffer(r) {
 if((r!="http://digitalvampire.net") &&
    (r!="http://digitalvampire.net/") &&
    (r!="http://digitalvampire.net/index.html")){
  document.write("<img src='../cgi-bin/counter/counter.cgi?mode=stealth'>");
 }else{
  document.write("<img src='title.jpg' width='356' height='62'>");
 }
}

function check_refeffer_acc(r) {
 if((r!="http://digitalvampire.net") &&
    (r!="http://digitalvampire.net/") &&
    (r!="http://digitalvampire.net/index.html")){
  var cookie_reffer;
  var access_count;
  cookie_referrer = parent.document.referrer;
  if (window.navigator.cookieEnabled) {
      access_count = get_cookie("access");
      if(access_count==1){
          return("");
      }
      cookie_referrer = get_cookie("referrer");
  }
  document.cookie = "access"+"=1; domain=digitalvampire.net; path=/;";
  document.write("<img src='../cgi-bin/acc/acclog.cgi?");
  document.write("referrer="+cookie_referrer+"&");
  document.write("width="+screen.width+"&");
  document.write("height="+screen.height+"&");
  document.write("color="+screen.colorDepth+"'>");
 }
}

function get_cookie(key){
    tmp = document.cookie+";";
    tmp1 = tmp.indexOf(key,0);
    if(tmp1 != -1){
        tmp = tmp.substring(tmp1,tmp.length);
        start = tmp.indexOf("=",0);
        end = tmp.indexOf(";",start);
        return(unescape(tmp.substring(start+1,end)));
    }
    return("");
}

function call_frame(f, t) {
 if (parent.location == location) {
     document.cookie = "referrer"+"="+escape(document.referrer)+"; domain=digitalvampire.net; path=/;";
     location = f + "?" + t;
 }
}

function load_target() {
 var t = location.search.substring(1);
 if (t != '') {
     parent.main.location.href = t;
 }
}

function write_copyright() {
 today = new Date();
 var yyyy = today.getFullYear();
 document.write("<p><font color='#800000' face='Nosferatu' size='2'>Copyright(c) 1998-"+yyyy+" Castle of the Darkness</font></p>");
}
