var lastvisit,newlinks;

//document.write("<FONT face=Arial,Helvetica size=2>Achtung: Wenn Du Cookies zul&auml;sst, dann sind nur noch die Links seit deinem letzten Besuch blau !!! Anzahl der neuen Links in Statuszeile !!</FONT>");

readCookie();


function checklinks() {
newlinks=0;
for(i=0; i < document.links.length; ++i)
 {
   var linkid=document.links[i].id
   if(linkid.substr(0,2)=="in")
   {
   
     if((linkid.slice(2,linkid.length)>lastvisit) && (linkid.length=11) && linkid.charAt(3)=="0")
     {
       var cname=document.links[i].parentElement.className;
       newlinks++;
       if(cname.substr(0,1)=="G")
       {
//          document.links[i].parentElement.className=cname.substr(1,6)
       }
     }
     else
     {
       var cname=document.links[i].parentElement.className;
       if(cname.substr(0,1)=="l")
       {
//          document.links[i].parentElement.className="G"+cname
       }
     }
   }
 }
//window.status="Neue Links: " + newlinks;
}

function readCookie() {
     if (document.cookie == "") {
	writeCookie();
     } else {
	var the_cookie = document.cookie;
	the_cookie = unescape(the_cookie);
	the_cookie_split = the_cookie.split(";");
	for (loop=0;loop<the_cookie_split.length;loop++) {
		var part_of_split = the_cookie_split[loop];
		var find_name = part_of_split.indexOf("last_date")
		if (find_name!=-1) {
			break;
		} // Close if
	} // Close for
	if (find_name==-1) {
		writeCookie();
	} else {
		var date_split = part_of_split.split("=");
		var last = date_split[1];
                var last_split=last.split(".");
//		last=fixTheDate(last);
//		alert ("Welcome\nYour last visit was on: "+last);
lastvisit=last_split[0]+(last_split[1].length==1 ? "0"+last_split[1]:last_split[1])+(last_split[2].length==1 ? "0"+last_split[2]:last_split[2])+(last_split[3].length==1 ? "0"+last_split[3]:last_split[3])+(last_split[4].length==1 ? "0"+last_split[4]:last_split[4]);
//document.write("Welcome\nYour last visit was on: "+last+" lastvisit: "+lastvisit);
		writeCookie();
	} // Close if (find_name==-1)
      }
} // Close function readCookie()


function writeCookie() {
     var today = new Date();
     var the_date = new Date("December 31, 2023");
     var the_cookie_date = the_date.toGMTString();
     var the_cookie = "last_date="+(today.getYear()>1900?today.getYear()-2000:today.getYear())+"."+(today.getMonth()+1)+"."+today.getDate()+"."+today.getHours()+"."+today.getMinutes();
     var the_cookie = the_cookie + ";expires=" + the_cookie_date;
     document.cookie=the_cookie
}


function fixTheDate(date) {
     var split = date.split(" ");
     var fix_the_time = split[3].split(":")
     var hours = fix_the_time[0]
     var new_time = hours+":"+fix_the_time[1]
     var new_date = split[0]+" "+split[1]+", "+split[2]+" at "+new_time+", "+split[5]
     return new_date;
}

