function scrolling(){
		$('#dynamic-banner').scrollTo("100%",50000,{'axis':'y', 'onAfter':function(){
			$('#dynamic-banner').scrollTo("0%",50000,{'axis':'y', 'onAfter':function(){
			scrolling();
		}});
		}});

}

jQuery(function($){
	var dynamic_html = $('#dynamic-banner').html();
	scrolling();
	$('#katalog-change').change(function(){
			window.location = window.location.protocol + '//' + window.location.host + window.location.pathname + "?s=katalog&id_katalog="+$(this).val();
	});
});

jQuery(function($){
	$('a.send-check').live('click',function(){
		$('#check-code').submit();
		return false;
	});
});

jQuery(function(){
	$('input[name=transport],input[name=payment]').live('change', function(){
		var name = $(this).attr('name');
		var val = $(this).val();
		$.get('index.php?'+name+'='+val,
			{ 
				's': "kosik-krok2", 
				'action': "ajax-update", 
				'note': $('textarea#note').val()
			}
			, function(data) {
			$('#ajax-repl').replaceWith(data);
		});
	});
	$('a.submit2').live('click',function(){
		var a = this;
		$.get('index.php',
			{ 
				's': "kosik-krok2", 
				'action': "ajax-update", 
				'note': $('textarea#note').val()
			}
			, function(data) {
			window.location = $(a).attr('href');
		});
		return false;
	});
	$('input[name=exist-user]').change(function(){
		if($(this).val()=='is'){
			$('.exist-user').show();
			$('.exist-user-label').hide();
			$('.no-exist-user-label').show();
			$('.no-exist-user').hide();
		}
		
		if($(this).val()=='isnt'){
			$('.exist-user').hide();
			$('.exist-user-label').show();
			$('.no-exist-user-label').hide();
			$('.no-exist-user').show();
		}
	});
		
});

jQuery(function($){
	if($('#frmcustomer-dod_info').attr('checked')=='checked') $('#dod-info').show();
	
	$('#frmcustomer-dod_info').change(function(){
		if($(this).attr('checked')=='checked'){
			$('#dod-info').show();
		} else {
			$('#dod-info').hide();
		}
	});
});

jQuery(function($){
	$('input.pr_price').live('change', function(){
		var id = $(this).attr('data-id');
		var val = $(this).val();
		var code = $('input[name=code]').val();
		$.get('index.php',
			{ 's': "kosik", 
				'action': "ajax-update", 
				'id':id,
				'pocet':val
			}, function(data) {
			$('#ajax-repl').replaceWith(data);
			$('input[name=code]').val(code);
		});
	});
});

//menu
jQuery(function($){
	$('.mainmenu ul li ul').css('visibility','visible');
	$('.mainmenu ul li ul').hide();
	$('.mainmenu ul li').hover(function(){
			$(this).find('ul').fadeIn(100);
		},function(){
			$(this).find('ul').fadeOut(200);
		});
 });

