activeobor = 0;

activeprod = 0;

activeall = 0;



function gf()

{





}





function setDog(t,u,c)

{     



    $.post( weburl + 'setdog', 'tid='+t+'&uid='+u+'&chid='+c,

           

           function(data)

           {

           

           		if (data == '1')

           		{

           			alert('Termín Vám bude připomenut.');

           			

           				$('#val-'+t).html('kliknutím můžete odebrat zaslání upozornění na e-mail');

           		//	$('#valnok-'+t).css('display','none');

           			

           			

           		}else

           		{

           			alert('Připomenutí u termínu bylo odebráno.');

             

             		$('#val-'+t).html('kliknutím si můžete nastavit zaslání upozornění na e-mail');

           			//$('#valnok-'+t).css('display','block');

           			         		

           		}

           		

           }

        );       

           



}



function refr2()

{

         $('#skoleni').attr('disabled','disabled');

			    $('#skoleni').addClass('disabled'); 

			    

			    

			                    

           	$('.filter select').selectmenu('destroy');

				$('.filter.home select').selectmenu({width:206,style:'dropdown',maxHeight:220});

				$('.filter.side select').selectmenu({width:185,style:'dropdown',maxHeight:220});   

    var pob = $('#place').val();

    var poba= $('#obor').val();

    

    if (pob =='all')

    {

    	pob ='';

    }

     //alert(pob);

     var balast = 'sel=2&pob='+pob;

    

     

    $.post( weburl + 'getsel', balast,

           

           function(data)

           {

        

        

        

        		$('#obor').html(data);

								

	 if (  activeobor != 0 )

	 {

	 

	 //	alert(activeobor);

	 	$("#obor option[value='"+activeobor+"']").attr('selected', 'selected');



	 

	 }

	 //alert(	 poba);

	 

	 if (poba =='all' && ( activeobor != 0 ||  activeprod != 0) )

	 {

	 	$("#obor option[value='all']").attr('selected', 'selected');



	 }

//	  $("#oborr").attr('selected', 'selected');

				if (activeall)
          		{
          		
          			$("#obor").val('all');

          		}

	 //$("#skoleni option[value='']").attr('selected', 'selected');

				$('#obor').removeAttr('disabled');

			    $('#obor').removeClass('disabled'); 

                

           	$('.filter select').selectmenu('destroy');

				$('.filter.home select').selectmenu({width:206,style:'dropdown',maxHeight:220});

				$('.filter.side select').selectmenu({width:185,style:'dropdown',maxHeight:220});     





	 				

           }

        );       









}



function esel()

{

                $('#skoleni').removeAttr('disabled');

			    $('#skoleni').removeClass('disabled'); 

                     	

               		$('#obor').removeAttr('disabled');

			    $('#obor').removeClass('disabled'); 

                	

			   	$('.filter select').selectmenu('destroy');

				$('.filter.home select').selectmenu({width:206,style:'dropdown',maxHeight:220});

				$('.filter.side select').selectmenu({width:185,style:'dropdown',maxHeight:220});  

				

}



function refr3()

{

     $('#skoleni').attr('disabled','disabled');

			    $('#skoleni').addClass('disabled'); 

                   

           	$('.filter select').selectmenu('destroy');

				$('.filter.home select').selectmenu({width:206,style:'dropdown',maxHeight:220});

				$('.filter.side select').selectmenu({width:185,style:'dropdown',maxHeight:220});                     	

    var pob = $('#place').val();

   

   var pob1 = $('#obor').val();

   var pobs= $('#skoleni').val();

    

    if (pob =='all')

    {

    	pob ='';

    }

 

     if (pob =='all')

    {

    	pob ='';

    }

    

        if (pob1 =='all')

    {

    	pob1 ='';

    }

     //alert(pob);

     var balast = 'sel=3&pob='+pob+'&obor='+pob1;

    

     

    $.post( weburl + 'getsel', balast,

           

           function(data)

           {

        

        



        		$('#skoleni').html(data);

          

             	 if (  activeprod != 0 )

	 			{

	 



	 				$("#skoleni option[value='"+activeprod+"']").attr('selected', 'selected');



	 

	 			}

	          	 if (  pobs == 'all' && ( activeobor != 0 ||  activeprod != 0) )

	 			{

	 



	 				$("#skoleni option[value='all']").attr('selected', 'selected');



	 

	 			}
				
				
				if (activeall)
          		{
          		
          			$("#skoleni").val('all');

          		}
				         

                $('#skoleni').removeAttr('disabled');

			    $('#skoleni').removeClass('disabled'); 

                     	

               	

			   	$('.filter select').selectmenu('destroy');

				$('.filter.home select').selectmenu({width:206,style:'dropdown',maxHeight:220});

				$('.filter.side select').selectmenu({width:185,style:'dropdown',maxHeight:220});

   

           

   



	 

        

	 

	 esel();

   

   			}

        );       

           



}





function wo(elem)

{

    

    if (is_string(elem))

    {

        

        var uu = $(elem).attr('href');

        

        window.open(uu);

    

        

    }else

    {

        window.open(elem);

        

        

    }

    

    

    

    return false;

}







function is_string(input){

    return typeof(input)=='string';

}



  

function recount(signa, val)

{



       



    var balast = 'recount=1&sign='+signa+'&bsk_cnt='+val ;

    

     

    $.post( weburl + 'ajax_basket', balast,

           

           function(data)

           {       

           

           

                data = jQuery.trim(data);

 

 

                $('#cnt'+signa).html( data );

                

                kosik1celk(); 

                    
                window.location = weburl+"obsah-kosiku";
                return true;

                

            }

           

           );

            

} 





function delpol(sign)

{   

    var balast = 'delpol=1&sign='+sign;

    

     

    $.post( weburl + 'ajax_basket', balast,

           

           function(data)

           {       

    

                kosik1celk(); 

   

     

   			 $.post( weburl + 'add', 'noholy=1', function(data)
					{       
						data = jQuery.trim(data);
		                $('#basket-info').html(data);
		                
		                    window.location = weburl+"obsah-kosiku";
		                    
        			} 
        			);
          

                return true;

                

            }

           

           );

            

} 





function kosik1celk()

{

    m_cid = 0;



    var balast = '';

    

     

    $.post( weburl + 'kosik1celk', balast,

           

           function(data)

           {       

           

           

                data = jQuery.trim(data);

 

 

                $('#kosik1celk').html( data );

    

                return true;

                

            }

           

           );

}





/***

 **

 *  add to cart function

 *

 *                     

 */

                          

function addtc(k_cid, p_cid, t_cid, c_cid,m_cid,kat_cid, count)

{

    m_cid = 0;



    var balast = 'k_cid='  + k_cid + '&p_cid=' + p_cid + '&t_cid=' + t_cid + '&c_cid=' + c_cid + '&m_cid=' + m_cid + '&kat_cid=' + kat_cid  + '&count='+count;



   

     

    $.post( weburl + 'add', balast,

           

           function(data)

           {       

           

           

                data = jQuery.trim(data);

 

 

                $('#basket-info').html(data);

                alert("Přidáno do košíku.");

                return true;

                

            }

           

           );

    

    

 

    

} 


