function $ID(id) {
	return document.getElementById(id);
}

function go(url){
	window.location = url;
}

function goNew(url){
	window.open(url);
}

function slide(that, t, o, jsp){
	if(!o) return false;
	var _jsp = jsp || false;
	if($ID(t.replace(/#/,''))){
		$(that).addClass('bold').parents('ul').find('>li>a').not(that).removeClass('bold');
		$(o).hide();
		$(t).show();
		if(_jsp !== true){
			$(_jsp).jScrollPane({
				verticalDragMaxHeight: 13,
				showArrows: false
			});
		}
		// Zmień obrazek jeśli przypisano
		var t_img = t+'_img';
		if($ID(t_img.replace(/#/,''))){
			$(t_img).show().siblings().hide();
		}
	}
	return false;
}

function _clear_form(f){
	f.find('.input,.textarea').val('');
}

function _display_message(f, t, txt, c){
	if(t.length>0){
		c = parseInt(c);
		t.css({
			'height': t.parents('div').height(),
			'width': t.parents('div').width()
		}).removeClass('error success info').addClass( ( c < 0 ? 'error' : ( c > 0 ? 'success' : 'info' ) ) ).html('<div>'+txt+'</div>').show();
		f.hide();
		
		setTimeout(function(){t.hide();f.show();}, 5000);		
	}
}

function _update_bg(bg, bg_img){
	bg_img.css('width', $(this).width());
	bg.css('width', $(this).width());
}

function isOldIe(){
	return (/MSIE 6|7/i.test(navigator.userAgent));
}
