function mesaj_kapat() {
	$('.mesaj').hide();
}

function gonder( islem, adres ) {
	$( "#gonder-btn" ).attr( 'disabled', true );
	$.post( '/coriys/ajax/' + adres + '.php?islem=' + islem, 
		$( '#' + islem ).serialize(),
		function ( cevap ) {
			with ( cevap )
			if ( cevap.url ){
				document.location.href = cevap.url;
			}else{
				$( '.mesaj' ).show( 'normal' );
				$( '.' + cevap.konum ).html( cevap.mesaj );
				$( '#' + "gonder-btn" ).removeAttr( 'disabled' );
			}
		},
		"json"
	);
}

function gonder2( ajax, islem, tablo ) {
	$( "#gonder-btn" ).attr( 'disabled', true );
	$.post( ajax + '/ajax.php?islem=' + islem + '&tablo=' + tablo, 
		$( '#' + islem ).serialize(),
		function ( cevap ) {
			with ( cevap )
			if ( cevap.url ){
				document.location.href = cevap.url;
			}else{
				$( '.mesaj' ).show( 'normal' );
				$( '.' + cevap.konum ).html( cevap.mesaj );
				$( '#' + "gonder-btn" ).removeAttr( 'disabled' );
			}
		},
		"json"
	);
}


function dil( dil ) {
	$.post( '/coriys/ajax/proje.php?islem=dil',
		"dil=" + dil,
		function( cevap ) {
			with ( cevap )
			if ( cevap.url ){
				document.location.href = cevap.url;
			}else{
				$( '.mesaj' ).show( 'normal' );
				$( '.' + cevap.konum ).html( cevap.mesaj );
			}
		},
		"json"
	);
}

$(document).ready(
	function(){ mesaj_kapat(); }
);
