function number_format(n) {
  var arr=new Array(''), i=0;
  var arr1 = n.split(",");
  var retval = '';
  var son = n.substring(n.length-1,n.length);
  if (son > '9' || son < '0') {
     if (( son == ',' && arr1.length > 2) || (son !=','))  {
     //alert('Lütfen rakam giriniz');
     return n.substring(0,n.length-1);
     }
  }
  arr1=arr1.reverse();
  if (arr1.length > 1) {
     n = arr1[1];
  }
  n=n.split(".");
  n=n.join('');
  while (n>0)
    {arr[i]=''+n%1000; n=Math.floor(n/1000); i++;}
  arr=arr.reverse();
  for (var i in arr) if (i>0) //sıfırlar için
  while (arr[i].length<3) arr[i]='0'+arr[i];
  retval = arr.join(".");
  if (arr1.length > 1) retval=retval+","+arr1[0];
  return retval;
}

function high(which2){
  theobject=which2;
  highlighting=setInterval("highlightit(theobject)",50);
}

function low(which2){
  clearInterval(highlighting);
  if(which2.style.MozOpacity)
  which2.style.MozOpacity=0.3;
  else if (which2.filters)
  which2.filters.alpha.opacity=60;
}

function highlightit(cur2){
  if (cur2.style.MozOpacity<1)
  cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)+0.1;
  else if (cur2.filters && cur2.filters.alpha.opacity<100)
  cur2.filters.alpha.opacity+=10;
  else if (window.highlighting)
  clearInterval(highlighting)
}

function sehirkontrol() {
  if (document.forms["arama"].sehir.value == "0") {
   alert("Lütfen bir şehir seçiniz.")
   return false
  }
}

function ilkontrol() {
  if (document.ekayit.sehir.value == "0") {
   alert("Lütfen bir şehir seçiniz.")
   return false
  }
  var yeni = ""
  for(i=0;i<document.ekayit.ozellik.length;i++) {
    if(document.ekayit.ozellik[i].checked){
      yeni=yeni+";"+document.ekayit.ozellik[i].value
    }
  }
  document.ekayit.ozellikler.value=yeni
}

function ilkontrol2() {
  if (document.ekayit2.sehir.value == "0") {
   alert("Lütfen bir şehir seçiniz.")
   return false
  }
}

function setPointer(theRow, thePointerColor, theNormalBgColor){
    var theCells = null;
    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }
    var rowCellsCnt  = theCells.length;
    var currentColor = null;
    var newColor     = null;
    // Opera does not return valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].setAttribute('bgcolor', newColor, 0);
        } // end for
    } else {
        currentColor = theCells[0].style.backgroundColor;
        newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].style.backgroundColor = newColor;
        }
    }
    return true;
}

function openWin( windowURL, windowName, windowFeatures ) {
  window.open( windowURL, windowName, windowFeatures ) ;
}