function gonder(){
	jQuery.ajax({   
		type: 'POST',
		url: '/hotelRes_select.php',
		data: $('#sonuc').serialize(),   
		error:function(){ $('#icerik').html("Bir hata algılandı."); },
		success: function(veri) { $('#icerik').html(veri);$('#Rezervasyon').html('<div id="HesaplaAlani">&nbsp;</div><div id="katilimcilar" style="margin-left:3px; margin-right:3px;"></div>');}   
	});   
}
function gonder2(){
	jQuery.ajax({   
		type: 'POST',
		url: '/hotelRes_select.php',
		data: $('#sonuc2').serialize(),   
		error:function(){ $('#icerik2').html("Bir hata algılandı."); },
		success: function(veri) { $('#icerik2').html(veri);}   
	});   
}
function gonder3() {
	jQuery.ajax({   
		type: 'POST',
		url: '/oteldetay_rez.php',
		data: $('#HesaplaGonder').serialize(),    
		error:function(){ $('#HesaplaAlani').html("Bir hata algılandı."); },
		success: function(veri) {
			$('#HesaplaAlani').html(veri);$('#havaleeft').click();
			$('#rez_stp1').block({ 
            	fadeIn: 1000, 
				overlayCSS: { backgroundColor: '#fff' },
				message: 'Lütfen sağ taraftan <br />Ödeme Şekli Seçiniz'
       		}); 
			$('#step1_button').css({'background-image':'url(/images/stepsBack_active1.png)','background-repeat':'repeat-x'});
			$('#step2_button').css({'background-image':'url(/images/stepsBack_active.png)','background-repeat':'repeat-x'});
			$('#step3_button').css('background','none');
			$('#step1_button a').attr('href','javascript:sifirla(1);');
		}   
	}); 
}
function gonder5() { 
	jQuery.ajax({   
		beforeSend: function(){$('#Rezervasyon').html('<br /><br /><br /><div align="center"><img src="/images/yukleniyor.gif" /><br /><span style="font-siz:14px; color:#06c; font-weight:bold;">İsteğiniz İşleniyor.<br />Lütfen Bekleyiniz...</span></div>');},
		type: 'POST',
		url: '/hotelRes_persons.php',
		data: $('#Hesapla').serialize(),   
		error:function(){ $('#katilimcilar').html("Bir hata algılandı."); },
		success: function(veri) { 
			$('#Rezervasyon').animate({opacity: 0}, 500, function() {$(this).html('<div id="HesaplaAlani">'+veri+'&nbsp;</div>').animate({opacity:100},2000);});
			scrollWin('#Shopping');
			$('#rez_stp1').block({ 
				fadeIn: 1000, 
				overlayCSS: { backgroundColor: '#fff' },
				message: 'Lütfen sağ taraftan <br />Katılımcı bilgilerini giriniz...'
       		}); 
			$('#step2_button,#step3_button').css({'background-image':'url(/images/stepsBack_active1.png)','background-repeat':'repeat-x'});
			$('#step2_button a').attr('href','javascript:sifirla(2);');
		}   
	});   
}
function sifirla (type) {
	if (type==1) {
		$('#rez_stp1').unblock();$('#icerik').html('');
		$('#Rezervasyon').html('<div id=\"HesaplaAlani\">&nbsp;</div><div id=\"katilimcilar\" style=\"margin-left:3px; margin-right:3px;\"></div>');
		$('#step2_button,#step3_button').css('background','none');
		$('#step1_button').css({'background-image':'url(/images/stepsBack_active.png)','background-repeat':'no-repeat'});
		$('#step2_button a').attr('href','javascript:void(0);');
		void(0);
	}
	if (type==2) {
		gonder3();
		void(0);
	}
}
function kontrolEt() {
	var radio_choice = false;
	for (i = 0; i < document.getElementsByName('OdemeSecim').length; i++) {
		if (document.getElementsByName('OdemeSecim')[i].checked)
		radio_choice = true; 
	}
	if (!radio_choice)	{
		alert ('Lütfen Ödeme Şekli Seçiniz') ; 
		return (false);
	}
	gonder5();
	//scrollWin('#katilimcilar');
}
function scrollWin(div){
	$('html, body').animate({scrollTop: $(div).offset().top}, 2000);
}
function RezervasyonaGec() {$(function(){$('#Shopping a').click();});}
function totalPrice() {
    jQuery.ajax({
        beforeSend :function(){$('#totalPrice').html('');},
        type: 'POST',
	url: '/hotelRes_total.php',
	data: $('#Hesapla').serialize(),
	error:function(){ $('#totalPrice').html("Bir hata algılandı."); },
	success: function(veri) { $('#totalPrice').html(veri);}
    });
}
