function isaretle(ceki){
	cekedilecek=document.getElementById(ceki);
	cekedilecek.checked=true;
}

function onayla(mesaj,url){
	var text = mesaj;
	var page = url;
	var answer = confirm(mesaj)
	if (answer){ window.location = page;	}
	else{ return; }
	}

function metinsayaci(nere, kackaldiya, zirve) {
	var ojelikiz = nere;
	maskesiz = ojelikiz.value.length;	
	
if (ojelikiz.value.length > zirve) 
ojelikiz.value = ojelikiz.value.substring(0, zirve);
else 
kackaldiya.value = zirve - ojelikiz.value.length;
}

function resimyukle(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,resizable=0,width=650,height=450');");
}

function buyukresimyukle(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=750,height=680');");
}

function onaykontrol()
{
var agree=confirm("Bu islemi gerceklestirmek istediginizden emin misiniz?");
if (agree)
	return true ;
else
	return false ;
}

function onayla(mesaj,url){
	var text = mesaj;
	var page = url;
	var answer = confirm(mesaj)
	if (answer){ window.location = page;	}
	else{ return; }
	}

function aramakontrol() {     
//ileride bunu variabile ile yapip türkçelestirebiliriz yada ingilizcelestirebiliriz.
if  (document.arama.mahalle.value=="-1")     {
   alert("Lutfen semti secmeyi ihmal etmeyin");
   return false;
   }
}


function yerelsaat(nereye){
      var curDateTime = new Date()

  var saat = curDateTime.getTimezoneOffset();
saatyazilacakyer = document.getElementById(nereye);
saatyazilacakyer.value=saat;
  }



function changeDisplay( elementId, setTo ) {
   var theElement;
  if( document.getElementById ) {
    //DOM
    theElement = document.getElementById( elementId );
  } else if( document.all ) {
    //Proprietary DOM
    theElement = document.all[ elementId ];
  }
  if( !theElement ) {
    /* The page has not loaded, or the browser claims to
    support document.getElementById or document.all but
    cannot actually use either */
    return;
  }
  //Reference the style ...
  if( theElement.style ) { theElement = theElement.style; }
  if( typeof( theElement.display ) == 'undefined' ) {
    //The browser does not allow us to change the display style
    //Alert something sensible (not what I have here ...)
    window.alert( 'Your browser does not support this' );
    return;
  }
  //Change the display style
  theElement.display = setTo;
}

// Get base url
url = document.location.href;
xend = url.lastIndexOf("/") + 1;
var base_url = url.substring(0, xend);

function gethandle (url,tip,degisken,hedef,prosedur) {
        // Does URL begin with http?
		//prosedur - donustipi olacak
		//hedef - yazilacak katman
		//url - adres
		//tip - data adi
        if (url.substring(0, 4) != 'http') {
                url = base_url + url + "?" + tip + "=" + degisken + "&hedef=" + hedef + "&prosedur=" + prosedur ;
        }

        // Create new JS element
        var jsel = document.createElement('SCRIPT');
        jsel.type = 'text/javascript';
        jsel.src = url;

        // Append JS element (therefore executing the 'AJAX' call)
        document.body.appendChild (jsel);
}
function gethandle2 (url,tip,degisken,tip2,degisken2) {
        // Does URL begin with http?
        if (url.substring(0, 4) != 'http') {
                url = base_url + url + "?" + tip + "=" + degisken + '&' + tip2 + "=" + degisken2;
        }

        // Create new JS element
        var jsel = document.createElement('SCRIPT');
        jsel.type = 'text/javascript';
        jsel.src = url;
//turnonfordebug		alert(url); 
        // Append JS element (therefore executing the 'AJAX' call)
        document.body.appendChild (jsel);
}

function flowrate(url,TALK_ID,TALK_SIRA,NEW_RATING) {
        // Does URL begin with http?
		//prosedur - donustipi olacak
		//hedef - yazilacak katman
		//url - adres
		//tip - data adi
        if (url.substring(0, 4) != 'http') {
                url = base_url + url + "?TALK_ID" + "=" + TALK_ID + "&TALK_SIRA=" + TALK_SIRA + "&NEW_RATING=" + NEW_RATING ;
        }

        // Create new JS element
        var jsel = document.createElement('SCRIPT');
        jsel.type = 'text/javascript';
        jsel.src = url;

        // Append JS element (therefore executing the 'AJAX' call)
        document.body.appendChild (jsel);
}
