function switchKG(index){
	kg = document.getElementById('kgbox');
	cm = document.getElementById('cmbox');
	if(index == 2){ 
		kg.style.display = 'block'; 
		cm.style.display = 'none';
	} else {
		kg.style.display = 'none';
		cm.style.display = 'block';
	}
} 


function manageBlock(id, res, closeIt){	 
	if(closeIt){
		$('box' + id).setStyle('height', '0px');   		
	}  else {
		$('boxTriger' + id).clicked = true;
	}
	
	$('boxTriger' + id).bid  = id;
	$('boxTriger' + id).onclick = function(){ 
		//this.fade('out');     
		if(this.clicked == true){
			$('box' + this.bid).tween('height', '0');         
			this.clicked = false;    
			this.removeClass('active');  
		} else {
			this.clicked = true;    
			this.addClass('active');
			if(res){ 
				$('box' + this.bid).tween('height', '250');         
			} else {   
				$('box' + this.bid).tween('height', '148');      
			}
		}
		return false;  
	};  
	
	
} 

function hasAgreed(){
	if(document.getElementById('form_prohlaseni').checked){ 
		return true;
	} else {
		alert('Pro odeslání je nutné souhlasit s podmínkami.');	
		return false;   
	}
}

function makePopup(windowPosX,windowPosY,windowName,url,name,w,h,extra){
	var titlebarHeight = 28;
	str="height="+h+",width="+w+","+extra;
	if(parseInt(navigator.appVersion)>3) // supports screen.width
		if (windowPosX == -1) {
			str+=",left=" + (screen.width -w)/2 + ",top=" + parseInt(((screen.height -h)-titlebarHeight)/2);
		}
		else {
			str+=",left="+windowPosX+",top="+windowPosY;
		}
	var k = eval(windowName + "=window.open('" + url + "','" + name + "','" + str + "')");
	return k;
}

function openPop(url,width,height) {
	ak_pop = makePopup(-1,-1,'tab', url,'tab',width,height,'scrollbars=yes');		
	ak_pop.focus();	
}

function showPodminky(url){
	makePopup(-1,-1,'podm',url,'podm', 740, 540, 'menubar=no,resizable=yes,scrollbars=yes');       
	return false; 
}  
