﻿$(document).ready(function(){
	// CUFON
  
  Cufon.replace('.chineser, #main-menu a, #main-menu strong, h1, #breadcrumb, #content h2, #content h3, #content h4, .cufon', { fontFamily: 'chineser', hover:true });
	
  // CORNERS
  DD_roundies.addRule('#content_holder', '0 5px 5px 0', true);
  DD_roundies.addRule('#visit', '0 0 7px 0', true);
  

/*  $('#left_bg, .home_step').corner("5px tr br");

  $('#leftmenu').corner("5px tr br bl");
  $('#leftmenu_type .active').corner("5px top");
  
  $('#leftmenu_type .notactive, .buy_assistant_box, #teaser, .home_interval, #content_bluebox_footer').corner("5px");
  
  $('#right .header, #right .right_box, .home_step_first').corner("5px tl bl");
  
  $('.btn_blue, .btn_blue_down, .btn_blue_right, .btn_blue_back, .btn_white_right').corner("round 5px");
  $('.cart_yellow_holder, .cart_detail_holder, .cart_detail_sum, #cart_notes, .cart_blue_box, .cart_blueform_box, .registrace_box').corner("round 5px");
  $('.cart_step_last').corner("5px tr br");
  $('.cart_step_first').corner("5px tl bl");

  $('#catalog_detail_tabs a.notactive').corner("5px");
  $('#catalog_detail_tabs, #catalog_detail_tabs a.active').corner("5px top");

  
  $('#account_blue_tabs a.notactive, .comment_header, .legend_blue_box, .legend_white_box').corner("5px");
  $('#account_blue_tabs a.active').corner("5px top");
  $('.account_step_first').corner("5px tl bl");
  $('.account_step_last, #account_blue_tabs').corner("5px tr br");
  $('.account_info_tabs div').corner("5px");
  */
  
  // MENU
  $("#topmenu li").hover( function() {
       var submenu = $('div.submenu',this);
       
      
       if ( submenu.size() != 0 )
       {
         submenu.fadeIn(100);    
         $(this).addClass("selected");    
        setTimeout( 'curef', 1000 );
       }
  
     }, function() {
         var submenu = $('div.submenu',this);
         $(this).removeClass("selected");
         if ( submenu.size() != 0 ) {
           submenu.fadeOut(100);
           setTimeout( 'curef', 1000 );
     }
  }); 
  
  // CHECKBOX
  $('#check_potisk').checkbox().click( function() {
        if ( $(this).is(':checked') ) {
            $('#show_potisk').hide();
        } else {
            $('#show_potisk').show();
        }
    });
   
  // SHOW & HIDE
		$(".toggle").click(function(){   
				$(this).next().fadeSliderToggle()
			 return false;
		})

  // HOVER FOR IE6
  $(".catalog_item").each( function() {

    $(this).hover( function() {
        $(this).addClass("catalog_item_hover");
        $(this).find(".content").addClass("content_hover");
        $(this).find(".content_top").addClass("content_top_hover");
        $(this).find("a").addClass("hover");
       
     }, function() {
        $(this).removeClass("catalog_item_hover");
        $(this).find(".content").removeClass("content_hover");
        $(this).find(".content_top").removeClass("content_top_hover");
        $(this).find("a").removeClass("hover");
    });
  });  
  
	// LIGHTBOX
	$('a.lightbox').lightBox({
		txtImage : 'Obrázek',
		txtOf	: 'z',
		overlayBgColor : '#000',
		imageLoading:			'/public/images/lightbox-ico-loading.gif',		// (string) Path and the name of the loading icon
		imageBtnPrev:			'/public/images/lightbox-btn-prev.gif',			// (string) Path and the name of the prev button image
		imageBtnNext:			'/public/images/lightbox-btn-next.gif',			// (string) Path and the name of the next button image
		imageBtnClose:			'/public/images/lightbox-btn-close.gif',		// (string) Path and the name of the close btn
		imageBlank:				'/public/images/lightbox-blank.gif'
	});
	$(".fireLightboxEvent").click(function() {
		$('a.lightbox:first').click();
		console.log('hellow');
	});

	
	//TOGGLE VARIANTS
	$('.show_all_variants').click( function() {
		$('.variants_hide').toggle();
	});
	
	$('.showCommentsBox').click(function() {
		$(this).addClass('active');
		$('.showProductBox').removeClass('active');
		$('#commentsBox').show();
		$('#productBox').hide();
	});
	$('.showProductBox').click(function() {
		$(this).addClass('active');
		$('.showCommentsBox').removeClass('active');
		$('#commentsBox').hide();
		$('#productBox').show();
	});


});


