  var l_htmlConnection;
  var browserIE;
  
  function list_createXMLHttp()
  {
    var ret = null;
    browserIE = false;
    if (window.XMLHttpRequest){
      ret = new XMLHttpRequest();
      if (navigator.appName == 'Microsoft Internet Explorer') browserIE = true;
    }
    else if(window.ActiveXObject){
      ret = new ActiveXObject('Microsoft.XMLHTTP');
      browserIE = true;
    }
    return ret;
  }


  function list_set_order(order)
  {
	show_list(1,0,order);
  }


  function list_set_limit()
  {
	var limit = document.getElementById('list_limit').value;
	var old = document.getElementById('list_old').value;
	show_list(1,limit,'','',old);
  }


  function show_list(cast,limit,order,save,old)
  {
  	if (!cast) cast=1;
  	if (!limit) limit='';
  	if (!order) order='';
  	if (!old) old='';
  
	var url = fil_url(cast,limit,order,old);
	var send_val = '';

	if (document.sel_list && save){
	 var count = (document.sel_list.elements.length)-1;
	 for (var i=0;i<count;i++){
	 	if (i!=0) send_val +='&';
	 	send_val += document.sel_list.elements[i].name+'='+(document.sel_list.elements[i].checked==1 ? 1 : 0);
	 }
	 // skryti hlasky
	 hide_att_list();
	}

    l_htmlConnection = list_createXMLHttp();
    if(l_htmlConnection!=null)
    {
	  if (!browserIE) l_htmlConnection.overrideMimeType('text/html');
      l_htmlConnection.onreadystatechange = list_stateHandler;  
      l_htmlConnection.open('POST', url, true);
      l_htmlConnection.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      l_htmlConnection.setRequestHeader("Content-length", send_val.length);
      l_htmlConnection.setRequestHeader("Connection", "close");
      l_htmlConnection.send(send_val);
      
    }
  }
  
  function list_stateHandler(){
    if (l_htmlConnection.readyState == 4){
      if (l_htmlConnection.status == 200){
        var orig = l_htmlConnection.responseText;
 		document.getElementById('list').innerHTML = orig;
 		// posunuti zobrazeni na alist
 		//if (window.XMLHttpRequest) document.location.href='#alist';
      }
    }
  }



function click(ID){
	location.href=$('c'+ID).value;
}

function foc(ID){
	if($('i'+ID).className=='tb_f'){
		$('i'+ID).className='tb_b';
	}
	else{
		$('i'+ID).className='tb_f';
	}
}

