function ajax(url, field, form){
	if($('loader')) $('loader').show();
	var arrForm = '';
	if( form ){
		var arrForm = Object.toJSON($(form).serialize(true));
	}
	new Ajax.Request( url,
	{
		method: 'post',
		evalScripts: true,
		parameters: { arrForm: arrForm },
		onComplete: function(transport){
			$(field).innerHTML = transport.responseText;
			if($('loader')) $('loader').hide();
			initLytebox();
		}
	}
	);
}

function form_wycena_start(){
	$$('#wycen_teraz select').each(function(e){
		if( e.name != 'intCategoryId' ){
			e.selectedIndex = 0;
		}
	});
}

window.onload = function(){
		if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
		var ieversion = new Number(RegExp.$1);
		}
		if ( ieversion < 7 )
		{
			$$('#left_menu .png').each(function(e){
				if( e.src.match('png') == 'png' ){
					new Insertion.After(e, '<div style="width: '+e.width+'px; height: '+e.height+'px; background: url('+e.src+') no-repeat !important; background: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='+e.src+', sizingMethod=scale);"></div>');
					e.remove();
				}
			})
			$$('#menu_left_ul .png').each(function(e){
				if( e.src.match('png') == 'png' ){
					new Insertion.After(e, '<div style="width: '+e.width+'px; height: '+e.height+'px; background: url('+e.src+') no-repeat !important; background: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='+e.src+', sizingMethod=scale);"></div>');
					e.remove();
				}
			})
		}
	}
