var sep = ".";

function formatCurrency(inpObj) {
       inpValue = inpObj.value;
       var fromIndex = 0;
       var toIndex = 0;
       ytlVal = inpValue;
       var unformattedString = deCommafy(ytlVal) ;
       if ( unformattedString.length > 9 ) {
           unformattedString = unformattedString.substring(0,9);
       }
       if ( !isNaN( parseInt(unformattedString,10) ) ) {
           unformattedString = parseInt(unformattedString,10).toString() ;
       } else {
           inpObj.value = "";
           inpObj.focus();
           return;
       }
       inpObj.value = commafy( unformattedString );
}

function deCommafy(inpValue) {
       var re = eval("/\\" + sep + "/g") ;

       return inpValue.replace(re,"");      
}

function commafy(inpValue) {
       var re = /(\d+)(\d{3})/ ;
       while ( re.test(inpValue) ) {
           inpValue = eval("inpValue.replace(re,'$1" + sep + "$2')");
       }
       return inpValue;
}

function tckimlikkontorolu(tcno)	
{
	if (tcno.value.length!=11)	
	{
		return false;
	}
	var tckontrol,toplam; 
	tckontrol = tcno; 
	tcno = tcno.value;
	toplam = Number(tcno.substring(0,1)) + Number(tcno.substring(1,2)) + Number(tcno.substring(2,3)) + Number(tcno.substring(3,4)) + Number(tcno.substring(4,5)) + Number(tcno.substring(5,6)) + Number(tcno.substring(6,7)) + Number(tcno.substring(7,8)) + Number(tcno.substring(8,9)) + Number(tcno.substring(9,10));
	strtoplam = String(toplam); 
	onunbirlerbas = strtoplam.substring(strtoplam.length, strtoplam.length-1);
	if(onunbirlerbas == tcno.substring(10,11)) 
	{
		return true;
	}
	else	
	{
		return false; 
	}
}