function send_reserv()
{
	var d = $("#Qdate").val();
	var q = $("#Qquan").val();
	var t = $("#Qtype").val();
	var c = $("#Qcontent").val();
	var p = $("#Qphone").val();
	var e = $("#Qemail").val();
	
	var qs = $("#sending");
	qs.show(); 
	
	$.ajax({
		type : "POST", 
		url  : "formularze/form_reserve/sender.php",
		data : "d="+d+"&q="+q+"&t="+t+"&c="+c+"&p="+p+"&e="+e,
		success : function(data)
		{
			$("#reserve-form fieldset").addClass("hidden");
			$("#Qsend").hide();
			$(qs).find(".qo").html("Wiadomość wysłana!");
				qs.click(function(){qs.hide();$("#reserve-form fieldset").removeClass("hidden"); 
				$("#reserve-form input, #reserve-form textarea").val("");
				$("#Qsend").show();
			});
		}, 
		error : function()
		{
			alert("Nie można wysłać wiadomości, błąd krytyczny.");
		}
	});
	
	return false;
}

function send_query()
{
	var n = $("#Qn").val();
	var e = $("#Qe").val();
	var p = $("#Qp").val();
	var c = $("#Qc").val();
	
	var qs = $("#sending-cont");
	qs.show(); 
	
	$.ajax({
		type : "POST", 
		url  : "formularze/form_query/sender.php",
		data : "n="+n+"&e="+e+"&p="+p+"&c="+c,
		success : function(data)
		{
			$("#valid-form fieldset").fadeOut();	
			$(qs).find(".qo").html("Wiadomość wysłana!");
			qs.click(function(){qs.hide();$("#valid-form fieldset").fadeIn(); 
				$("#Qn").val("Imię i Nazwisko");
				$("#Qe").val("Adres e-mail");
				$("#Qp").val("Numer telefonu");
				$("#Qc").val("Treść wiadomości");
			});
		}, 
		error : function()
		{
			alert("Nie można wysłać wiadomości, błąd krytyczny.");
		}
	});
	
	return false;
}



function Potwierdz() {
	var jest_potw = confirm('Na pewno chcesz usunąć ?');
	return jest_potw;
};
function menu(id) {
  if (document.getElementById(id).style.display=="none") {
    document.getElementById(id).style.display="inline";
  } else {
    document.getElementById(id).style.display="none";
  }
}

function okno(url, width, height) {
        var win = window.open(url,"okienko",'width=' + width + ',height=' + height + ',resizable=yes,scrollbars=yes,menubar=no' );
}

function clearbox(ob){
	var tekst = jQuery("#"+ob).val();
	jQuery("#"+ob).focus(function(){
		if(this.value == tekst) this.value = '';
	});

	jQuery("#"+ob).blur(function(){
		if(this.value == '') this.value = tekst;
	});
}

function FontSize(size, wyb) {
	$("#content-x *").css("font-size",  size + "px");
	document.getElementById(wyb).style.color = "#575757";	
}

function FontSizeF(size, wyb) {
	document.getElementById("zawartosc").style.fontSize = size;	
	document.getElementById("size1").style.color = "#c3c3c3";
	document.getElementById("size2").style.color = "#c3c3c3";
	document.getElementById("size3").style.color = "#c3c3c3";
	document.getElementById(wyb).style.color = "#575757";	
}

jQuery(function($){
	$.datepicker.regional['pl'] = {
		closeText: 'Zamknij',
		prevText: '&#x3c;Poprzedni',
		nextText: 'Następny&#x3e;',
		currentText: 'Dziś',
		monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec',
		'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'],
		monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze',
		'Lip','Sie','Wrz','Pa','Lis','Gru'],
		dayNames: ['Niedziela','Poniedziałek','Wtorek','Środa','Czwartek','Piątek','Sobota'],
		dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'],
		dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'],
		weekHeader: 'Tydz',
		dateFormat: 'dd.mm.yy',
		firstDay: 1,
		isRTL: false,
		showMonthAfterYear: false,
		yearSuffix: ''};
	$.datepicker.setDefaults($.datepicker.regional['pl']);
});
