// JavaScript Document
 
function novyokno( odkaz )
{
    try
	{
		var test;
		
		test = ! window.open( odkaz );
		return test;
	}
	
	catch (e)
	{
		alert( "Při otvírání nového okna došlo k vnitřní chybě JavaScriptu. Zkuste povolit otevírání nových oken nebo kontaktujte správce webu! Odkaz se otevře ve stávajícím okně" );
		return true;
	}
}
  var mapDiv;
  var map; 

 function detectMapScroll() {
 	mapDiv.style.top = '10px';
 	mapDiv.style.left = ((document.body.clientWidth - 957)/2) + 'px';
 	moveTimer = setTimeout( "detectMapScroll()", 1 );
 }
 
 function showMap(country) {

  mapDiv = document.getElementById( 'mapDiv'+country );
  map = document.getElementById( 'map'+country ); 

 	map.style.display = 'block';  
 	mapDiv.style.display = 'block';   

	 
 	var hght = document.body.offsetHeight;
 	if( hght < document.body.clientHeight ) hght = document.body.clientHeight;
 	map.style.height =  hght + 'px';

 	detectMapScroll();

 	
 }
 
 function hideMap() {	
 	if( opacity > 0 ) {
 		mapDiv.style.opacity = opacity/100;
 		mapDiv.style.filter = 'alpha(opacity=' + opacity + ')';
 		opacity -= 30;
 		setTimeout( "hideMap()", 0 );
 	}
 	else {
 		mapDiv.style.display = 'none';
 		mapDiv.style.opacity = 1;
 		mapDiv.style.filter = 'alpha(opacity=100)';
 		map.style.display = 'none';
 		opacity = 100;
	}
 }
 
 function showTab(country)
 {
   if(country!='CR') document.getElementById('mapaCR').style.display='none';
   if(country!='SR') document.getElementById('mapaSR').style.display='none';
   //if(country!='PL') document.getElementById('mapaPL').style.display='none';
   document.getElementById('mapa'+country).style.display='block';
   if(country!='CR') document.getElementById( 'tabCR' ).className='';  
   if(country!='SR') document.getElementById( 'tabSR' ).className=''; 
   //if(country!='PL') document.getElementById( 'tabPL' ).className=''; 
   document.getElementById( 'tab'+country ).className='aktivni';    
 }
