function causlesen(CookieName)
{
  var dc = "" + document.cookie;
  var Muster = 'dc.match(/' + CookieName + '=(.+)/)';
  eval(Muster);
  var Wert = unescape(RegExp.$1);
  return Wert;
}
co=causlesen('bst');
cdata=co.split("|");
if (cdata.length==2) {
	vid=cdata[0];vlv=cdata[1];
} else {
	vid='';vlv='';
}
var ablauf = new Date();ablauf.setTime(ablauf.getTime() + (30 * 24 * 60 * 60 * 1000));
var jetzt=new Date();vts=Math.round(jetzt.getTime()/1000);
if (vid=="") {
	v=1+10000*(Math.random());
	vid=""+vts+Math.round(v);
}
if (vid=="undefined") vid='';
	else document.cookie = "bst="+vid+"|"+vts+"; path=/; expires=" + ablauf.toGMTString();

saveurl="http://log.besucherstatistik.de/cs.php?";

 function detectIE(ClassID,name) 
 {
  result = false;
  document.writeln('<SCRIPT LANGUAGE=VBScript>');
  document.writeln('on error resume next');
  document.writeln('If ScriptEngineMajorVersion >= 2 then');
  document.writeln('result = False');
  document.writeln('result = IsObject(CreateObject("' + ClassID + '"))');
  document.writeln('If (err) then');
  document.writeln('result = False');
  document.writeln('End If');
  document.writeln('Else');
  document.writeln('result = False');
  document.writeln('End If');
  document.writeln('</SCRIPT>');
  if (result) return name+','; else return '';
 }
  
 function detectNS(ClassID,name)
 {
  n = ""; 
  if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; return n;
 }
 
function detect(){

// create a dummy variable
now = new Date();
var characters="0123456789abcdefghijklmnopqrstuvwxyz"
var dummy = ""
var n = 0
var randomnumber = 0
while( n < 20 ) {
	n ++
	randomnumber = Math.floor(characters.length*Math.random());
	dummy += characters.substring(randomnumber,randomnumber + 1)
}
// get name of browser the visitor is using
var useragent = navigator.userAgent;
var bName = (useragent.indexOf('Opera') > -1) ? 'Opera' : navigator.appName;
var pos = useragent.indexOf('MSIE');
if (pos > -1) {
	bVer = useragent.substring(pos + 5);
	var pos = bVer.indexOf(';');
	var bVer = bVer.substring(0,pos);
}
var pos = useragent.indexOf('Opera');
if (pos > -1)	{
	bVer = useragent.substring(pos + 6);
	var pos = bVer.indexOf(' ');
	var bVer = bVer.substring(0, pos);
}
if (bName == "Netscape") {
	var bVer = useragent.substring(8);
	var pos = bVer.indexOf(' ');
	var bVer = bVer.substring(0, pos);
}
if (bName == "Netscape" && parseInt(navigator.appVersion) >= 5) {
	var pos = useragent.lastIndexOf('/');
	var bVer = useragent.substring(pos + 1);
}
// get screen width and heigth
width = screen.width;
height = screen.height;
// set all variables to FALSE
java 	 = "FALSE";
cookies 	 = "FALSE";
flash 	 = "FALSE";
mediaplayer = "FALSE";
shockwave 	 = "FALSE";
realplayer = "FALSE";
quicktime 	 = "FALSE";
acrobat 	 = "FALSE";
svg 		 = "FALSE";
pluginlist 	 = "";
// get color depth
if (navigator.appName !="Netscape") colordepth = screen.colorDepth;
	else colordepth = screen.pixelDepth;
// detect if cookies are enabled
if (navigator.cookieEnabled) {cookies = "TRUE";}
	else cookies = "FALSE";
agt 	 = navigator.userAgent.toLowerCase();
ie 	 = (agt.indexOf("msie") != -1);
ns 	 = (navigator.appName.indexOf("Netscape") != -1);
opera 	 = (agt.indexOf("opera") != -1);
konqueror = (agt.indexOf("konqueror") != -1);
win 	 = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
mac 	 = (agt.indexOf("mac")!=-1);
oldnetscape = false;
oldopera 	= false;
opera_six = false;
opera_seven = false;
if (opera && bVer < 5)
 oldopera = true;
if (ns && bVer < 5) 
 oldnetscape = true;
if (opera && bVer >=6 && bVer < 7) 
 opera_six = true;
if (opera && bVer >=7) 
 opera_seven = true;

// get name of browser the visitor is using
navsoft = navigator.appName;
/*
if (ie && win) { 
	testacrobat=detectIE("Pdf.PdfCtrl.5","Acrobat Reader");
	if (testacrobat==false) testacrobat=detectIE("AcroPDF.PDF.1","Acrobat Reader");
	if (testacrobat==false) testacrobat=detectIE("Pdf.PdfCtrl.1","Acrobat Reader");
 	pluginlist = detectIE("Adobe.SVGCtl","SVG Viewer") + detectIE("SWCtl.SWCtl.1","Shockwave Director") + detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash") + detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") + detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player") + testacrobat;
}
if (opera) {
	nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
	pluginlist = detectNS("image/svg-xml","SVG Viewer") + detectNS("application/x-director","Shockwave Director") + detectNS("application/x-shockwave-flash","Shockwave Flash") + detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows MediaA Player") + detectNS("application/pdf","Acrobat Reader");
}
if (ns || !win) {
	nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
	pluginlist = detectNS("image/svg-xml","SVG Viewer") + detectNS("application/x-director","Shockwave Director") + detectNS("application/x-shockwave-flash","Shockwave Flash") + detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows MediaA Player") + detectNS("application/pdf","Acrobat Reader");
}
pluginlist += navigator.javaEnabled() ? "Java," : "";
*/
if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);
//detect Flash
if (pluginlist.indexOf("Flash")!=-1) flash = "TRUE";
//detect Windows Media Player
if (pluginlist.indexOf("Windows Media Player")!=-1) mediaplayer = "TRUE";
//detect Java
if (pluginlist.indexOf("Java")!=-1) java = "TRUE";
//detect Shockwave
if (pluginlist.indexOf("Shockwave Director")!=-1) shockwave = "TRUE";
//detect RealPlayer
if (pluginlist.indexOf("RealPlayer")!=-1) realplayer = "TRUE";
//detect QuickTime
if (pluginlist.indexOf("QuickTime")!=-1) quicktime = "TRUE";
//detect Acrobat Reader
if (pluginlist.indexOf("Acrobat Reader")!=-1) acrobat = "TRUE";
//detect SVG Viewer
if (pluginlist.indexOf("SVG Viewer")!=-1) svg = "TRUE";
// save collected information for this visitor in querystring
querystring = "&width=" + width + "&height=" + height + "&colordepth=" + colordepth +  "&pja=" + java + "&pco=" + cookies + "&pfl=" + flash + "&pme=" + mediaplayer + "&psh=" + shockwave + "&pre=" + realplayer + "&pqu=" + quicktime + "&pac=" + acrobat + "&psv=" + svg;
}


function stat(counter,art){
	detect();
	querystring="vid="+vid+"&vlv="+vlv+"&counter="+counter+querystring+"&ref="+escape(document.referrer);
	document.write("<img src=\""+saveurl+querystring+"\" width=\"1\" height=\"1\" border=\"0\" alt=\"\">");
}

