
function ToggleAccountRowsVisibility(check) {
	if (check.checked) {
		document.getElementById('loginRow').style.display = '';
		document.getElementById('passwdRow').style.display = '';
		document.getElementById('passwd2Row').style.display = '';
	}
	else {
		document.getElementById('loginRow').style.display = 'none';
		document.getElementById('passwdRow').style.display = 'none';
		document.getElementById('passwd2Row').style.display = 'none';
	}
}

function ToggleCommentFormVisibility(zwin, rozwin, zawszeRozwijaj) {
	rozwiniete = document.getElementById('formularzContainer').style.display;
	if (rozwiniete == 'block' && zawszeRozwijaj == 0) {
		document.getElementById('formularzContainer').style.display = 'none';
		document.getElementById('formularzZwinRozwin').innerHTML = rozwin;
	}
	else {
		document.getElementById('formularzContainer').style.display = 'block';
		document.getElementById('formularzZwinRozwin').innerHTML = zwin;
	}
}

function ToggleCompanyRowsVisibility(pokaz) {
	if (pokaz) {
		document.getElementById('firmaRow').style.display = '';
		document.getElementById('nipRow').style.display = '';
	}
	else {
		document.getElementById('firmaRow').style.display = 'none';
		document.getElementById('nipRow').style.display = 'none';
	}
}
	function print_today() {
	  var now = new Date();
	  var months = new Array('01','02','03','04','05','06','07','08','09','10','11','12');
	  var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
	  function fourdigits(number) {
	    return (number < 1000) ? number + 1900 : number;
	  }
	  var today =  (fourdigits(now.getYear()) + "-" + months[now.getMonth()] + "-" +date);
	  return today;
	}
	
	function get_weekend()
	{
		var date=new Date();var day=date.getDay();if(day==0){day=7;}
		var diff_start=day<5?5-day:0;var diff_end=7-day;var week_start=get_polish_date(date.getFullYear(),date.getMonth()+1,date.getDate()+diff_start);var week_end=(diff_end>0)?get_polish_date(date.getFullYear(),date.getMonth()+1,date.getDate()+diff_end):week_start;return[week_start,week_end];}
		var included_files=null;function init_included_files(){if(included_files===null){included_files=new Array();var script_nodes=document.getElementsByTagName('script');var base_name='';for(var i=0;i<script_nodes.length;i++){if(script_nodes[i].src!='uundefined'&&script_nodes[i].src!=''){base_name=script_nodes[i].src.match(/\/_js\/[a-z0-9\._]+/);if(base_name){included_files.push(base_name);}}}}}
		function include_once(script,callback){if(included_files===null){init_included_files();}
		if(script&&included_files.indexOf(script)==-1){included_files.push(script);include_dom(script,callback);}}
		function include_dom(script,callback){var node;var type=script.substring(script.lastIndexOf('.')+1);script+=(script.lastIndexOf('?')==-1?'?':'&')+'rand='+Math.random();switch(type){case'css':node=document.createElement('link');node.rel='stylesheet';node.type='text/css';node.href=script;break;default:node=document.createElement('script');node.language='javascript';node.type='text/javascript';node.src=script;}
		var head=document.getElementsByTagName('head').item(0);head.appendChild(node);if(typeof callback=='function'){node.onload=function(){eval(callback);}}
		return false;}
		if(typeof Array.prototype.indexOf!='function'){Array.prototype.indexOf=function(value){for(var i=0;i<this.length;i++){if(this[i]==value){return i;}}
		return-1;}
	}
	
	function get_polish_date(year,month,day)
	{
		var date=new Date(year,month-1,day,23,59,59,999);var day=date.getDate();if(day<10){day='0'+day;}
		var month=date.getMonth()+1;if(month<10){month='0'+month;}
		var polish_date=date.getFullYear() + '-'+month+'-'+day;return polish_date;
	}
