function displayOnOff(id)
	{
		var obj=document.getElementById(id);
		if(obj.style.display=='block')
			{
				obj.style.display='none';
			}
		else
			{
				obj.style.display='block';
			}
	}


var slideimages=new Array()
var slidelinks=new Array()

function slideshowimages()
	{
		for (i=0;i<slideshowimages.arguments.length;i++)
			{
				slideimages[i]=new Image()
				slideimages[i].src=slideshowimages.arguments[i]
			}
	}

function popup(url,width,height) 
	{
		 var left   = (screen.width  - width)/2;
		var top    = (screen.height - height)/2;
		 var params = 'width='+width+', height='+height;
		 params += ', top='+top+', left='+left;
		 params += ', directories=no';
		 params += ', location=no';
		 params += ', menubar=no';
		 params += ', resizable=yes';
		 params += ', scrollbars=yes';
		 params += ', status=no';
		 params += ', toolbar=no';
		 newwin=window.open(url,'_blank', params);
		 if (window.focus) {newwin.focus()}
		 return false;
	}
	
	function check_form_druh(c)
	{
		var ch=document.getElementById(c);
		var im=document.getElementById(c+'_img');
		if(ch.value==1)
			{
				var imB=document.getElementById('druh2_img');
				var imA=document.getElementById('druh3_img');
			}
		else if(ch.value==2)
			{
				var imB=document.getElementById('druh1_img');
				var imA=document.getElementById('druh3_img');
			}
		else if(ch.value==3)
			{
				var imB=document.getElementById('druh2_img');
				var imA=document.getElementById('druh1_img');
			}

			ch.checked=true;
		if(ch.checked==true)
			{
				im.className='form_checked';
				imB.className='form_check';
				imA.className='form_check';
			}
	}
	
function check_form_umisteni(c)
	{
		var ch=document.getElementById(c);
		var im=document.getElementById(c+'_img');
		if(ch.value==1)
			{
				var imB=document.getElementById('umisteni2_img');
			}
		else if(ch.value==2)
			{
				var imB=document.getElementById('umisteni1_img');
			}

			ch.checked=true;
		if(ch.checked==true)
			{
				im.className='form_checked';
				imB.className='form_check';
			}
	}
	
function centerPositionHlavni(id,url,width,height)
	{
		if(navigator.appName=='Microsoft Internet Explorer')
			{
				var resultWidth=(document.documentElement.clientWidth-width)/2;
				var resultHeight=(document.documentElement.clientHeight-height)/2;
				if(width>(document.documentElement.clientWidth-100)){resultWidth=50;}
				if(height>(document.documentElement.clientHeight-100)){resultHeight=50;}
			}
		else
			{
				var resultWidth=(window.innerWidth-width)/2;
				var resultHeight=(window.innerHeight-height)/2;
				if(width>(window.innerWidth-100)){resultWidth=50;}
				if(height>(window.innerHeight-100)){resultHeight=50;}
			}
		document.getElementById(id+'_iframe').src=url;
		
		document.getElementById(id+'_1').style.left=resultWidth+'px';
		//document.getElementById(id+'_1').style.top=resultHeight+'px';
		document.getElementById(id+'_1').style.top='150px';
				
		document.getElementById(id+'_1').style.width=width+'px';
		document.getElementById(id+'_1').style.height=height+'px';
		
		document.getElementById(id+'_2').style.width=width+'px';
		document.getElementById(id+'_2').style.height='20px';
		
		document.getElementById(id+'_iframe').style.width=(width-2)+'px';
		document.getElementById(id+'_iframe').style.height=(height-21)+'px';
				
		document.getElementById(id+'_1').style.display='block';
		document.getElementById('pozadi_disable_detail').style.display='block';
		
	}

function centerPosition(id,url,width,height)
	{

		if(navigator.appName=='Microsoft Internet Explorer')
			{
				var resultWidth=(document.documentElement.clientWidth-width)/2;
				var resultHeight=(document.documentElement.clientHeight-height)/2;
				if(width>(document.documentElement.clientWidth-100)){resultWidth=50;}
				if(height>(document.documentElement.clientHeight-100)){resultHeight=50;}
			}
		else
			{
				var resultWidth=(window.innerWidth-width)/2;
				var resultHeight=(window.innerHeight-height)/2;
				if(width>(window.innerWidth-100)){resultWidth=50;}
				if(height>(window.innerHeight-100)){resultHeight=50;}
			}
		document.getElementById(id+'_iframe').src=url;
		
		document.getElementById(id+'_1').style.left=resultWidth+'px';
		//document.getElementById(id+'_1').style.top=resultHeight+'px';
		document.getElementById(id+'_1').style.top='150px';
				
		document.getElementById(id+'_1').style.width=width+'px';
		document.getElementById(id+'_1').style.height=height+'px';
		
		document.getElementById(id+'_2').style.width=width+'px';
		document.getElementById(id+'_2').style.height='20px';
		
		document.getElementById(id+'_iframe').style.width=(width-2)+'px';
		document.getElementById(id+'_iframe').style.height=(height-21)+'px';
				
		document.getElementById(id+'_1').style.display='block';
		document.getElementById('pozadi_disable_detail').style.display='block';
		
	}
	
function open_calendar(id,width,height)
	{

		if(navigator.appName=='Microsoft Internet Explorer')
			{
				var resultWidth=(document.documentElement.clientWidth-width)/2;
				var resultHeight=(document.documentElement.clientHeight-height)/2;
				if(width>(document.documentElement.clientWidth-100)){resultWidth=50;}
				if(height>(document.documentElement.clientHeight-100)){resultHeight=50;}
			}
		else
			{
				var resultWidth=(window.innerWidth-width)/2;
				var resultHeight=(window.innerHeight-height)/2;
				if(width>(window.innerWidth-100)){resultWidth=50;}
				if(height>(window.innerHeight-100)){resultHeight=50;}
			}
		//document.getElementById(id+'_iframe').src='calendar_platnost_certifikatu.php';
		
		document.getElementById(id+'_1').style.left=resultWidth+'px';
		//document.getElementById(id+'_1').style.top=resultHeight+'px';
		document.getElementById(id+'_1').style.top='150px';
				
		document.getElementById(id+'_1').style.width=width+'px';
		document.getElementById(id+'_1').style.height=height+'px';
		
		document.getElementById(id+'_2').style.width=width+'px';
		document.getElementById(id+'_2').style.height='20px';
		
		document.getElementById(id+'_iframe').style.width=(width-2)+'px';
		document.getElementById(id+'_iframe').style.height=(height-21)+'px';
				
		document.getElementById(id+'_1').style.display='block';
		document.getElementById('pozadi_disable_detail').style.display='block';

		if(document.getElementById('platnost_certifikatu').value!='')
			{
				var cele_datum=document.getElementById('platnost_certifikatu').value;
				var day=cele_datum.substring(8,10);
				var month=cele_datum.substring(5,7);
				var year=cele_datum.substring(0,4);
				document.getElementById(id+'_iframe').src='calendar_platnost_certifikatu.php?celedatum='+cele_datum+'&mesic='+month+'&rok='+year+'&den='+day;
			}
		else
			{
				document.getElementById(id+'_iframe').src='calendar_platnost_certifikatu.php';
			}
	}


