function changeyear(year,el)
{
	for(i=1;i<=11;i++)
	{
		document.getElementById('detail_'+i).style.display = 'none';
		document.getElementById('link_'+i).className = 'noactive';	
	}
	document.getElementById('detail_'+year).style.display = 'block';
	el.className = 'active';
}

function changediv(act,el,pc)
{
	for(i=1;i<=pc;i++)
	{
		document.getElementById('detail_'+i).style.display = 'none';
		document.getElementById('link_'+i).className = 'noactive';	
	}
	document.getElementById('detail_'+act).style.display = 'block';
	el.className = 'active';
}

function changenumberactive(el,num,pc,pp)
{
	if(pp)
	{
		var namediv = 'tipp_';
		var elclick = 'nump_';
	}
	else
	{
		var namediv = 'tip_';
		var elclick = 'num_';
	}
	for(i=1;i<=pc;i++)
	{
		document.getElementById(namediv+i).style.display = 'none';
		document.getElementById(elclick+i).className = 'noactive';	
	}
	el.className = 'active';
	document.getElementById(namediv+num).style.display = 'block';
}

function menusetoverclass(el)
{
	el.className = 'active';
}

function menusetoutclass(el)
{
	el.className = 'noactive';
}

function writeFlash(sSrc,nWidth,nHeight, id)	{
	flash =  '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+nWidth+'" height="'+nHeight+'" id="'+id+'">';
	flash +=  '<param name="allowscriptaccess" value="always" />';
	flash +=  '<param name="movie" value="'+sSrc+'" />';
	flash +=  '<param name="wmode" value="transparent" />';
	flash +=  '<embed src="'+sSrc+'" width="'+nWidth+'" height="'+nHeight+'" name="'+id+'" wmode="transparent" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	flash +=  '</object>';
	return(flash);
}

function replace(){
	var array = document.getElementsByTagName('h1');
	//document.write(array.length);
	for (var i=(array.length-1); i>=0; i--) {
		var h1 = array[i];
		var width = getElementWidth(array[i]);
		var height = getElementHeight(array[i]) + 10; // tu treba domyslet akym sposobom vyzistit vysku a sirku flashu
		//window.alert(width+":"+height);
		var flashURL = "/flash/h1.swf?txt="+h1.innerHTML+"&size="+25+"&width="+width+"&height="+height;
		var c = document.createElement('div');
		array[i].parentNode.replaceChild(c,h1);
		c.innerHTML = writeFlash(flashURL,width,height);
	}
	/*
	var array = document.getElementsByTagName('h2');
	for (var i=(array.length-1); i>=0; i--) {
		var h2 = array[i];
		var width = getElementWidth(array[i]);
		var height = getElementHeight(array[i]) + 10; // tu treba domyslet akym sposobom vyzistit vysku a sirku flashu
		var flashURL = "/flash/h1.swf?txt="+h2.innerHTML+"&size="+25+"&width="+width+"&height="+height;
		var c = document.createElement('div');
		array[i].parentNode.replaceChild(c,h2);
		c.innerHTML = writeFlash(flashURL,width,height);
	}	
	*/
}

function getElementWidth(e) {
	if (typeof e.clip !== "undefined") {
		return e.clip.width;
	} else {
		if (e.style.pixelWidth) {
			return e.style.pixelWidth;
		} else {
			return e.offsetWidth;
		}
	}
}
function getElementHeight(e) {
	if (typeof e.clip !== "undefined") {
		return e.clip.height;
	} else {
		if (e.style.pixelHeight) {
			return e.style.pixelHeight;
		} else {
			return e.offsetHeight;
		}
	}
}
