function getCookie(value) {
    var dc = document.cookie;
    var prefix = value + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
    } else {
    begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
    end = dc.length;
    }
    return dc.substring(begin + prefix.length, end);
}
 
 
function doTSA_Tracking()
{
   var TSA_OptOut = getCookie("TSA_OptOut");
   if (TSA_OptOut && TSA_OptOut!=null && TSA_OptOut=='true') return false
   else return true;
}
 
var expdate=new Date();
expdate.setDate(expdate.getDate()+365);
 
function writeTSA() {
var div = "<a href=\"http://drupal.org\"><img src=\"/de/dateien/buttons/drupal.gif\" width=\"80\" height=\"15\" alt=\"Drupal Logo\" title=\"The free Drupal CMS\" /></a> <img src=\"/counter/c.php?n=goede\" alt=\"Besucher-Zähler\" title=\"Counter\" /> <div style=\"display:inline;position:relative;top:-3px;left:-3px;\"><a href=\"/de/firma/impressum#info\">Tracking</a> aktiv:</div><input type='checkbox' id='TSA_OptOut' value='true' style=\"position:relative;top:-2px;left:-2px;\" onClick='this.checked?document.cookie=\"TSA_OptOut=false;path=/;expires="+expdate.toGMTString()+";\":document.cookie=\"TSA_OptOut=true;path=/;expires="+expdate.toGMTString()+";\"' /> <a href=\"http://gallery.sourceforge.net/\"><img src=\"/de/dateien/buttons/gallery.gif\" width=\"80\" height=\"15\" alt=\"Gallery Logo\" title=\"Gallery - Your photos on your website\" /></a>";
document.getElementById("TSA_OptOutSwitch").innerHTML = div;
}
