// (c) Radek HULAN, http://hulan.info/
// This work is licensed under the Creative Commons Attribution License. 
//
// NAVRCHOLU.cz statistics that works under XHTML 1.1 served with
// MIME type application/xhtml+xml as well as text/html MIME type.
// pre naj.sk upravil Mayo - m.hello@gmail.com 


var isXHTML;
function createNewEle(ele){
 if(isXHTML) 
  return document.createElementNS('http://www.w3.org/1999/xhtml', ele);
 else 
  return document.createElement(ele);
};	

function nvc(){
var ele=document.getElementById('navrcholu');
if (!ele) return;
isXHTML=/html\:/.test(document.getElementsByTagName('body')[0].nodeName);
// navrcholu.cz id from title
var id=parseInt(ele.getAttribute('title'));
if (!id) alert('TITLE attribute does not contain your NAVRCHOLU.cz ID!');
// some variables

var n=navigator;
var p=document;
var c,t,b,j,m,r,y;
var d,x,w;
d=x=w=0;
b=(n.appName=="Netscape" && parseInt(n.appVersion)==4)?"border=\"0\"":"style=\"border:none\"";
if(n.appVersion.indexOf("MSIE")>=0 && n.appVersion.indexOf("Win")>=0){
p.writeln("<s"+"cript language=\"VBScript\">\non error resume next");
for (i=3; i<7; i++)
p.writeln("if(IsNull(CreateObject(\"ShockwaveFlash.ShockwaveFlash."+i+"\"))) then n3f8q=0 else n3f8q="+i+" end if");
p.writeln("</s"+"cript>"); } else eval("var n3f8q=0");
if(n.plugins && n.plugins["Shockwave Flash"]){
t=n.plugins["Shockwave Flash"].description;
n3f8q=parseInt(t.charAt(t.indexOf(".")-1)); }
m=(n.userAgent.substring(0,8)=="Mozilla/")?n.userAgent.substring(8,9):4;
if(m>2)
j=(n.javaEnabled())?1:0;
r=window.top.document.referrer;
if(m>3 && screen){
d=screen.colorDepth;
if(d==0)
d=screen.pixelDepth;
x=screen.width;
w=(p.all)?top.document.body.clientWidth:top.innerWidth; }
y=new Date();
y.setTime(y.getTime()-31536000000);
p.cookie="nvt=1";
c=(p.cookie.indexOf("nvt") != -1)?1:0;
p.cookie="nvt=1; expires="+y.toGMTString();

//ele.href='http://navrcholu.cz/Statistika/'+id+'/';
ele.href='http://naj.sk/Statistika/'+id+'/';
	ele.setAttribute('title','naj.sk');
	// create IMG
	var img=ele.appendChild(createNewEle('img'));
	img.setAttribute('alt','naj.sk');
	img.setAttribute('style','width:14px;height:14px');
	img.setAttribute('src','http://p1.naj.sk/hit?site='+id+';t=b14;'
		+'fv='+n3f8q+';js='+j+';cs='+c+';ref='+escape(r)+';cd='
		+d+';sx='+x+';wx='+w+';jss=1;r='+Math.random());
	img.setAttribute('border','0');

}
nvc();