var CCHARA=65;
var CCHARa=97;

var lastSel=0;
var beginOfAnchors=0;

function zvyrazni(r)
	{
	if(zvyraznen!=-1) zhasni();
	zvyraznen=r;
	zvyr_pole[0]=document.anchors[zvyraznen].style.color;
	zvyr_pole[1]=document.anchors[zvyraznen].style.fontSize;
	zvyr_pole[2]=document.anchors[zvyraznen].style.fontWeight;
	zvyr_pole[3]=document.anchors[zvyraznen].style.fontVariant;
	
	document.anchors[zvyraznen].style.color="yellow";
	document.anchors[zvyraznen].style.fontSize="120%";
	document.anchors[zvyraznen].style.fontWeight="bold";
	document.anchors[zvyraznen].style.fontVariant="small-caps";
	//setTimeout("zhasni()",5000);
	}

function zhasni() //zhasnuti zvyrazneneho
	{
	if(zvyraznen==-1) return;
	document.anchors[zvyraznen].style.color=zvyr_pole[0];
	document.anchors[zvyraznen].style.fontSize=zvyr_pole[1];
	document.anchors[zvyraznen].style.fontWeight=zvyr_pole[2];
	document.anchors[zvyraznen].style.fontVariant=zvyr_pole[3];
	zvyraznen=-1;
	};

	
function KeyFindHref() // skoci na href dle klavesy
{
	var s;
	if(lastSel==0) lastSel=beginOfAnchors;
	if(KeyFindHrefWk(lastSel,document.anchors.length)==0)
		KeyFindHrefWk(beginOfAnchors,lastSel);
};
	
function KeyFindHrefWk(a,b) // v rozmezi a a b
{
	t=event.keyCode;
	w="'";
	for(r=1;r<=4;r++)
		{
		switch(t % 16)
			{
			default : 
				w+=t % 16; break;
			case 10: w+= "a"; break;
			case 11: w+= "b"; break;
			case 12: w+= "c"; break;
			case 13: w+= "d"; break;
			case 14: w+= "e"; break;
			case 15: w+= "f"; break;
			};
		t=Math.floor(t/16);
		};
	u="'\\u";
	for(r=1;r<=4;r++)
		u+=w.charAt(5-r);
	u+="'";
	u=eval(u).toLowerCase();
	for(r=a+1;r<b;r++) 
		{
		if(document.anchors[r].name.charAt(0).toLowerCase()==u)
			{
			MyScrollToTop(document.anchors[r],10);
			zvyrazni(r);
			lastSel=r;
			return(1);
			};
		}
	return 0;
};

function showhref(a)  // zvyrazneni na skoceny Tag pomoci # do jineho dokumentu (onload)
{
	var r,s;
	a=location.href;
	for(r=a.length-1;r>=0;r--)
		if(a.charAt(r)=='#') break;
	if(r==-1) return;
	s=a.substring(r+1,a.length);
	for(r=0;r<document.anchors.length;r++)
		{
		if(document.anchors[r].name==s)
			{		
			rozvin(document.anchors[r].id);
			location.hash="#"+s;
			zvyrazni(r);
			return;
			};
		};
};

