<!-- APAGOPixel V2.1 -->

var ap_flash = "0";

function apagoPixel(ap_pixel, ap_groups, ap_server, ap_charset, ap_log, ap_logfile, sessionID) {

         //------------------------------------------------------------
         // Groups verarbeiten
         //------------------------------------------------------------
	if (ap_groups!="") ap_groups = "&groups=" + ap_groups;

         //------------------------------------------------------------
         // Host ermitteln
         //------------------------------------------------------------
         var ap_host = location.protocol + "//" + location.host;
	var ap_port = location.port;

         if (ap_port!="") ap_host += ":" + ap_port;
	if(ap_server) {
	  ap_host = ap_server;
	}

	ap_charset = "&charset="+ap_charset;
	ap_log = "&log="+ap_log;
	ap_logdir = "&logdir="+ap_logfile;

         //------------------------------------------------------------
         // Referrer ermitteln
         //------------------------------------------------------------
         var ap_referrer="";
         try {
           ap_referrer=document.referrer;
           if (typeof(top.document)=="object") ap_referrer=top.document.referrer;
	} catch (e) {}

         if (ap_referrer.substring(0,ap_host.length)==ap_host) {
           ap_referrer = "";
         } else {
	  if (ap_referrer!="") ap_referrer = "&referrer=" + escape(ap_referrer);
         }

         if (ap_host!="") ap_host = "&server=" + escape(ap_host);

         //------------------------------------------------------------
         // Netscape-Plugins ermitteln
         //------------------------------------------------------------
         var ap_plugins = "";
         try {
  	  if(navigator.appName.indexOf("Microsoft")!=-1){
	    for(i=0;i<navigator.plugins.length;++i)
        	      ap_plugins+=navigator.plugins[i].name+";";
	  }
	} catch (e) {}

         if (ap_plugins!="") ap_plugins = "&plugins=" + escape(ap_plugins);

         //------------------------------------------------------------
         // Flash-Version ermitteln
         //------------------------------------------------------------
         var ap_flash = "";
         try {
  	  if (navigator.appName.indexOf("Microsoft")==-1) {
	    if (navigator.plugins != null && navigator.plugins.length > 0) {
	       var flashPlugin = navigator.plugins["Shockwave Flash"];
 	       if (typeof flashPlugin == "object") {
	         if (flashPlugin.description.indexOf("3.") != -1)      ap_flash = "3";
  	         else if (flashPlugin.description.indexOf("4.") != -1) ap_flash = "4";
	         else if (flashPlugin.description.indexOf("5.") != -1) ap_flash = "5";
	         else if (flashPlugin.description.indexOf("6.") != -1) ap_flash = "6";
	         else if (flashPlugin.description.indexOf("7.") != -1) ap_flash = "7";
	         else if (flashPlugin.description.indexOf("8.") != -1) ap_flash = "8";
	       }
	    }
	  }
	} catch (e) {}
         ap_flash = "&flash=" + ap_flash;

         //------------------------------------------------------------
         // sessionID für Unique-User weiterreichen, falls vorhanden
         //------------------------------------------------------------
         var ap_sessionID = "";
         if(typeof(sessionID)!="undefined"){
                 ap_sessionID = "&sessionID="+sessionID;
         }

         //------------------------------------------------------------
         // Bildschirm-Einstellungen ermitteln
         //------------------------------------------------------------
	var ap_width  = screen.width;
	var ap_height = screen.height;
	var ap_color  = (navigator.appName.indexOf("Microsoft")!=-1)? screen.pixelDepth : screen.colorDepth;

         var ap_screen = "&swidth="+ap_width+"&sheight="+ap_height+"&scolor="+ap_color;

         //------------------------------------------------------------
         // JavaScript erlaubt
         //------------------------------------------------------------
         var ap_java = "&java=true";

         //------------------------------------------------------------
         // Cookies erlaubt ermitteln
         //------------------------------------------------------------
         var ap_cookies = navigator.cookieEnabled;

         if (ap_cookies!="") ap_cookies = "&cookies=" + ap_cookies;

         //------------------------------------------------------------
         // Betriebsystem ermitteln
         //------------------------------------------------------------
         var ap_platform = navigator.platform;

         if (ap_platform!="") ap_platform = "&platform=" + ap_platform;

         //------------------------------------------------------------
         // User Language ermitteln
         //------------------------------------------------------------
         var ap_ul = "";

	if(navigator.appName.indexOf("Microsoft")!=-1) {
           ap_ul = "&ul=" + escape(navigator.language);
         }

         var sAPURL = ap_pixel + "?ts=" + (new Date()).getTime() + ap_referrer + ap_host + ap_groups + ap_charset + ap_log + ap_logdir + ap_sessionID + ap_plugins + ap_flash + ap_screen + ap_ul + ap_java + ap_platform + ap_cookies;
	try {
           var lt = '<';
           document.write("<span style='display: none; visibility: hidden;'>" + lt + "a href='" + sAPURL + "' target='_blank'>" + lt + "img alt='' border='0' height='1' src='" + sAPURL + "' width='1'/>" + lt + "/a></span>");
         } catch (e) {
	    var im = new Image();
	    im.src = sAPURL;
         }
}
