
Event.observe(window, 'load', function() {
	
});

scroller = function (by)
{
	sc = $('scrollers');
	isc = $('in_scroller');
	scs = $('scrollers');
	
	left = parseFloat(sc.getStyle('left'));
	max = parseFloat(scs.getStyle('width'));
	iscw = parseFloat(isc.getStyle('width'));
	do_left = left - (162 * by);
	if (do_left>0) { do_left = - max + iscw; }
	if (do_left<(-max + iscw)) { do_left = 0; }
	$('scrollers').setStyle({'left': do_left + 'px'});
}

producent = function (id)
{
	if (id>0)
	{
		new Ajax.Request(DOC_ROOT + 'ajax/producent/'+id, {
			method: 'get',
			onSuccess: function(transport) {
				$('opis').update(transport.responseText);
			},
			onCreate: function(transport) {
				$('opis').update(loading_gif);
			}
		});
		
		if ($('desc').getStyle('display') == 'none') Effect.SlideDown('desc', { duration: 0.2 });
		Effect.ScrollTo('scroller_div');
	}
	else
	{
		if ($('desc').getStyle('display') != 'none') Effect.SlideUp('desc', { duration: 0.2 });
	}
}
