function yer_getir2(a){
	  $.get(root+"php/yergetir2.php?&lang="+sd, { local1: $('#tlocal1').val() },
	  function(data){
		$('#tlocal2').html(data); 
		$('#tlocal2').parents('.'+selectclass).unselectbox();
		$('#tlocal2').selectbox({className:selectclass});
	  });
}
function yer_getir(a){
	if (a==0){
	  $.get(root+"php/yergetir.php?islem=0&lang="+sd, { city: "1" },
	  function(data){
		$('.sinputlocal1').html(data);
		$('#local1').selectbox({className:selectclass}).bind('change', function(){
			set_select('local2', $(this).val());
		});
	  });
	  $.get(root+"php/yergetir.php?islem=0&lang="+sd, { city: "2" },
	  function(data){ 
		$('.sinputlocal2').html(data);
		$('#local2').selectbox({className:selectclass}).bind('change', function(){});
	  });
	}
	if (a==1){
	  $.get(root+"php/yergetir.php?islem=1&lang="+sd, { city1: $('#city1').val() },
	  function(data){
		$('.sinputlocal1').html(data);
		$('#local1').selectbox({className:selectclass}).bind('change', function(){
			set_select('local2', $(this).val());
		});
	  });
	}
	if (a==2){
	  $.get(root+"php/yergetir.php?islem=2&lang="+sd, { city2: $('#city2').val() },
	  function(data){
		$('.sinputlocal2').html(data);
		$('#local2').selectbox({className:selectclass});
	  });
	}
}
function set_select(id, v){
	var cbo=document.getElementById(id);
	for(var i=0; i<cbo.options.length; i++){
		if(cbo.options[i].value==v){
		cbo.selectedindex=i;
		if(!cbo.options[i].selected ){cbo.options[i].selected=true;}
		$('#'+id).parents('.'+selectclass).unselectbox();
		$('#'+id).selectbox({className:selectclass}).bind('change', function(){ if(id=='city2')yer_getir(2);});
		return;} 
	} 
}
