function prohlidka(id){
					 
 	 $.ajax({
								type: "GET",
								url: "prohlidka.php",
								cache: false, 
								data: "id=" + id + "",
								dataType: "html", 
								beforeSend: function(){
							  
							  
								}, 
								success: function(data){
								  $("#prohlidka").fadeIn("slow").html(data);							  									
								}
							}); // ajax  

	
	
	}

					
					
function selectAll(id)
	{
		document.getElementById(id).focus();
		document.getElementById(id).select();
	}					
				
					

function filtrace(){
                      //alert('ano');                 
                      //var zeme = $("select[name='zeme']").val();
                      var kraj = $("select[name='kraj']").val();
                     // var mesto = $("select[name='mesto']").val();
                      //var tema = $("select[name='tema']").val();            
					  //alert(zeme + kraj + mesto + tema);
											
					 // alert(kraj);
					  
                      $.ajax({
								type: "GET",
								url: "filtrace.php",
								cache: false, 
								data: "kraj=" + kraj + "",
								dataType: "html", 
								beforeSend: function(){
							  
							  
								}, 
								success: function(data){
								  $("#filtr").fadeIn("slow").html(data);							  									
								}
							}); // ajax   
					
				
                  }; //filtrace	
				  
				  
function selectVelikost(){
                    ///  alert('ano');                 
                      //var zeme = $("select[name='zeme']").val();
                      var druh = $("select[name='druh']").val();
                     // var mesto = $("select[name='mesto']").val();
                      //var tema = $("select[name='tema']").val();            
					  //alert(zeme + kraj + mesto + tema);
											
					//  alert(druh);
					  
                      $.ajax({
								type: "GET",
								url: "scripts/selectVelikost.php",
								cache: false, 
								data: "druh=" + druh + "",
								dataType: "html", 
								beforeSend: function(){
							  
							  
								}, 
								success: function(data){
								  $("#velikost").fadeIn("slow").html(data);							  									
								}
							}); // ajax   
					
				
                  }; //filtrace					  
				  
function dop_info()
{
		
	 var co_nadpis = $("input[name='co_nadpis']").val();
	 var text = $("input[name='co_info']").val();
	 var id = $("input[name='id']").val();
	//alert(co + text);
	
	$.ajax({
								type: "GET",
								url: "scripts/dop_info_add.php",
								cache: false, 
								data: "co_nadpis=" + co_nadpis +"&text=" + text + "&id=" + id + "" ,
								dataType: "html", 
								beforeSend: function(){
							  	// $("#table_info").hide().html(data);	
								}, 
								success: function(data){
								  $("#table_info").hide().html(data);
								  $("#dop_info").show().html(data);							  									
								}
	}); // ajax   
	
}

function del_dop_info(id){
	var idnabikdy = $("input[name='id']").val();
	$.ajax({
								type: "GET",
								url: "scripts/dop_info_del.php",
								cache: false, 
								data: "id=" + id + "&idnabidky=" + idnabikdy + "" ,
								dataType: "html", 
								beforeSend: function(){
							    
							  
								}, 
								success: function(data){
									$("#table_info").hide().html(data);
								  $("#dop_info").show().html(data);							  									
								}
	}); // ajax 
}


				  
function onlyAlfanumeric(key) {
    test = getkey(key);
    set1 = (test > 32 && test < 48);
    set2 = (test > 57 && test < 65);
    set3 = (test > 90 && test < 97);
    set4 = (test > 122)
    set5 = (test >= 35 || test <= 40);
    set6 = (test != 8 && test != 46);
    if(set1 || set2 || set3 || set4 || set5 || set6) return false;
  }
  
  function formatInput(obj) {
    var start = obj.selectionStart;    
    var end = obj.selectionEnd;
    var rgx = /(\d+)(\d{3})/;
    var sep = " ";
    var oldlen = Math.floor(obj.value.length/3);
    if(start == obj.value.length) oldlen--;
    var str = obj.value.replace(/ /g, "");
    while (rgx.test(str)) {
      str = str.replace(rgx, '$1' + sep + '$2');
    }
    var opera = (navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)? 2 : 0 ;
    var newlen = Math.floor(str.length/3);
    obj.value = str;
    obj.selectionStart = start+(newlen-oldlen);
    obj.selectionEnd = end+(newlen-(oldlen+opera));
    
  }