jQuery(document).ready(function(){

	// SHADOWBOX
	Shadowbox.init({players: ['img', 'html', 'iframe', 'qt', 'wmp', 'swf', 'flv']});

	// News Ticker
	if ($("#news li").size() > 1) {

		$("#news").newsTicker(4000);

	}

	// PAGEBLOCK IMAGES
	$("ul.img_list li").mouseenter(function (){

		$(".img_big").css("display", "none");
		$("#big_" + $(this).attr("id") ).css("display", "block");

	});

	$("ul.img_list li").mouseleave(function (){

		$(".img_big").css("display", "none");
		$("#big_nr_1").css("display", "block");

	});

	// HOME SLIDER
	$(".carousel").jCarouselLite({
		btnNext: ".next",
 		btnPrev: ".prev",
 		auto: 3000,
        speed: 1500,
        visible: 1
 	});

	// MENU HEADER
	$("ul#menu_header li").mouseenter(function (){

		$(".submenu", this).css("display", "block");

	});

	$("ul#menu_header li").mouseleave(function (){

		$(".submenu", this).css("display", "none");

	});


	$(".small_img").click(function (){

		$(".big_images").css("display", "none");
		$("#big_image_" + $(this).attr("id")).css("display", "block");

		$(".small_img").removeClass("active");
		$(this).addClass("active");

		$(".product_sales").css("display", "none");
		$(".product_sales_price").css("display", "none");
		$("#product_sale_" + $(this).attr("id")).css("display", "block");
		$("#product_sale_price_" + $(this).attr("id")).css("display", "block");

	});

	//jFav
	$('#bookmark').jFav();

	/*
	// Home page fade
	$('#home_fade').cycle({
		fx: 'fade',
		timeout: 2000
	});

	// Home items fade
	$('.home_item_slider').cycle({
		fx: 'fade',
		timeout: 2000
	});*/

	// Mouse over
	$('div.overview-image-con').mouseenter(function () {

		// Add the selected class
		$('.title a', $(this).parent()).addClass('selected');

	}).mouseleave(function () {

		// Remove selected class
		$('.title a', $(this).parent()).removeClass('selected');
	});

	/*// Menu top mouseenter and leave
	$("ul#menu_top li").mouseenter(function(){

		$("a.level_1", this).css("color", "#ed1c24");
		$("ul.submenu", this).css("display", "block");

	}).mouseleave(function(){

		$("a.level_1", this).css("color", "#fff");
		$("ul.submenu", this).css("display", "none");

	});*/


	if ($('#prev_y').is(':checked')){ $('.date_prev_service').css('display' , 'block'); }
	if ($('#prev_n').is(':checked')){ $('.date_prev_service').css('display' , 'none'); }

	// Service form
	$('#prev_y').click(function () {
		if ($(this).is(':checked')){
			$('.date_prev_service').css('display' , 'block');
		}
	});

	$('#prev_n').click(function () {
		if ($(this).is(':checked')){
			$('.date_prev_service').css('display' , 'none');
		}
	});

});

