
$(document).ready(function()
      {
      $(':radio, .ship').filter(':has(:radio:checked)').addClass('shipselect').end().click(function(event)
          {
                   if (event.target.type !== 'radio')
                   {
                   $(':radio', this).trigger('click');
                   }
              $(':radio, .ship').removeClass('shipselect');
              $(this).toggleClass('shipselect');
          });


        $("#nav li a").click(function() {
        $("link").attr("href",$(this).attr('rel'));
        $.cookie("css",$(this).attr('rel'), {expires: 365, path: '/'});
        return false;
		});
      });


$(function(){
    $(".menu-item, .gal_next, .cur, .gal_prew, .highslide img, .p-img a img, #tree a, .l a img, .r a img, .anchorLink, .tb, .dli div, .imgsub, .ainfo, .logo a, .b-content a, .menu-item-cart, #nav li a img, a.img img, a.lang img, .activ img").tipTip();
});


$(function() {
   $("#tree").treeview({
      collapsed: true,
	  animated: "medium",
	  control:"#sidetreecontrol",
	  persist: "location"
   });
   $("#gal_tree").treeview({
      collapsed: true,
	  animated: "medium",
	  control:"#sidetreecontrol",
	  persist: "location"
   });
})


$(document).ready(function(){
    $('#best').bxCarousel({
	        display_num: 3,       // number of elements to be visible
	        move: 1,              // number of elements to the shift the slides
	        speed: 500,           // number in milliseconds it takes to finish slide animation
	        margin:0,             // right margin to be applied to each <li> element (in pixels, although do not include "px")
	        auto: true,          // automatically play slides without a user click
	        auto_interval: 5000,  // the amount of time in milliseconds between each auto animation
	        auto_dir: 'next',     // direction of auto slideshow (options: 'next', 'prev')
	        auto_hover: false,    // determines if the slideshow will stop when user hovers over slideshow
	        next_text: '',    // text to be used for the 'next' control
	        next_image: '',       // image to be used for the 'next' control
	        prev_text: '',    // text to be used for the 'prev' control
	        prev_image: '',       // image to be used for the 'prev' control
	        controls: true        // determines if controls will be displayed
	    });
    $('#last').bxCarousel({
	        display_num: 3,       // number of elements to be visible
	        move: 1,              // number of elements to the shift the slides
	        speed: 500,           // number in milliseconds it takes to finish slide animation
	        margin:0,             // right margin to be applied to each <li> element (in pixels, although do not include "px")
	        auto: false,          // automatically play slides without a user click
	        auto_hover: false,    // determines if the slideshow will stop when user hovers over slideshow
	        next_text: '',    // text to be used for the 'next' control
	        next_image: '',       // image to be used for the 'next' control
	        prev_text: '',    // text to be used for the 'prev' control
	        prev_image: '',       // image to be used for the 'prev' control
	        controls: true        // determines if controls will be displayed
	    });
});


$(document).ready(function(){
	$(".faqitem h3:first").addClass("active");
	$(".faqitem p:not(:first)").hide();
    $(".faqitem h3").click(function(){
		$(this).next("p").slideToggle("slow")
		.siblings("p:visible").slideUp("slow");
		$(this).toggleClass("active");
		$(this).siblings("h3").removeClass("active");
	});

});


$(document).ready(function(){

	$(".imgdelete").click(function(){
		$(this).parents(".info").animate({ opacity: 'hide' }, "slow");
        $(this).parents(".er").animate({ opacity: 'hide' }, "slow");
	});

});


$(document).ready(function(){
	$(".cartbutton").click(function(){
		$("#blockcart").slideToggle("slow");
		$(this).toggleClass("cartactive");
        return false;
	});
});


(function($) {
$(function() {
	$('div.tabs').each(function() {
		$(this).find('div.dli').each(function(i) {
			$(this).click(function(){
				$(this).addClass('curr').siblings().removeClass('curr')
					.parents('div.table').find('div.tabbox').hide().end().find('div.tabbox:eq('+i+')').fadeIn(0);
			});
		});
	});

})
})(jQuery)


$(document).ready(function() {
	anchor.init()
});
anchor = {
	init : function()  {
		$("a.anchorLink").click(function () {
			elementClick = $(this).attr("href")
			destination = $(elementClick).offset().top;
			$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, 2000 );
		  	return false;
		})
	}
}
