/*
*
*/

function generateSelect(selectId, catType, key, isCategory)
{
	var objSelect = document.getElementById(selectId);
	var nKey = null;
	var i = 0;
	var isTrue = false;
	
	objSelect.options.length = 0;
	
    objSelect.options[0] = new Option('--wybierz--', '');
	i = 1;
	
	for( subcatKey in catType)
	{
		if((subcatKey.indexOf(key) != -1) || isCategory)
		{
			objSelect.options[i] = new Option(catType[subcatKey], subcatKey);
			i++;
		}
	}
	objSelect.options.length = i;
}

function setSelected(selectId, selectedKey)
{
  var objSelect = document.getElementById(selectId);
  var count = objSelect.length; 
  for(i = 0; i < count; i++)
  {
    if(objSelect.options[i].value == selectedKey)
    {
      objSelect.options[i].selected = true;
    }
  }
}

function displayWaitingPage(show)
{
  var obj = document.getElementById('waitingPage');
  if(show == 'true')
    obj.style.display = "block";
  else 
    obj.style.display = "none";
}
