﻿function sayfaac(link,pen,w,h,rs,sc)
{
    LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition = ((screen.height) ? (screen.height-h)/2 : 0)-30;
    if(h == screen.height & w == screen.width)
    {
        TopPosition = 0;
        LeftPosition = 0;
    }
    ayarlar='toolbar=no,location=no,resizable='+rs+',scrollbars='+sc+',width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition;
    window.open(link, pen, ayarlar);    
}

function kayitsec_grid(grid_adi,kayit_no)
{
    __doPostBack(grid_adi,'Select$'+kayit_no);
}
function sirala_grid(grid_adi,alan_adi)
{
    __doPostBack(grid_adi,'Sort$'+alan_adi);
}
function AyracTemizle(str){
  float = '';
  if (str.indexOf('.') > -1){
      float = (str.substring(str.indexOf('.'),str.length))  
      str = str.substring(0,str.indexOf('.'));
  }
  var tmp = ''
  for (i = 0;i< str.length ; i++)
      if (str.charAt(i) != ',')
          tmp += str.charAt(i);

  tmp2 = tmp+float;


  while (tmp2.charAt(0) == '0') tmp2 = tmp2.substring(1,255);

  if ((tmp2.charAt(0)=='.') || (tmp2 == '') ) tmp2 = '0' + tmp2
  return tmp2;
}

function AyracEkle(num) {
    num = num.toString().replace(/\$|\,/g,'');
    if(isNaN(num))
    num = "0";
    sign = (num == (num = Math.abs(num)));
    num = Math.floor(num*100+0.50000000001);
    cents = num%100;
    num = Math.floor(num/100).toString();
    if(cents<10)
    cents = "0" + cents;
    for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
    num = num.substring(0,num.length-(4*i+3))+','+
    num.substring(num.length-(4*i+3));
    return (((sign)?'':'-') + num + '.' + cents);
}
function formKeys() 
{
    if ((event.keyCode == 13) && (event.ctrlKey) && (!form1.btnKaydet.disabled)) 
    { 
        event.returnValue = false; form1.btnKaydet.click(); return;
    }
    if (event.keyCode == 13) if (event.srcElement.type != "submit") 
        event.keyCode = 9;
}    
