function validateForm(formName,formFields){
	
	if(formFields.length>0){

		var counter = 0;
		for(i = 0; i<formFields.length; i++){		
			if(document.forms[formName].elements[formFields[i]].value != ''){
			
				counter++;
				
			}		
		}
		
		if(counter == formFields.length){
		
			return true;
		
		}else{
			
			alert('Proszę wypełnić wszystkie wymagane pola.');
			return false;
		
		}
		

	
	}else{
	
		return true;
	
	}
	/*
*/

	return false;
	
}

function confirmUrl(question,url){

	if(confirm(question)){
		location.href = url;
	}

}

function checkboxMassMark(targetForm,targetCheckboxes,mainCheckbox){

	var checkboxes = document.forms[targetForm].elements;//elements['subject'];
	

	//alert(document[targetForm][targetCheckboxes]);

	//chk = document[targetForm][targetCheckboxes];
	
	//alert(chk);
	//targetCheckboxes

	if(mainCheckbox.checked==true){
		
		for (i = 0; i < checkboxes.length; i++){
			checkboxes[i].checked = true;
		}
			
	}else{
	
		for (i = 0; i < checkboxes.length; i++){
			checkboxes[i].checked = false;
		}
			
	}


}