function TanGooHit() {	

//////////// the whole cookie thing \\\\\\\\\\\\

cookie_name = "TanGooHitCounter_Cookie";

function doCookie() {
if(document.cookie) 
{index = document.cookie.indexOf(cookie_name);} 
else 
{index = -1;}

var expires = "Monday, 04-Apr-2099 05:00:00 GMT"

if (index == -1) 
{document.cookie=cookie_name+"=1; expires=" + expires;} 
else 
{
countbegin = (document.cookie.indexOf("=", index) + 1);
countend = document.cookie.indexOf(";", index);
if (countend == -1) {
countend = document.cookie.length;
}
count = eval(document.cookie.substring(countbegin, countend)) + 1;

document.cookie=cookie_name+"="+count+"; expires=" + expires;
}
}

function gettimes() {
if(document.cookie) {
index = document.cookie.indexOf(cookie_name);
if (index != -1) {
countbegin = (document.cookie.indexOf("=", index) + 1);
countend = document.cookie.indexOf(";", index);
if (countend == -1) {
countend = document.cookie.length;
}
count = document.cookie.substring(countbegin, countend);
if (count == 1) {
return (count);
} else {
return (count);
}
}
}
return ("0");
}
doCookie()

var visits = gettimes();

//////////// get the res and depth as variable \\\\\\\\\\\\

var res = screen.width + 'x' + screen.height;
var depth = screen.colorDepth;

//////////// generate output \\\\\\\\\\\\
var referrer = document.all.referrer.value;
var CurrentMainPage = document.all.CurrentMainPage.value;
var CurrentSubPage = document.all.CurrentSubPage.value;
            
referrer = replace(referrer,'&','%26');

var tag = '<img src="http://www.hermann-mechatronik.de/Statistik/Statistik.php?Referrer=' + referrer + '&ScreenRes=' + res + '&ScreenDepth=' + depth + '&VisitNumber=' + visits + '&CurrentSubPage=' + CurrentSubPage + '&CurrentMainPage=' + CurrentMainPage + '" border=0 width=0 height=0>';

//////////// write the generated output down \\\\\\\\\\\\

document.write(tag);
}


function replace(string,text,by) {
// Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}

