
        function clearText(thefield) {
            if (thefield.defaultValue == thefield.value)
                thefield.value = ""
        }
        $(document).ready(function() {
        	
        	        	
		
            var input = $('#id_place');
            input.one('click', function() {
   
                $(this).focus().click().select();
                $(this).one('click', arguments.callee);
            });
            // Jquery autocomplete with xml file
	 
	    
	           var maxrows = 10;
	           if(op_limit_rows)
	            maxrows=4;
	    
	    
            input.autocomplete('/jobs?a=getplace', {
                delay: 10,
                width:"180px",
                scroll:false,
                minChars: 2,
                matchSubset: 1,
                matchContains: 1,
                minChars: 0,
		max:maxrows,
                parse: parseXML,
                formatItem: formatItem,
                formatResult: formatResult
            })
                        
            function parseXML(xml) {
            	
                var results = [];
                var orte=xml.split("\n");
                
                for(var i = 0; i < orte.length;i++)
                {
                  var ort = orte[i];
                  if(ort.length<3)
                    continue;
 
                  var text = ort;
                  var value = ort;
                  results[results.length] = { 'data': { text: text, value: value },
                        'result': text, 'value': value
                    
                 }
               }
                return results;
                                
            };
            
            function formatItem(data) {
                return data.text;
            };
            
            function formatResult(data) {
                return data.text;
            };
        });
 
    
 
 
  function proceedSort()
  {
    document.getElementById("id_sort").value = document.getElementById("id_select_sort").value;
    document.getElementById("id_rows").value = document.getElementById("id_select_rows").value;
    document.getElementById("id_f1").submit();
  }
  function proceedRows()
  {
    document.getElementById("id_sort").value = document.getElementById("id_select_sort").value;
    document.getElementById("id_rows").value = document.getElementById("id_select_rows").value;
    document.getElementById("id_f1").submit();
  }
 
 
 
            function formatItem(data) {
                return data.text;
            };
 
            function formatResult(data) {                
                return r;
            };        
 
 
