
$(document).ready(function() { 
	var wizard = $("#wizard").accordion({header: '.title',event: true,autoheight: false});		
	var wizardButtons = $([]);
	$("div.title", wizard).each(function(index) {wizardButtons = wizardButtons.add($(this).next().children('center').children('div').children(':button').filter(".next, .previous").click(function(){wizard.accordion("activate", index + ($(this).is(".next") ? 1 : -1))}));});
	var accordions = jQuery('#wizard');
	var options = {target:'#fc',beforeSubmit:showRequest,success:showResponse,url: 'form_checking.asp',type: 'post'}; 
	$('#sipform').ajaxForm(options); 
	var aid = $('[name=adt]').fieldValue();
	ah(aid);
	$('#adres').keyup(function(){limitChars('adres', 125, 'adres_ci');$("#adres_ci").css("display", "none");});
$("div#ajax_loading").ajaxStart(function(){$(this).html('<img src=images/ajax_loading.gif>');});
$("div#ajax_loading").ajaxSuccess(function(){$(this).html('&nbsp;');});
}); 
function ac(x){jQuery('#wizard').activate(x);}
function odm(){
		var aid = $('[name=adt]').fieldValue();
		var odm1 = $('[name=odeme]').fieldValue();
		var ilce = $('[name=u_ilce]').fieldValue();
		var st = $('[name=s]').fieldValue();
		$('div#stamam').html('<p><img src=images/loader.gif></p>');
		divl('stamam');
		$.ajax({type: 'GET',url: ''+odm1+'.asp',data: 's='+st+'&adt='+aid+'&ilce='+ilce,success: function(ajaxCevap){$('div#stamam').html(ajaxCevap);toplam();}});
}
function divl(div){
$('div#'+div).html('<p><img src=images/loader.gif></p>');
}
function tkst(kid){
	var adt = $('[name=adt]').fieldValue();
	var st = $('[name=s]').fieldValue();
	divl('taksit_div');
	$.ajax({type: 'GET',url: 'taksit_secenekleri.asp',	data: 'kid='+kid+'&s='+st+'&sadt='+adt,success: function(ajaxCevap){$('div#taksit_div').html(ajaxCevap);}});
}
function toplam(){
		var aid = $('[name=adt]').fieldValue();
		var tid = $('[name=taksit]').fieldValue();
		var odm = $('[name=odeme]').fieldValue();
		var ilce = $('[name=u_ilce]').fieldValue();
		var s = $('[name=s]').fieldValue();
		divl('toplam');
		$.ajax({type: 'GET',url: 'toplam.asp',data: 'aid='+aid+'&tid='+tid+'&odm='+odm+'&ilce='+ilce+'&s='+s,success: function(ajaxCevap){$('div#toplam').html(ajaxCevap);}});
}
function ilcelerigetir(){
var ui=document.sipform.u_ilce;
var us=document.sipform.u_sehir_.options[document.sipform.u_sehir_.options.selectedIndex].value;
var ust=document.sipform.u_sehir_.options[document.sipform.u_sehir_.options.selectedIndex].text;
var target=document.sipform.u_sehir
ChangeTown(ui,us,'',ust,target);
}
function showRequest(formData, jqForm, options) {var queryString = $.param(formData);return true;}  
function showResponse(responseText, statusText)  {} 
function fcheck(x){
	if(x==1){var mail = $('[name=mail]').fieldValue();	if( mail == "" ) {$("#ep1").css("display", "none"); $("#ep2").css("display", "none");}else{$("#ep1").css("display", ""); $("#ep2").css("display", ""); }}
	document.getElementById("adim").value=x;$("#sipform").trigger("submit");
}
function btnd(b,tf){b.disabled = tf;}
function ah(id){divl('adet_hediye');$.ajax({type: 'GET',url: 'hediye.asp',data: 'aid='+id,success: function(ajaxCevap){$('div#adet_hediye').html(ajaxCevap);}});}
function hdiv(g){if(g==0){$('#fc').fadeOut('fast');}else{$("#fc").css("display", "none");setTimeout("$('#fc').fadeIn('slow');",1000);setTimeout("$('#fc').fadeOut('slow');",6000);};}
function iekontrol(url) {var v2 = navigator.appVersion.substring(22,25);if ( navigator.appName.indexOf("Explorer")!= -1 ) {if ( v2=="5.5"||v2=="6.0") {window.location.href=url;}}}
