var xmlHttp
var openedMenu = -1;
var openedSubMenu = -1;

function showHide(elem) {
	if (document.getElementById(elem).style.display == 'none') {
		document.getElementById(elem).style.display = 'block';
		}
	else {
		document.getElementById(elem).style.display = 'none';
		}
	}

function closeLastMenu() {
	if (openedMenu > -1) {
		document.getElementById('sub'+openedMenu).style.display = 'none';
		}
	}

function closeLastSubMenu() {
	if (openedSubMenu > -1) {
		document.getElementById('sub'+openedSubMenu).style.display = 'none';
		}
	}

function paramSelect(id) {
	xmlHttp = GetXmlHttpObject();
	if (xmlHttp == null) {
  		alert ("Your browser does not support AJAX!");
  		return;
  		} 
  	
	var url = "/om-mh/inc/products-params.ajax.php";
	url = url+"?ident="+id;
	url = url+"&sid="+Math.random();
	xmlHttp.onreadystatechange = function() {
		vypisStavu(xmlHttp, id);
		}
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
	}

function vypisStavu(xmlHttp, id) {
	if (xmlHttp.readyState == 4) {
		if (xmlHttp.status == 200) {
			pom = document.getElementById("parametry");
			pom.innerHTML = xmlHttp.responseText;
			}
		}
	}

function GetXmlHttpObject() {
	var xmlHttp=null;
	try {
  		// Firefox, Opera 8.0+, Safari
  		xmlHttp = new XMLHttpRequest();
  		}
	catch (e) {
  		// Internet Explorer
  		try {
    			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    			}
  		catch (e) {
    			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    			}
  		}
	return xmlHttp;
	}

