

//update display of the large image
function displayImage(domAAroundImgThumb)
{
	if (!domAAroundImgThumb.hasClass('shown'))
	{
		var newSrc = domAAroundImgThumb.attr('href');
		$('#bigpic').fadeOut('fast', function(){
			$(this).attr('src', newSrc);
			$(this).fadeIn('fast');
		});
		$('#small_images li a').removeClass('shown');

		$('div#big a').attr("href", newSrc);

		$(domAAroundImgThumb).addClass('shown');
	}
}


/*function mainmenu(){
$(" #nav ul ").css({display: "none"}); // Opera Fix
$(" #nav li").hover(function(){
$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(400);
},function(){
$(this).find('ul:first').css({visibility: "hidden"});
});
}*/



$(document).ready(function(){

	// Your code here
	$("a#purchase").click(function(event){
		event.preventDefault();
		$("div#purchase_now").show('slow');
	});

	// skryvanie chybovej hlasky
	$("div.error").click(function(){
		$(this).hide('slow');
	});
	
	// tabulka farieb a velkosti td hover
	$("table#variants td.center").mouseover(function(){
		$(this).addClass("hover");
	}).mouseout(function(){
		$(this).removeClass("hover");
	}).click(function(){
		$(this).children("input").attr("checked","checked");
	});


	//mainmenu();

	$('#small_images li a').hover(
	function(){displayImage($(this));},
	function(){}
	);

	$('a.lightbox').lightBox();

	$('a, input, label, button, td').tooltip({ delay: 100, showURL: false, opacity: 0.65, track: true });

	$("div.fm a").mouseover(function(){
		$(this).next("div.fmi").show();
	}).mouseout(function(){
		$(this).next("div.fmi").hide();
	});

	$("div.fmi").mouseover(function(){
		$(this).show();
	}).mouseout(function(){
		$(this).hide();
	});

	//$("div.image a").dropShadow();

	///$("div.image a img").wrap("<div class='wrap1'><div class='wrap2'>" + "<div class='wrap3'></div></div></div>");


	//$('ul#navig li').biggerlink();

	if ($("input#shipping_same").attr("checked")) {

		$("fieldset#shipping").hide();
	}


	$("input#shipping_same").change(function(){

		if ($(this).attr("checked")) {

			$("fieldset#shipping").hide();
		}
		else {
			$("fieldset#shipping").show();
		}

	});




});
