function base64_encode(decStr){var base64s='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';var bits;var dual;var i=0;var encOut='';while(decStr.length>=i+3){bits=(decStr.charCodeAt(i++)&0xff)<<16|(decStr.charCodeAt(i++)&0xff)<<8|decStr.charCodeAt(i++)&0xff;encOut+=base64s.charAt((bits&0x00fc0000)>>18)+base64s.charAt((bits&0x0003f000)>>12)+base64s.charAt((bits&0x00000fc0)>>6)+base64s.charAt((bits&0x0000003f));}
if(decStr.length-i>0&&decStr.length-i<3){dual=Boolean(decStr.length-i-1);bits=((decStr.charCodeAt(i++)&0xff)<<16)|(dual?(decStr.charCodeAt(i)&0xff)<<8:0);encOut+=base64s.charAt((bits&0x00fc0000)>>18)+base64s.charAt((bits&0x0003f000)>>12)+(dual?base64s.charAt((bits&0x00000fc0)>>6):'=')+'=';}
return(encOut);}
function urlencode_string(estring)
{hex='0123456789ABCDEF';encString='';e_char='';e_len=estring.length;for(e_i=0;e_i<e_len;e_i++)
{e_char=parseInt(estring.charCodeAt(e_i));encString+='%'+hex.charAt((e_char>>4)%16)+hex.charAt(e_char%16);}
return encString;}
var resolution=window.screen.width+'x'+window.screen.height+'x'+window.screen.colorDepth+'bit';var matches=document.getElementsByTagName("script");var document_url;var client_id;for(var i=0;i<matches.length;i++){if(matches[i].src&&matches[i].src.match(/pmws\.js(\?.*)?$/)){var path=matches[i].src.replace(/pmws\.js(\?.*)?$/,'');var match_string2=matches[i].src.match(/\?.*cid=([0-9]*)/);client_id=match_string2.length?match_string2[1]:'';var match_string=matches[i].src.match(/\?.*doc=(.*)/);document_url=match_string.length?match_string[1]:'';}}
if(document_url!=''){var string='<img style="border: none; padding: none;" src="http://www.prima-statistik.de/pmws.gif?'+'client_id='+client_id+'&'+'enc=1'+'&'+'raw=1'+'&'+'document_url='+base64_encode(document_url)+'&'+'referer='+base64_encode(document.referrer)+'&'+'add_data[]=resolution::'+resolution+'" alt="" width="1" height="1" />';}
else{var string='<img style="border: none; padding: none;" src="http://www.prima-statistik.de/pmws.gif?'+'client_id='+client_id+'&'+'enc=1'+'&'+'document_url='+base64_encode(document.URL)+'&'+'referer='+base64_encode(document.referrer)+'&'+'add_data[]=resolution::'+resolution+'" alt="" width="1" height="1" />'}
document.write(string);
