function checbkox_nice(){
	$('input:checkbox').each( function(){
							var $input = $(this).addClass('jNiceHidden').wrap('<span class="jNiceWrapper"></span>');
							var $wrapper = $input.parent().append('<span class="jNiceCheckbox"></span>');
							/* Click Handler */
							var $a = $wrapper.find('.jNiceCheckbox').click(function(){
									var $a = $(this);
									var input = $a.siblings('input')[0];
									if (input.checked===true){
										input.checked = false;
										$a.removeClass('jNiceChecked');
									}
									else {
										input.checked = true;
										$a.addClass('jNiceChecked');
									}
									return false;
							});
							$input.click(function(){
								if(this.checked){ $a.addClass('jNiceChecked'); 	}
								else { $a.removeClass('jNiceChecked'); }
							}).focus(function(){ $a.addClass('jNiceFocus'); }).blur(function(){ $a.removeClass('jNiceFocus'); });
							
							/* set the default state */
							if (this.checked){$('.jNiceCheckbox', $wrapper).addClass('jNiceChecked');}
					}						
	);
}

function add_frame(elem_name,margin_top_bootom,margin_left_right,img_border,float_dir,add_class){			
	/*
		var margin_top_bootom = 10;
		var margin_left_right = 10;
		var img_border = 1;
		var float_dir = 'right';
	*/
	//wysokosc stopki konczonczej ramke					
	var footer_height = 2;	
	$(elem_name).each(function(){
		//szerokosc obrazka + 2ximg_border
		var w_iner = $(this).width() + 2*img_border;
		var w_outer = w_iner+2*margin_left_right;
		var h_iner = $(this).height() + 2*img_border;
		var h_outer = h_iner+2*margin_top_bootom+footer_height;
		var x = (h_iner+2*margin_top_bootom);
		$(this).wrap(''+
				'<div class="frame_class_contener '+add_class+'" style="float:'+float_dir+';width:'+w_outer+'px; height:'+h_outer+'px;">'+
					'<div class="frame_class" style="height:'+x+'px;">'+
						'<div style="z-index:50;position:absolute; width:'+w_iner+'px; height:'+h_iner+'px;left:'+margin_left_right+'px;margin-bottom:'+margin_top_bootom+'px;top:'+margin_top_bootom+'px;"></div>'+
					'</div>'+
					'<div class="bottom_bg2" style="width:'+w_outer+'px;"></div>'+
					'<div class="bottom_left" ></div>'+
					'<div class="bottom_right"></div>'+
				'</div>');
	}); 
}
/* menu */
var keep_visible = false;
var li_hilighted = "#FF6600";
var li_not_hilighted = "#2c2c2c";
var li_hilighted_text = "#000000";
var li_not_hilighted_text = "#AAA";
//zdazenie na rozwijanie menu
var t;
var t2;

function init_menu(){
	$("ul.main_menu a").mouseover(function(){
		var obj_jq = this;
		//wygaszam wszystko co jest na tym samym poziomie
		clearTimeout(t);
		t = setTimeout(function() {over_element(obj_jq);}, 250);
	});
	$("a.selected_link + ul").fadeIn(600);
	$("div#logo").mouseover(function(){
		$("#logo2",this).fadeIn(600);

	});				
	$("#logo2").mouseout(function(){
		$(this).fadeOut(600);
	});	

}

function over_element(obj_jq){
	t2 = setTimeout(function() {reset_menu(obj_jq);}, 10);
	//wyswietlam nowe
	$(obj_jq).css('color','white');
	$(obj_jq).css('background-color', li_hilighted);
	$(obj_jq).animate(	{ color: li_hilighted_text
						},300);	
	//rozwijam podmenu
	$("a",$(obj_jq).next("ul")).css('background-color',li_not_hilighted);
	$("a",$(obj_jq).next("ul")).css('color',li_not_hilighted_text);
	$(obj_jq).next("ul").fadeIn(300);

	
}
function reset_menu(obj_jq){
	//resetuje ustawienia menu dla wybranego poziomu
	var $obj = $(obj_jq).parent("li").siblings().children("a");
	$obj.stop();
	$obj.css('background-color',li_not_hilighted);
	$obj.css('color',li_not_hilighted_text);
	$obj.next("ul").hide();
}
