//wykorzystano biblioteke Prototype 1.4.0
//http://prototype.conio.net/
//Polska dokumentacja: http://blog.elksoft.pl/wp-content/prototype.js.pl.html

function formCallback(result, form) {
							window.status = "valiation callback for form '" + form.id + "': result = " + result;
						}


function isNode(id) {
	if (document.getElementById(id) == null) {
		return false;
	} else {	
		return true;
	}
} 

var Page = Class.create();

Page.prototype = {

    initialize: function() {
        
        if (isNode('Reclamation')) new PageReclamationValidate;
	}
}

if (document.addEventListener && !window.opera && !(!document.all && document.childNodes && !navigator.taintEnabled)) {
    document.addEventListener("DOMContentLoaded", function() {
        new Page;
    }, false); 
} else {
	Event.observe(window, 'load', function(){ new Page; });
}

var PageReclamationValidate = Class.create();

PageReclamationValidate.prototype = {
	
	initialize: function(){
		//http://tetlaw.id.au/upload/dev/validation/index.html#standard
		//http://tetlaw.id.au/view/javascript/really-easy-field-validation
		var valid = new Validation('form-reclamation', {immediate : true, onFormValidate : formCallback,useTitles : true});
	}
}
