jQuery.fn.defaultValue=function(b){

	return this.each(function(){
		if(this.type!="text"&&this.type!="password"&&this.type!="textarea"){
			return;
		}
		
		var a=this;
		if(this.value==""||this.value==b){
			this.value=b;
		}
		else{
			return;
		}
		$(this).unbind("focus").bind("focus",function(){
			if(this.value==b||this.value==""){
				this.value="";
			}
		}).unbind("blur").bind("blur",function(){
			if(this.value==b||this.value==""){
				this.value=b;
			}
		});
		$(this).parents("form").each(function(){
			$(this).submit(function(){
				if(a.value==b){
					a.value="";
				}
			});
		});
	});
};

var text = {
	start: function() {
		$('#contact_content').find('.text').each(function(i, e) {
			$(e).defaultValue('Twój adres e-mail');
		});
	}	
}
var textarea = {
	start: function() {
		$('#contact_content').find('textarea').each(function(i, e) {
			$(e).defaultValue('Treść Twojej wiadomości');
		});
	}
}
$().ready(function() {
	text.start();
	textarea.start();
});

function generateSudoku()
{
	jQuery(function($)//wywolanie funkcji php poprzez ajax (z parametrem type)
	{
		$.ajax({async: false});
		$.post("ajax/ajax.php", { type: 'generateSudoku' }, function(data){
			$("#sudokuResults").html(data);//wyswietlenie rezultatu funkcji na ekranie
		});
	});
	return true;
}
