window.setInterval("document.location.reload()",300000);
// Text
var idI = 0;
var new_location = "";

// Settings
var iLeft=-270;      // left margin
var iTop=-270;       // top margin
var iStep = 10;

var bt=1
var isIE = (window.navigator.userAgent.indexOf("MSIE") > 0);
if (! isIE)	{
	var bt = 2;
	iStep = 30;	
}
    
    function Redirect1(No){		document.location='index1.asp?rp='+rndpar+'&id='+No+'&leg='+legenda+'&bt='+bt
    }

    function Redirect2(No){		document.location='index2.asp?rp='+rndpar+'&id='+No+'&leg='+legenda+'&bt='+bt
    }
    function Redirect3(No){		document.location='index3.asp?rp='+rndpar+'&id='+No+'&leg='+legenda+'&bt='+bt+'&ord='+order1+','+order2
    }

    function Sort1(ord){
		order1=ord;		document.location='index3.asp?rp='+rndpar+'&id='+sP+'&leg='+legenda+'&bt='+bt+'&ord='+order1+','+order2
    }

    function Sort2(ord){
		order2=ord;		document.location='index3.asp?rp='+rndpar+'&id='+sP+'&leg='+legenda+'&bt='+bt+'&ord='+order1+','+order2
    }
    function SwitchOn(obj,path,obl)
    {		eval(obj).src = path;		eval(obj).style.zIndex = 6;		sP = obl;
    }
    
    function SwitchOff(obj,path,zIndex)
    {		eval(obj).src = path;		eval(obj).style.zIndex = zIndex;
    }
        
	var cid = 0;

	function ShowEvent(No,mid){
		document.location='index2.asp?rp='+rndpar+'&id='+sP+'&leg='+legenda+'&mid='+mid+'&bt='+bt;
//		document.location='index3.asp?rp='+rndpar+'&id='+No+'&leg='+legenda+'#bookmark'+mid+'&bt='+bt+'&ord=0,0';
	}	

	function ShowTooltip(x,y,spanobject1,spanobject2,spanobject3,spanobject4,spanobject5,spanobject6,text7,text8,img_src,iddi,urgenceBarva){			
		if (! isIE) {
			var text1 = spanobject1.textContent;
			var text2 = spanobject2.textContent;
			var text3 = spanobject3.textContent;
			var text4 = spanobject4.textContent;
			var text5 = spanobject5.textContent;
			var text6 = spanobject6.textContent;
			tr1.style.height = 40;						
			tr3.style.height = 70;			
		}
		else {
			var text1 = spanobject1.innerText;
			var text2 = spanobject2.innerText;
			var text3 = spanobject3.innerText;			
			var text4 = spanobject4.innerText;
			var text5 = spanobject5.innerText;
			var text6 = spanobject6.innerText;
		}
				
		
		/*var atext1 = new Array();	
		atext1 = text1.split("brbr")
		text1 = atext1[0]+"<br>"+atext1[1]*/
		
		if(cid==iddi)return;
		cid=iddi;
		tooltip.style.zIndex = 7;
		tooltip1.innerHTML=text1;		
		//tooltip2.innerHTML=text2;
		//tooltip3.innerHTML=text3;
		//tooltip4.innerHTML=text4;
		tooltip5.innerHTML=text5;
		tooltip6.innerHTML=text6;
		//tooltip7.innerHTML=text7;
		//tooltip8.innerHTML=text8;
		tab1.style.backgroundColor ="#d3d3d3";				
		td6.style.backgroundColor = urgenceBarva;	 
		tooltip_img.src=img_src;
		
		if(eval(x+title_width+IconSize/2)<eval(map_left+map_width))
			tooltip.style.left = x+10+IconSize/2
		else 
			tooltip.style.left = x+10-title_width-IconSize/2
	
		if(eval(y+parseInt(tooltip.style.height,10)-tooltip_offset)<eval(map_top+map_height))			
			tooltip.style.top = y+10
		else
			tooltip.style.top = y-parseInt(tooltip.style.height,10)
						
		tooltip.style.display = '';		 
	}

	function HideTooltip(){
		cid=0;
		tooltip.style.display = 'none';
	}    

	function RefreshInfo1()
	{		
		var leg = "";		for(var i=1;i<=LegItemCount;i++)		{			if(eval("document.getElementById('n"+i+"').checked")) 			{					if(leg!="") leg+=","				
				leg += eval("document.getElementById('n"+i+"').getAttribute('IdTemaInformace')") ;
			}		}		document.location='index1.asp?rp='+rndpar+'&leg='+leg+'&bt='+bt
	}	function RefreshInfo2()
	{
		var leg = "";		for(var i=1;i<=LegItemCount;i++)		{
			if(eval("document.getElementById('n"+i+"').checked")) 			{					if(leg!="") leg+=","
				leg += eval("document.getElementById('n"+i+"').getAttribute('IdTemaInformace')") ;
			}		}				document.location='index2.asp?rp='+rndpar+'&id='+sP+'&leg='+leg+'&bt='+bt
	}

	function RefreshInfo3()
	{		var leg = "";		for(var i=1;i<=LegItemCount;i++)		{
			if(eval("document.getElementById('n"+i+"').checked")) 			{					if(leg!="") leg+=","
				leg += eval("document.getElementById('n"+i+"').getAttribute('IdTemaInformace')") ;
			}		}				document.location='index3.asp?rp='+rndpar+'&id='+sP+'&leg='+leg+'&bt='+bt+'&ord='+order1+','+order2;
	}	

	function MoveUp(strlocation)
	{
		new_location = strlocation;
		idI = window.setInterval("AnimateUp()",10);				
	}
	
	function AnimateUp() 
	{
		if(iTop<1){
			var x=document.getElementById('map_box4');	
			x.style.top= iTop;			
			iTop = iTop + iStep;
		}
		else
		{
			window.clearInterval(idI);	
			document.location=new_location;
		}
	}

	function MoveDown(strlocation)
	{
		new_location = strlocation
		idI = window.setInterval("AnimateDown()",10);				
	}
	
	function AnimateDown() 
	{
		if(iTop>-541){
			var x=document.getElementById('map_box4');	
			x.style.top= iTop;
			iTop = iTop - iStep;
		}
		else
		{
			window.clearInterval(idI);						
			document.location=new_location;
		}
	}	

	function MoveRight(strlocation)
	{
		new_location = strlocation
		idI = window.setInterval("AnimateRight()",10);				
	}
	
	function AnimateRight() 
	{
		if(iLeft>-541){
			var x=document.getElementById('map_box4');	
			x.style.left= iLeft;
			iLeft = iLeft - iStep;
		}
		else
		{
			window.clearInterval(idI);			
			document.location=new_location;
		}
	}

	function MoveLeft(strlocation)
	{
		new_location = strlocation
		idI = window.setInterval("AnimateLeft()",10);				
	}
	
	function AnimateLeft() 
	{
		if(iLeft<1){
			var x=document.getElementById('map_box4');	
			x.style.left= iLeft;
			iLeft = iLeft + iStep;
		}
		else
		{
			window.clearInterval(idI);			
			document.location=new_location;
		}
	}
	
	function MyDraw()
	{
	  var XPoints = new Array();
	  var YPoints = new Array();
	  for(var i=3;i<arguments.length;i+=2)
	  {
	    XPoints[XPoints.length] = arguments[i];
	    YPoints[YPoints.length] = arguments[i+1];
	  }

	  eval('var jg_doc'+arguments[0]+' = new jsGraphics()');	
	  eval('jg_doc'+arguments[0]+'.setText("'+arguments[1]+'")');	  eval('jg_doc'+arguments[0]+'.setColor("'+arguments[2]+'")')	  
	  eval('jg_doc'+arguments[0]+'.setStroke('+intensity_width+')');		  
	  eval('jg_doc'+arguments[0]+'.drawPolyline(XPoints,YPoints)');
	  eval('jg_doc'+arguments[0]+'.paint()');
	}

	
	