$(document).ready(function(){
	/* placeholder */
	//$("input.placeholder").placeholder();

	/* navigation */
	$(".navigation li").hover(
		function(){
			var ul = $(this).find('ul:first'); // {current}
				ul.css('display', 'block');
				ul.prev().addClass('selected'); // a before {current} now is selected
				ul.find('ul').css('display', 'none'); // all ul tags after {current} now became invisible
		},
		function(){
			var ul = $(this).find('ul'); // {current}
				ul.prev().removeClass('selected'); // a before {current} now is deselected
				ul.css('display', 'none'); // {current} now is invisible
		}
	);

	/* products */
	$("a.picture").hover(
		function(){$(this).parent().find('a.description').addClass('hover');},
		function(){$(this).parent().find('a.description').removeClass('hover');}
	);

	/* cart button */
	var button = $("#recount");
	button.attr('disabled', 'disabled'); /* jQuery bug in IE6 */
	$(".cart select").change(function(){
		button.removeAttr('disabled');
	});

	$('input[name=delivery]').click(function(){
		if($(this).val() == 'kurjers') {
			$('fieldset.delivery input').attr('required','required').each(function(){
				$(this).attr('placeholder', $(this).attr('placeholder') + ' *' );
			});
		}
		else
			$('fieldset.delivery input').removeAttr('required').each(function(){
				$(this).attr('placeholder', $(this).attr('placeholder').replace(' *', '') );
			});
		makeform();
	});
});
