

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(){
                      var druh = $("select[name='druh']").val(); 
                      $.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(id)
{
		
		
	 var co_nadpis = $("input[name='co_nadpis']").val();
	 var text = $("input[name='co_info']").val();
		//alert(co + text);
	//alert("co_nadpis=" + co_nadpis +"&text=" + text + "&id=" + id + "");
	$.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 
}

// kalkulace

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

	
	
	}
	
function selectVelikost2(){	

                      var druh = $("select[name='druh2']").val(); 
                      $.ajax({
								type: "GET",
								url: "scripts/selectVelikost.php",
								cache: false, 
								data: "druh=" + druh + "&typ=2",
								dataType: "html", 
								beforeSend: function(){	
								}, 
								success: function(data){
								  $("#velikost2").fadeIn("slow").html(data);							  									
								}
							}); // ajax   
					
				
                  }; //filtrace		

//kalkulace



//slider
/*
$(function(){
	//Get our elements for faster access and set overlay width
	var div = $('div.sc_menu'),
		ul = $('ul.sc_menu'),
		ulPadding = 15;
	
	//Get menu width
	var divWidth = div.width();

	//Remove scrollbars	
	div.css({overflow: 'hidden'});
	
	//Find last image container
	var lastLi = ul.find('li:last-child');
	
	//When user move mouse over menu
	div.mousemove(function(e){
		//As images are loaded ul width increases,
		//so we recalculate it each time
		var ulWidth = lastLi[0].offsetLeft + lastLi.outerWidth() + ulPadding;	
		var left = (e.pageX - div.offset().left) * (ulWidth-divWidth) / divWidth;
		div.scrollLeft(left);
	});
});

*/

//slider






				  
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));
    
  }
