   function check_switch(){
      
    var checked;
    checked = $('#check_toggle').is(':checked');
    if(checked) $('.check_all').attr('checked', true);
    else $('.check_all').attr('checked', false);
    
   }

  function createplayer() {
  	var s = new SWFObject("flash/mediaplayer.swf","PlayerID","685","300","7");
    s.addParam("allowfullscreen","true");
  	s.addVariable("file","inc/playlist.xml");
  	s.addVariable("width","685");
  	s.addVariable("height","300");  	
  	s.addVariable("backcolor","0x555555");
  	s.addVariable("fontcolor","0xffffff");
  	s.addVariable("lightcolor","0xffffff");
  	s.addVariable("screencolor","0x000000");  	
  	s.addVariable("displaywidth","500");
  	s.addVariable("overstretch","fit");
  	s.addVariable("shuffle","false");
  	s.addVariable("thumbsinplaylist","true");
  	s.write("placeholder");  	  	
  }
  
  function show_extra(sub){
    $('.sub_extra').hide();
    $('.sub_extra.'+sub).fadeIn(1000);     
    $('.active').css('color','#888');
    $('.active.'+sub).css('color','#000');
    if( sub == 'video'){
      createplayer();
    }
  }
  
  
  
  function send_mail(){
    var product_id = $('#sendmail_product_id').val();
    var email = $('#sendmail_email').val();
    var from_email = $('#sendmail_my_email').val();
    var text = $('#sendmail_text').val();
    
    $.get(home_url+'rq/ac.php?what=send_mail&'+'q[product_id]='+product_id+'&q[email]='+email+'&q[from_email]='+from_email+'&q[text]='+text, function(data){
          $('.sendmail .body .errnot').html(data);
          if(data == "Email úspěšně odeslán.") $('.sendmail').hide(800);
         });
    
  }

  function redirect_radio_button(url){
    window.location=url;    
  }
  
  
  function pausecomp(millis)
  {
  var date = new Date();
  var curDate = null;
  
  do { curDate = new Date(); }
  while(curDate-date < millis);
  } 
  
  
  function CreateBookmarkLink() {
  
   title = document.title; 
    // Blogger - Replace with <$BlogItemTitle$> 
    // MovableType - Replace with <$MTEntryTitle$>
  
   url = location.href;
    // Blogger - Replace with <$BlogItemPermalinkURL$> 
    // MovableType - Replace with <$MTEntryPermalink$>
    // WordPress - <?php bloginfo('url'); ?>
  
  	if (window.sidebar) { // Mozilla Firefox Bookmark
  		window.sidebar.addPanel(title, url,"");
  	} else if( window.external ) { // IE Favorite
  		window.external.AddFavorite( url, title); }
  	else if(window.opera && window.print) { // Opera Hotlist
  		return true; }
   }    






/* 
// Tato funkce umoznuje pouzivani pruhlednych png v pozadi objektu
// @param: class - class objektu, kteremu chceme nastavit pozadi
//         bgSrc - cela cesta k obrazku, ktere chceme mit v pozadi objektu       
// @usage: staci pripsat nasledujici radku do onload udalosti
//         transparentBg('object','background.png');      
//  (odkazy, ktere maji byt v objektu s timto pozadim by mely mit nastavenou vlastnost position)  
*/
function transparentBg(cls, bgSrc, bgSrcHover) {
  // is the browser competent with the DOM?
  /*if(document.getElementById) {
    var obj = document.getElementById(id);
    // is the browser capable of managing runtimeStyle?
    // (this would mean, basically, "hey, I'm IE")
    if(obj.runtimeStyle) {
      // delete current background
      obj.style.backgroundImage = 'none';
      // apply PNG background with alpha transparency filtering
      obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+bgSrc+",sizingMethod='scale')";
    }
  }*/
  objects = $("."+cls);
  //alert(objects.length);
  for(i=0; i< objects.length; i++){
    obj = objects[i];
    if(obj.runtimeStyle) {
      // delete current background
      obj.style.backgroundImage = 'none';
      // apply PNG background with alpha transparency filtering
      obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+bgSrc+",sizingMethod='crop')";      
      /*if(bgSrcHover)
        obj.hover(function(){
          obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+bgSrcHover+",sizingMethod='image')";
        });*/
    }
  }
}

  function submitenter(myfield,e)
    {
    var keycode;
    if (window.event) keycode = window.event.keyCode;
    else if (e) keycode = e.which;
    else return true;
    if (keycode == 13)
       {
       myfield.form.submit();
       return false;
       }
    else
       return true;
    }
    
    
  function menu(colection){     
      var actualColection = colection;                  
      var isClick = false;      
      $('.'+actualColection+'.cats').show();
      $('.'+actualColection+'.cats').addClass('visible');              
      $('.category').click( function() {                        
        var parentDiv = $(this).parent();
        var subcatDiv = $(parentDiv).find(".cats");        
        var subcatImgHover = $(parentDiv).find(".violet_hover");
        var subcatImg = $(parentDiv).find(".violet");                                                               
        var isActualVisible = $('.'+actualColection+'.cats').hasClass('visible');
        var isVisible = $(subcatDiv).hasClass('visible');
        isClick = true;              
        $('span.category img.violet').show();
        $('span.category img.violet_hover').hide();        
        $('.cats').hide('slow');                        
        $('.cats').removeClass('visible');        
        $(subcatImg).hide();
        $(subcatImgHover).show();
        if(!isVisible){                  
          $(subcatDiv).show('slow');          
          $(subcatDiv).addClass('visible');                                     
        }        
      });      
      if(isClick == false){
        var parentDiv = $('.'+colection+'.cats').parent();                
        var subcatImgHover = $(parentDiv).find(".violet_hover");
        var subcatImg = $(parentDiv).find(".violet");        
        $(subcatImg).hide();
        $(subcatImgHover).show();        
      }
  } 
    
