$(document).ready(function() {
    
    // flags
          $('img.flag').toggle(function() {
               $('.actualLanguage').hide();
               $('#flags').show("medium");    
            }, function() {
               $('#flags').hide("medium").parent().find('.actualLanguage').show("medium");
               ;
            });
            
            $('#flags li a.cs').click(function() {
               $('.actualLanguage').attr('src', 'images/cs.gif');            
               $('#flags').hide("medium").parent().find('.actualLanguage').show("medium");
            });
            
            $('#flags li a.en').click(function() {
               $('.actualLanguage').attr('src', 'images/en.gif');            
               $('#flags').hide("medium").parent().find('.actualLanguage').show("medium");
            });
            
     // show hide block on right    
            $('#rightPanel h2').click(function() {    
               $(this).parent().find('.panelHolder').slideToggle("slow");
            });
            
     // show hide reference category    
            $('.ref-category a.categoryHref').click(function() {    
               $(this).parent().find('ul').slideToggle("slow");
            });
            
    // show hide service   
            $('.showservice').click(function() {   
              $(this).parent().parent().find('.short').slideToggle("fast"); 
               $(this).parent().parent().find('.holder').slideToggle("slow");
            });
            
     // show hide person    
            $('.person h3').click(function() { 
            
               $(this).parent().find('.holder').slideToggle('medium', function() {

                    if ($(this).parent().find('h3').css("background-image").indexOf("App_Themes/Basic/images/right.gif") != -1)
                         $(this).parent().find('h3').css("background-image","url(App_Themes/Basic/images/left.gif)");
                    else
                          $(this).parent().find('h3').css("background-image","url(App_Themes/Basic/images/right.gif)");
                });
                   

               
            });
            
     // clear predefined text inputs on click into 
            $('input[type=text]').click(function() {  
               if (( $(this).attr('value') == 'hledat')||( $(this).attr('value') == 'mail@mail.cz'))  
                    $(this).attr('value','');
            });
            
     //slider 
            if ( $("#slider") != null )
                $("#slider").easySlider();

        $("a.thumb,a.personImage").fancybox({
            'overlayShow': false,
            'transitionIn': 'elastic',
            'transitionOut': 'elastic'
        });
        
        $("a.thumbiframe").fancybox({
            'overlayShow': false,
            'transitionIn': 'elastic',
            'transitionOut': 'elastic',
            'type': 'iframe'
        });

  });

        function openWin() {
            var oWnd = radopen("DialogInterest.aspx", "RadWindow1");
        }
        function openWinNext() {
            var oWnd = radopen("DialogDoporuc.aspx", "RadWindow1");
        }

       
