window.addEvent('domready', function(){
	
	if ($('form_name')) $('form_name').addEvent('click', function(event){
		if ($('form_name').get('value')=='Nazwisko, Imię:')
			$('form_name').set('value', '');
	});
	
	if ($('form_email')) $('form_email').addEvent('click', function(event){
		if ($('form_email').get('value')=='E-mail:')
			$('form_email').set('value', '');
	});
	
	if ($('form_phone')) $('form_phone').addEvent('click', function(event){
		if ($('form_phone').get('value')=='Telefon:')
			$('form_phone').set('value', '');
	});
	
	if ($('form_search')) $('form_search').addEvent('click', function(event){
		if ($('form_search').get('value')=='Szukaj:')
			$('form_search').set('value', '');
	});
	
	if ($('form_contact')) $('form_contact').addEvent('submit', function(e) {
		//Prevents the default submit event from loading a new page.
		e.stop();
		
		//Set the options of the form's Request handler. 
		//("this" refers to the $('myForm') element).
		this.set('send', {onComplete: function(response) { 
			$('log').set('html', response);
		}});
		//Send the form.
		this.send();
	});
});
