	function changePage(parent, page) {
		
		strana = parent + 'strana-' + page + '.html';
		return window.location.replace(strana); 
	}
	
	function getChild(parent, tagname, classname) {
		
		var nodes = parent.childNodes;
		tagname = tagname.toLowerCase();
		
		for (x in nodes) {
			
			if (nodes[x].nodeType == 1 && nodes[x].tagName.toLowerCase() == tagname) {
				
				if (!classname) {
					return nodes[x];
					break;
				} else if(nodes[x].className == classname) {
					return nodes[x];
					break;
				}
				
			}
			
		}
		
	}
	
	function getInt(str) {
		
		return parseInt(str.replace('px',''));
		
	}
	
	
	/** component: ComboBox **/
	function comboShow(combo, hide) {
		
		var select = getChild(combo, 'select');
		
		if (hide == false || select.style.display == 'block') {
			select.style.display = 'none';
		} else {
			select.style.display = 'block';
			select.focus();
		}
		
	}
	
	
	function comboChange(select) {
		
		var div = getChild(select.parentNode, 'div');
		
		div.innerHTML = select.options[select.options.selectedIndex].text;
		
	}
	/** ------------------- **/
	
	
	
	/** component: CheckBox **/
	function checkBoxField(id,li,value,last) {
		
		var a = getChild(li,'a');
		
		if (a.className == 'choose') {
			
			a.className = '';
			if (!last) {
				li.className = 'NonChoose';
			}
			
			checkBoxUncheck(id,value);
			
		} else {
			
			a.className = 'choose';
			if (!last) {
				li.className = '';
			}
			
			checkBoxCheck(id,value);
			
		}
		
		
	}
	
	function checkBoxUncheck(id,value) {
		
		var field = document.getElementById(id);
		
		var arr = field.value.split(';');
		
		field.value = '';
		
		for (i=0;i<arr.length-1;i++) {
			if (arr[i] != value) {
				field.value += arr[i] + ';';
			}
		}
		
		
	}
	
	function checkBoxCheck(id,value) {
		document.getElementById(id).value += value + ';';
		
	}
	
	
	/** ------------------- **/
	
	function opravCheckbox(elem) {
		if (document.getElementById(elem).value == 1) {
			document.getElementById(elem).value = 0;
		}
	}
	
	
	function check(span,id) {
		
		if (span.className == 'check') {
			
			span.className = 'no-check';
			document.getElementById(id).value = 0;
		} else {
			
			span.className = 'check';
			document.getElementById(id).value = 1;
		}
		
		hodnota = document.getElementById(id).value;
		
		if ((id == 'reg_send_info') && (hodnota == 0)) {
			document.getElementById('faktura').style.display = "block";
		} else if ((id == 'reg_send_info') && (hodnota == 1)) {			
			document.getElementById('faktura').style.display = "none";
		}
		
	}
	
		function setCheckBoxValue(value, checkbox) {
		
		var span = document.getElementById('cb_'+checkbox);
		var hidden = document.getElementById(checkbox);
		
		if (value == 0) {
			span.className = 'no-check';
			hidden.value = 0;
		} else {
			span.className = 'check';
			hidden.value = 1;
		}
		
	}
		
	
	/** radioField **/
	
	function radioSelect(div,id,value) {
		
		var group =  div.parentNode.parentNode;
		
		
		
		for (i=0;i<group.childNodes.length;i++) {
			
			if (group.childNodes[i].nodeType == 1  && group.childNodes[i].tagName.toLowerCase() == 'div') {
				
				var radio = getChild(group.childNodes[i],'div','radio');
				radio.firstChild.className = 'no-check';
				
			}
			
		}
		
		div.firstChild.className = 'check';
		
		return document.getElementById(id).value = value;
		
	}
	
	/** ------------------- **/
	
	/** Slider **/
	
	
	
	/** ------------------- **/
