// ---------------------------------------------------------------- funkcje JavaScritp wykorzystywane w calym systemie

function print_div(div_id,title,css_files){
    var print_window = window.open('','print_manager','width='+$("#"+div_id).outerWidth(true)+',height=600');
	if($.browser.mozilla || $.browser.opera){
//		var html = '<html><head><title>'+title+'</title>'+css_files+'<script type="text/javascript" src="lib_js/jquery-1.6.min.js"></script></head><body><div id="printable_version">' + $('<div />').append($('#'+div_id).clone(false,false)).html() + '</div><script type="text/javascript"> $(function(){ $("script").remove(); $(".no_print").remove(); window.print(); });</script></body></html>';
		var html = '<html><head><title>'+title+'</title>'+css_files+'<script type="text/javascript" src="lib_js/jquery-1.6.min.js"></script></head><body><div id="printable_version">' + $('<div />').append($('#'+div_id).clone(false,false)).html() + '</div><script type="text/javascript"> $(function(){ $(".no_print").remove(); window.print(); });</script></body></html>';
	}
    else {
		var html = '<html><head><title>'+title+'</title>'+css_files+'<script type="text/javascript" src="lib_js/jquery-1.6.min.js"></script></head><body><div id="printable_version">' + $('<div />').append($('#'+div_id).clone(false,false)).html() + '</div></body></html>';
	}
    print_window.document.open();
    print_window.document.write(html);
    print_window.document.close();
	if(!$.browser.mozilla && !$.browser.opera){
		//print_window.jQuery("script").remove();
		print_window.jQuery(".no_print").remove();
		print_window.window.print();
	}
}


function confirmation(text,location) {
 var answer = confirm(text);
 if (answer){ window.location = location; }
}

function confirmation2(text,formid,location) {
 var answer = confirm(text);
 if (answer){
  if(location!='')document.getElementById(formid).action = location;
  document.getElementById(formid).submit();
 }
}

function show_hide(id)
{
  if(document.getElementById(id).style.display == "none")document.getElementById(id).style.display = "block";
  else document.getElementById(id).style.display = "none";
}

function show_element(id){
	document.getElementById(id).style.display = "block";
}

function hide_element(id){
	document.getElementById(id).style.display = "none";
}

function enable(id)
{
  document.getElementById(id).disabled = false;
}

function disable(id)
{
  document.getElementById(id).disabled = true;
}



