/*** powered by saho
anka bilişim teknolojileri ***/
// {{{ sleep
function sleep(seconds) {
	// Delay execution
	//
	// +    discuss at: http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_sleep/
	// +       version: 901.2514
	// +   original by: Christian Doebler
	// +   bugfixed by: Brett Zamir
	// %          note: For study purposes. Current implementation could lock up the user's browser.
	// %          note: Consider using setTimeout() instead.
	// *     example 1: sleep(1);
	// *     returns 1: 0

	var start = new Date().getTime();
	while (new Date() < start + seconds*1000);
	return 0;
}// }}}
function time() {
	// Return current Unix timestamp
	//
	// +    discuss at: http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_time/
	// +       version: 809.522
	// +   original by: GeekFG (http://geekfg.blogspot.com)
	// +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	// +   improved by: metjay
	// *     example 1: timeStamp = time();
	// *     results 1: timeStamp > 1000000000 && timeStamp < 2000000000

	return Math.round(new Date().getTime()/1000);
}// }}}

// {{{ array_map
function str_replace(search, replace, subject) {
	// http://kevin.vanzonneveld.net
	// +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	// +   improved by: Gabriel Paderni
	// +   improved by: Philip Peterson
	// +   improved by: Simon Willison (http://simonwillison.net)
	// +    revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
	// +   bugfixed by: Anton Ongson
	// +      input by: Onno Marsman
	// +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	// +    tweaked by: Onno Marsman
	// *     example 1: str_replace(' ', '.', 'Kevin van Zonneveld');
	// *     returns 1: 'Kevin.van.Zonneveld'
	// *     example 2: str_replace(['{name}', 'l'], ['hello', 'm'], '{name}, lars');
	// *     returns 2: 'hemmo, mars'

	var f = search, r = replace, s = subject;
	var ra = r instanceof Array, sa = s instanceof Array, f = [].concat(f), r = [].concat(r), i = (s = [].concat(s)).length;

	while (j = 0, i--) {
		if (s[i]) {
			while (s[i] = s[i].split(f[j]).join(ra ? r[j] || "" : r[0]), ++j in f){};
		}
	};

	return sa ? s : s[0];
}
function trim( str, charlist ) {
	// http://kevin.vanzonneveld.net
	// +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	// +   improved by: mdsjack (http://www.mdsjack.bo.it)
	// +   improved by: Alexander Ermolaev (http://snippets.dzone.com/user/AlexanderErmolaev)
	// +      input by: Erkekjetter
	// +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	// +      input by: DxGx
	// +   improved by: Steven Levithan (http://blog.stevenlevithan.com)
	// +    tweaked by: Jack
	// +   bugfixed by: Onno Marsman
	// *     example 1: trim('    Kevin van Zonneveld    ');
	// *     returns 1: 'Kevin van Zonneveld'
	// *     example 2: trim('Hello World', 'Hdle');
	// *     returns 2: 'o Wor'
	// *     example 3: trim(16, 1);
	// *     returns 3: 6

	var whitespace, l = 0, i = 0;
	str += '';
	charlist += '';

	if (!charlist) {
		whitespace = ' \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000';
	} else {
		whitespace = charlist.replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g, '\$1');
	}

	l = str.length;
	for (i = 0; i < l; i++) {
		if (whitespace.indexOf(str.charAt(i)) === -1) {
			str = str.substring(i);
			break;
		}
	}

	l = str.length;
	for (i = l - 1; i >= 0; i--) {
		if (whitespace.indexOf(str.charAt(i)) === -1) {
			str = str.substring(0, i + 1);
			break;
		}
	}

	return whitespace.indexOf(str.charAt(0)) === -1 ? str : '';
}

function Display()
{
	var isMozilla = (document.all)?false:true;
	var display = "block"
	if(isMozilla)
	display ="table-row";
	return display;
}
function gosterTR(id)
{
	d(id).style.display = Display();
}
function gizleTR(id)
{
	d(id).style.display = "none";
}
function kafanaGoreTR(id)
{
	var durum = d(id).style.display;
	if(durum == "none")
	{
		gosterTR(id);
	}
	else
	{
		gizleTR(id)
	}
}
//tek input olan sayfada formun eneter ile submit edilmesini onler
var submitFlag=false;
var decSep = "";
var sep = ".";
var format_decSep = ",";
var isMozilla = (document.all)?false:true;
var isMS = !isMozilla;

var basecurrency = 'YTL';
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); // en fazla 9 hane olsun
	}
	if ( !isNaN( parseInt(unformattedString,10) ) ) { // ytlVal nümerik bir de?er ise
		unformattedString = parseInt(unformattedString,10).toString() ; // en ba?taki s?f?rlardan kutulmak için bunu yap?yoruz
	} else { // e?er nümerik bir de?er girilmemi?se
		inpObj.value = "";
		inpObj.focus();
		return;
	}
	inpObj.value = commafy( unformattedString );
}
function commafy(inpValue) {
	var re = /(\d+)(\d{3})/ ;
	while ( re.test(inpValue) ) {
		inpValue = eval("inpValue.replace(re,'$1" + sep + "$2')");
	}
	return inpValue;

}
// gönderilen de?eri sep de?eri ile formatlar
// decimal ve sign eklemesi yapıldı
// param dec : decimal digit sayisi
function formatTutar(inpValue,dec) {
	var re = /(\d+)(\d{3})/ ;
	var reP = /(-)(\d+)/ ;
	var reS = /(\d+)(-)/ ;
	var sign_part='';
	var dec_part=' ';
	inpValue= inpValue.toString();
	if (inpValue=='0') return inpValue;

	if (reP.test(inpValue)) {
		sign_part = inpValue.substring(0,1);
		inpValue = inpValue.substring(1,inpValue.length);
	} else if (reS.test(inpValue)) {
		sign_part = inpValue.substring(inpValue.length-1,inpValue.length);
		inpValue = inpValue.substring(0,inpValue.length-1);
	}
	if (dec!=0 && dec >= inpValue.length) {
		var len = (dec-inpValue.length)+1;
		for (var i=0;i<len;i++) {
			inpValue="0"+inpValue;
		}
	}
	dec_part = inpValue.substring(inpValue.length - dec,inpValue.length);
	inpValue = inpValue.substring(0,inpValue.length - dec);
	inpValue = parseInt(inpValue,10).toString();

	while ( re.test(inpValue) ) {
		inpValue = eval("inpValue.replace(re,'$1"+sep+"$2')");
	}
	if (dec>0) {
		inpValue = inpValue+format_decSep+dec_part;
	}
	if (sign_part=='-')
	inpValue = sign_part+inpValue;

	return inpValue;

}


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

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

function formatCurrencyKurus(inpObj) {
	var temp="";

	for(var i=0;i<inpObj.value.length;i++){
		if(inpObj.value.charAt(i)<"0" || inpObj.value.charAt(i)>"9") break;
		temp=temp+inpObj.value.charAt(i);
	}
	inpObj.value=temp;
}

function doldur(kaynak,doldurx,suanki){
	var suankix = suanki;
	var kaynakx = document.getElementById(kaynak);
	var doldurxx = document.getElementById(doldurx);
	var url = "xml.php?obje=ilceler&il=" + kaynakx.value+"&ilceSuanki="+suankix;
	loadXMLDoc(url, doldurxx);
}
var iframeids=["nesne"]
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 0 : 0

function resizeCaller() {
	var dyniframe=new Array()
	for (i=0; i<iframeids.length; i++){
		if (document.getElementById)
		resizeIframe(iframeids[i])
		if ((document.all || document.getElementById) && iframehide=="no"){
			var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
			tempobj.style.display="block"
		}
	}
}
function resizeIframe(frameid){
	var currentfr=document.getElementById(frameid)
	if (currentfr && !window.opera){
		currentfr.style.display="block"
		if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
		currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
		else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
		currentfr.height = currentfr.Document.body.scrollHeight;
		if (currentfr.addEventListener)
		currentfr.addEventListener("load", readjustIframe, false)
		else if (currentfr.attachEvent){
			currentfr.detachEvent("onload", readjustIframe)
			currentfr.attachEvent("onload", readjustIframe)
		}
	}
}

function readjustIframe(loadevt) {
	var crossevt=(window.event)? event : loadevt
	var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
	if (iframeroot)
	resizeIframe(iframeroot.id);
}

function rc(iframeid, url)
{
	if (document.getElementById)
	document.getElementById(iframeid).src=url
}
//resizeCaller(); yada window.onload = resizecaller;
function kafanaGore(id)
{

	var kimlik = $("#" + id);
	kimlik.toggle(400);
	return true;
}
function gosterJS(id)
{
	var kimlik = $("#" + id);
	kimlik.show(400);
	return true;
}
function gizleJS(id)
{
	var kimlik = $("#" + id);
	kimlik.hide(400);
	return true;
}
function gizleJSN(id)
{
	var kimlik = $("#" + id);
	kimlik.hide();
	return true;
}
function sekmeJS(id,id2)
{
	gizleJSN(id2);
	gosterJS(id);
	return true;
}
function tabJ(id,id2,id3)
{
	var kimlik = $("#" + id);
	kimlik.show(400);

	var kimlik2 = $("#" + id2);
	kimlik2.hide(400);

	var kimlik3 = $("#" + id3);
	kimlik3.hide(400);
	return true;
}

function vitrinDegisx(id,baslik,aciklama) {
	d(bolum+'Vitrin-baslik-'+id).innerHTML = baslik;
	d(bolum+'Vitrin-aciklama-'+id).innerHTML = aciklama;
}
function doldur(kaynak,doldurx,suanki){
	var suankix = suanki;
	var kaynakx = document.getElementById(kaynak);
	var doldurxx = document.getElementById(doldurx);
	var url = "xml.php?obje=ilceler&il=" + kaynakx.value+"&ilceSuanki="+suankix;
	loadXMLDoc(url, doldurxx);
}
function duz(id,idx) {
	document.getElementById(idx).style.display="block";
	document.getElementById(id).style.display="none";
	divVal = document.getElementById(id).firstChild.nodeValue;
	document.getElementById(idx+"_x").value=divVal;
}
function duzenle(id,idx) {
	document.getElementById(idx).style.display="none";
	document.getElementById(id).style.display="block";
	areaVal = document.getElementById(idx+"_x").value;
	document.getElementById(id).innerHTML=areaVal;
}
function iptal(id,idx){
	document.getElementById(idx).style.display="none";
	document.getElementById(id).style.display="block";
}

function HighlightAll(theField) {
	var tempval=eval("document."+theField)
	tempval.focus()
	tempval.select()
	if (document.all&&copytoclip==1){
		therange=tempval.createTextRange()
		therange.execCommand("Copy")
	}
}

var copiedtext=""
var tempstore=""

function Copy() {
	if (document.all){
		tempstore=copiedtext
		document.execCommand("Copy")
		copiedtext=window.clipboardData.getData("Text");
	}
}

function Cut() {
	if (document.all){
		tempstore=copiedtext
		document.execCommand("Cut")
		copiedtext=window.clipboardData.getData("Text");
	}
}

function Paste(theField) {
	var tempval=eval("document."+theField)
	if (document.all){
		therange=tempval.createTextRange()
		therange.execCommand("Paste")
	}
}

function TarihEkle(val, id){

	var kok = document.getElementById(id);
	if (kok.value.length == 2 || kok.value.length == 5) {
		kok.value = kok.value + "/";
	}
}
function tiredegistir(txt){
	txt.value=txt.value.replace(/-/g, ".");
}


function degis()
{
	var dt=new Date()
	var ayy = dt.getMonth();
	ayy=ayy+1;
	if ( ayy < 10 ) ayy = "0"+ayy;
	var tarih = dt.getDate()+"."+ ayy +"."+dt.getFullYear()+" " ;
	if ( dt.getHours() < 10 ) ayy = "0"+dt.getHours();
	else ayy = dt.getHours();
	if ( dt.getMinutes() < 10 ) ayy += ":0"+dt.getMinutes();
	else ayy += ":"+dt.getMinutes();
	document.getElementById('saat').innerHTML=tarih+ayy;
	setTimeout('degis();',6000);
}


function popup(mypage, myname, w, h, scroll){
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + ',scrollbars=' + scroll + ''
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
}
//// yer imi sitelerine ekle
function addDelicious (strTitle, strURL, strDesc, strKeyword) {
	window.open('http://del.icio.us/post?v=4&noui&jump=close&url='+strURL+'&title='+strTitle+'&notes='+strDesc+'&tags='+strKeyword, 'delicious','toolbar=no,width=700,height=400');
}

function addFacebook (strThumb, strURL, strTitle, strDesc) {
	window.open('http://www.facebook.com/sharer.php?s=100&p[medium]=100&p[title]='+strTitle+'&p[images][0]='+strThumb+'&p[url]='+strURL+'&p[summary]='+strDesc+'','sharer','toolbar=0,status=0,width=626,height=436');
}

function addGBookmark (strTitle, strURL, strDesc, strKeyword) {
	window.open('http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk='+strURL+'&title='+strTitle+'&labels='+strKeyword+'&annotation='+strDesc, 'googlebookmark','toolbar=no,width=700,height=500');
}
function addDigg (strTitle, strURL, strDesc) {
	window.open('http://digg.com/submit?phase=2&url='+document.location.href+'&title='+strTitle, 'digg','scrollbars=yes,toolbar=no,width=760,height=500');
}
function addYahoo (strTitle, strURL, strDesc, strKeyword) {
	window.open('http://myweb2.search.yahoo.com/myresults/bookmarklet?u='+strURL+'&t='+strTitle2+'&tag='+strKeyword+'&d='+strDesc, 'yahoo','toolbar=no,width=700,height=400');
}
function addTusul (strURL) {
	window.open('http://www.tusul.com/submit.php?url='+strURL, 'tusul','toolbar=no,width=700,height=400');
}
function addTechnorati (strUL) {
	window.open('http://www.technorati.com/faves?add='+strURL, 'technorati','scrollbars=yes,toolbar=no,width=800,height=500');
}
function addSpurl (strTitle, strURL) {
	window.open('http://www.spurl.net/spurl.php?url='+strURL+'&title='+strTitle,'spurl','toolbar=no,width=700,height=400');
}
function resimBuyut (strImage, strXb, strYb) {
	window.open('/araclar/resimgoster.html?resim='+strImage,'Buyuk','toolbars=no,width='+ strXb +',height='+ strYb +',scrollbars=auto');
}

//// yer imi sitelerine ekle js ler
function VeriGir(suan, eklenecek){
	EskiVeri = document.getElementById(eklenecek).value;
	YeniVeri = EskiVeri + suan;
	document.getElementById(eklenecek).value = YeniVeri;
}
function veriKopyalaText(idOku, idYaz)
{
	veri = d(idOku).value;
	d(idYaz).innerHTML = veri;
}

function Sil(id){
	Veri = document.getElementById(id).value;
	Uzunluk = Veri.length;
	document.getElementById(id).value = Veri.substr(0, Uzunluk - 1);
}

function tumunu_sec(deger){
	form = document.forms[deger];
	for (i = 0; i < form.elements.length; i++) {
		if ((form.elements[i].type == "checkbox"))
		if ((form.elements[i].name != "tumu")) {
			if (form.elements["tumu"].checked == true) {
				form.elements[i].checked = true;
			}
			else {
				form.elements[i].checked = false;
			}
		}
	}
}
//JXG(yukleniyor, yer, dosya, sc)
function islem(div_alani,sayfa,datam,method,loading) {
	if(datam == null)
	{
		datam = '';
	}
	if(method == null)
	{
		method = "get";
	}
	if(loading == 1)
	{
		$('#'+div_alani).ajaxStart(function(){

			$(this).html('<img src="imajlar/loading.gif" />');

		});
	}
	$.ajax({
		type: method,
		url: sayfa,
		data: datam,
		success: function(ajaxCevap) {
			$('#'+div_alani).html(ajaxCevap);
		}
	});

}
function islem_input(div_alani,sayfa,datam,method,loading) {
	if(datam == null)
	{
		datam = '';
	}
	if(method == null)
	{
		method = "get";
	}
	if(loading == 1)
	{
		$('#'+div_alani).ajaxStart(function(){

			$(this).html('<img src="imajlar/loading.gif" />');

		});
	}
	$.ajax({
		type: method,
		url: sayfa,
		data: datam,
		success: function(ajaxCevap) {
			d(div_alani).value = ajaxCevap;
		}
	});
}
function islem_src(div_alani,sayfa,datam,method,loading) {
	if(datam == null)
	{
		datam = '';
	}
	if(method == null)
	{
		method = "get";
	}
	if(loading == 1)
	{
		$('#'+div_alani).ajaxStart(function(){

			$(this).html('<img src="imajlar/loading.gif" />');

		});
	}
	$.ajax({
		type: method,
		url: sayfa,
		data: datam,
		success: function(ajaxCevap) {
			d(div_alani).src = ajaxCevap;
		}
	});

}
function sahoOneri(id,kolon,tablo)
{
	var kel = idval(id);
	if(kel.length > 0)
	{
		//JXG(1,"oneri"+kolon,"nesne.php","olay=oneri&kel=" + kel + "&kolon=" + kolon + "&tablo=" + tablo);
		islem("nesne.php","get","olay=oneri&kel=" + kel + "&kolon=" + kolon + "&tablo=" + tablo,"oneri"+kolon);
		gosterJS("oneri"+kolon);
		//setTimeout(\'gizle("oneri"+kolon)\',1000);
	}
	else
	{
		gizleJS("oneri"+kolon);
	}

}
//////////// tab- temp
function bgDegisX(no,taban,basla,limit)// by saho
{
	for(i=basla;i<=limit;i++)
	{
		id = taban + "" + i;
		if(i == no)
		{
			document.getElementById(id).setAttribute("class", "sayfax");
		}
		else
		{
			document.getElementById(id).setAttribute("class", "sayfaax");
		}
	}

}
function tabJx(no,taban,basla,limit)
{
	for(i=basla;i<=limit;i++)
	{
		id = taban + "" + i;
		if(i == no)
		{
			var kimlik = $("#" + id);
			kimlik.show(400);
		}
		else
		{
			var kimlik2 = $("#" + id);
			kimlik2.hide(400);
		}
	}
	return true;
}
////////////////
function tiklat(kolon,sure) {
	setTimeout("gizleJS('"+kolon+"')",sure);
}
//function tiklat() {
//	setTimeout(\'gizle("oneri")\',1000);
//}
/*
function sahoOneri(id) {
var kel = idval(id);
alert(kel)
}
*/
function TarihEkle(val, id){

	var kok = document.getElementById(id);
	if (kok.value.length == 2 || kok.value.length == 5) {
		kok.value = kok.value + "/";
	}
}

function popup(mypage, myname, w, h, scroll){
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + ',scrollbars=' + scroll + ''
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
}
/*
function sahoOneri(id) {
var kel = idval(id);
alert(kel)
}
*/
function Gir(id,veri){
	document.getElementById(id).value = veri;
}
function GirHtml(id,veri){
	document.getElementById(id).innerHTML = veri;
}
function VeriGir(suan, eklenecek){
	EskiVeri = document.getElementById(eklenecek).value;
	YeniVeri = EskiVeri + suan;
	document.getElementById(eklenecek).value = YeniVeri;
}

function Sil(id){
	Veri = document.getElementById(id).value;
	Uzunluk = Veri.length;
	document.getElementById(id).value = Veri.substr(0, Uzunluk - 1);
}

function tumunu_sec(deger){
	form = document.forms[deger];
	for (i = 0; i < form.elements.length; i++) {
		if ((form.elements[i].type == "checkbox"))
		if ((form.elements[i].name != "tumu")) {
			if (form.elements["tumu"].checked == true) {
				form.elements[i].checked = true;
			}
			else {
				form.elements[i].checked = false;
			}
		}
	}
}

function isNumber(obj){
	var len = obj.value.length;
	var lastChar = obj.value.charAt(len - 1);
	if (lastChar != '0' && lastChar != '1' && lastChar != '2' && lastChar != '3' && lastChar != '4' &&
	lastChar != '5' &&
	lastChar != '6' &&
	lastChar != '7' &&
	lastChar != '8' &&
	lastChar != '9') {
		obj.value = obj.value.substring(0, len - 1);
	}
}

function posta_durum(id, idsubmit){
	if (!mail_kontrol(idval(id))) {
		alert("Geçersiz E-Posta Adresi Girdiniz !");
		pasifle(idsubmit);
		//document.nameform.id.focus();
		return false;
	}
	else {
		//aktifle(idsubmit);
		return true;
	}
}

function idval(id){
	return document.getElementById(id).value
}

function aktifle(id){
	document.getElementById(id).disabled = ""
}

function pasifle(id){
	document.getElementById(id).disabled = "disabled"
}

function nurgul2(id, tip){
	if (document.getElementById(id).style.disabled == "")
	document.getElementById(id).style.disabled = "disabled"
	else
	document.getElementById(id).style.disabled = ""
}

function nurgul(id){
	if (document.getElementById(id).style.display == "")
	document.getElementById(id).style.display = "none"
	else
	document.getElementById(id).style.display = ""
}

function goster(id){
	document.getElementById(id).style.display = ""
}


function gizle(id){
	document.getElementById(id).style.display = "none"
}
/*
function gizleZamanli(id){

setTimeout("olayss",1000);
olayss = gizle(id)
}
*/
function pasif(id, fnamef){
	xpasifx = document.getElementById(id, fname)
	xpasifx.disabled = true
	xpasifx.value = "lütfen bekleyiniz..."
	document.fnamef.submit()
}

//hepsini seç
var copytoclip = 1
function kopyala(theField){
	var tempval = eval("document." + theField)
	tempval.focus()
	tempval.select()
	if (document.all && copytoclip == 1) {
		therange = tempval.createTextRange()
		therange.execCommand("Copy")
		window.status = "Metin Başarıyla Kopyalama Hafızasına Alındı İstediğiniz Yere Yapıştırabilirsiniz !"
		setTimeout("window.status=''", 1800)
	}
}


function kopyalaa(id){
	var tempval = document.getElementById(id);
	tempval.focus()
	tempval.select()
	if (document.all && copytoclip == 1) {
		therange = tempval.createTextRange()
		therange.execCommand("Copy")
		window.status = "Metin Başarıyla Kopyalama Hafızasına Alındı İstediğiniz Yere Yapıştırabilirsiniz !"
		setTimeout("window.status=''", 1800)
	}
}

function popup(mypage, myname, w, h, scroll){
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + ',scrollbars=' + scroll + ''
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
}

//copyright saho 2006
// ajax kutuphanesi
var saho = new myLibrary();
function myLibrary(){
	this.ajax = ajax
}

function ajax(data, method, url, divid){
	document.getElementById(divid).innerHTML = '<center><img src="imajlar/saho_coming.gif"><br>Sayfa Yükleniyor Lütfen Bekleyiniz...</center>'
	var page_request = false
	if (window.XMLHttpRequest)
	page_request = new XMLHttpRequest()
	else
	if (window.ActiveXObject) {
		try {
			page_request = new ActiveXObject("Msxml2.XMLHTTP")
		}
		catch (e) {
			try {
				page_request = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e) {
			}
		}
	}
	else
	return false
	page_request.onreadystatechange = function(){
		loadpage(page_request, divid)
	}
	if (method == 'GET') {
		var url = url + '?' + data
	}
	page_request.open(method, url, true)
	page_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
	page_request.send(data)
	return page_request
}

function loadpage(page_request, divid){
	if (page_request.readyState == 4 && (page_request.status == 200 || window.location.href.indexOf("http") == -1))
	document.getElementById(divid).innerHTML = page_request.responseText
}

function GetCookie(name){
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
		return getCookieVal(j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0)
		break;
	}
	return null;
}

function getCookieVal(offset){
	var endstr = document.cookie.indexOf(";", offset);
	if (endstr == 1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function SetCookie(name, value, expires){
	var exp = new Date();
	var expiro = (exp.getTime() + (24 * 60 * 60 * 1000 * expires));
	exp.setTime(expiro);
	var expstr = "; expires=" + exp.toGMTString();
	document.cookie = name + "=" + escape(value) + expstr;
}

function DeleteCookie(name){
	if (GetCookie(name)) {
		document.cookie = name + "=" + "; expires = Thu, 01-Jan-70 00:00:01 GMT";
	}
}

var imagepath = "images/";
////////////////////////////////////
blockarray = new Array();
var blockarrayint = -1;
function doblocks(imgpath){
	if (imgpath != null)
	imagepath = imgpath;
	for (var q = 0; q < blockarray.length; q++) {
		xyzswitch(blockarray[q]);
	}
}

function xswitch(listID){
	if (listID.style.display == "none") {
		listID.style.display = "";
	}
	else {
		listID.style.display = "none";
	}
}

function icoswitch(bid){
	icoID = document.getElementById('pic' + bid);
	if (icoID.src.indexOf("minus") != -1) {
		icoID.src = imagepath + "plus.gif";
		SetCookie('block' + bid, 'yes', 365);
	}
	else {
		icoID.src = imagepath + "minus.gif";
		DeleteCookie('block' + bid);
	}
}

function xyzswitch(bid){
	xswitch(document.getElementById('ph' + bid));
	xswitch(document.getElementById('pe' + bid));
	icoswitch(bid);
}

function addblock(bid){
	var blockopen = GetCookie('block' + bid);
	if (blockopen != null) {
		blockarrayint += 1;
		blockarray[blockarrayint] = bid;
	}
}

////////////////////////////////////
var hiddenblocks = new Array();
var blocks = GetCookie('hiddenblocks');
if (blocks != null) {
	var hidden = blocks.split(":");
	for (var loop = 0; loop < hidden.length; loop++) {
		var hiddenblock = hidden[loop];
		hiddenblocks[hiddenblock] = hiddenblock;
	}
}
function blockswitch(bid){
	var bph = document.getElementById('ph' + bid);
	var bpe = document.getElementById('pe' + bid);
	var bico = document.getElementById('pic' + bid);
	if (bph.style.display == "none") {
		bph.style.display = "";
		bpe.style.display = "none";
		hiddenblocks[bid] = bid;
		bico.src = imagepath + "plus.gif";
	}
	else {
		bph.style.display = "none";
		bpe.style.display = "";
		hiddenblocks[bid] = null;
		bico.src = imagepath + "minus.gif";
	}
	var cookie = null;
	for (var q = 1; q < hiddenblocks.length; q++) {
		if (hiddenblocks[q] != null) {
			if (cookie != null) {
				cookie = (cookie + ":" + hiddenblocks[q]);
			}
			else {
				cookie = hiddenblocks[q];
			}
		}
	}
	if (cookie != null) {
		SetCookie('hiddenblocks', cookie, 365);
	}
	else {
		DeleteCookie('hiddenblocks');
	}
}

// aç kapalar

// Commonly-used functions, reduced.

function d(s){
	return document.getElementById(s);
}

function dE(o, s){
	return o.getElementsByTagName(s);
}

/**
* toggleDisplay()
*
* Will toggle the display property of the style object for any
* DOM element or object that supports style as a property.
*
* Warning: This'll wreak havoc if applied to <TR> elements. Those
* babies got different types "table-row" | "block" dependant on
* what browser's being used.
*
* Warning: Written in Texas.  Yeehaw.
*
* Typical usage:
* toggleDisplay(document.getElementById("foo"));
*/
function toggleDisplay(o){
	var display = getStyle(o, "display");

	if (o.style)
	o.style.display = (display != "none") ? "none" : getDisplayStyleByTagName(o);
}


function getDisplayStyleByTagName(o){
	n = o.nodeName.toLowerCase();
	return (n == "span" ||
	n == "img" ||
	n == "a") ? "inline" : "block";
}


/**
* sahogizle()
*
* Hides an element from view.
*
* Typical usage:
* sahogizle(getElement("the-id-of-the-element"));
*/
function sahogizle(o){
	if (o && o.style)
	o.style.display = "none";
}



/**
* sahogoster()
*
* Shows an element that was hidden from view.
*
* Typical usage:
* sahogoster(getElement("the-id-of-the-element"));
*/
function sahogoster(o){

	if (o && o.style)
	o.style.display = getDisplayStyleByTagName(o);
}


/**
* getElement()
*
* Returns an element by its ID or shows an alert if it can't be found.
*
* Typical usage:
* getElement("the-id-of-the-element");
*/
function getElement(id){
	var e = d(id);
	if (!e) {
		alert("Cannot get element: " + id);
	}
	return e;
}

/**
* setInnerHTML()
*
* Sets the innerHTML of an element or shows an alert if can't be set.
*
* Typical usage:
* setInnerHTML("the-id-of-the-element");
*/
function setInnerHTML(id, html){
	try {
		getElement(id).innerHTML = html;
	}
	catch (ex) {
		alert("Cannot set inner HTML: " + id);
	}
}


/**
* setCssStyle()
*
* Sets the style of an element by its id or shows an alert if can't be set.
*
* Typical usage:
* setCssStyle("the-id-of-the-element", "display", "block");
*/
function setCssStyle(id, name, value){
	try {
		getElement(id).style[name] = value;
	}
	catch (ex) {
		alert("Cannot set style: " + id);
	}
}


/**
* getStyle()
*
* Gets the computed style of any object.
*
* WARNING: Produces unexpected results in Safari.  To achieve best
* results, explicitly set the style property for that browser when the
* element is rendered.
*
* Typical usage:
* getStyle(object, "display");
*/
function getStyle(el, style){
	if (!document.getElementById || !el)
	return;

	if (document.defaultView &&
	document.defaultView.getComputedStyle) {
		return document.defaultView.getComputedStyle(el, "").getPropertyValue(style);
	}
	else
	if (el.currentStyle) {
		return el.currentStyle[style];
	}
	else {
		return el.style.display;
	}
}

/**
* getStyleAttribute()
*
* Returns the style attribute of the specified node.
*/
function getStyleAttribute(node){
	if (Detect.IE()) {
		return node.getAttribute('style').value;
	}
	else {
		return node.getAttribute('style');
	}
}


/*
* showProps()
*
* Displays all the properties for a given element
*/
function showProps(o){
	s = "";
	for (p in o) {
		s += p + ": " + o[p] + "\n<br />";
	}
	document.write(s);
}



function setIFrameEvent(iframe, eventName, func){
	if (document.all) {
		eval('getIFrameDocument(iframe).on' + eventName + ' = func;');
	}
	else {
		iframe.contentWindow.addEventListener(eventName, func, true);
	}
}

function setIFrameBody(iframe, strStyle, innerHtml){
	if (!innerHtml)
	innerHtml = '';
	if (innerHtml == '' && Detect.IE()) {
		innerHtml = '<div></div>';
	}
	var doc = getIFrameDocument(iframe);
	doc.open();
	doc.write('<body style="' + strStyle + '">' +
	innerHtml +
	'</body>');
	doc.close();
}


function getIFrameDocument(iframe){
	if (Detect.IE()) {
		return iframe.document;
	}
	else {
		return iframe.contentDocument;
	}
}

function getIFrame(strId){
	if (Detect.IE()) {
		return document.frames[strId];
	}
	else {
		return document.getElementById(strId);
	}
}


function createElementandAppend(nodeName, strId, appendTo){
	var el = document.createElement(nodeName);
	el.setAttribute("id", strId);
	if (appendTo) {
		appendTo.appendChild(el);
	}
	else {
		document.body.appendChild(el);
	}
	return el;
}

function createElementandInsertBefore(nodeName, strId, appendTo, sibling){
	var el = document.createElement(nodeName);
	el.setAttribute("id", strId);
	if (appendTo) {
		appendTo.insertBefore(el, sibling);
	}
	else {
		document.body.insertBefore(el, sibling);
	}
	return el;
}


/**
* getXY()
*
* Returns the position of any element as an object.
*
* Typical usage:
* var pos = getXY(object);
* alert(pos.x + " " +pos.y);
*/
function getXY(el){
	var x = el.offsetLeft;
	var y = el.offsetTop;
	if (el.offsetParent != null) {
		var pos = getXY(el.offsetParent);
		x += pos.x;
		y += pos.y;
	}
	return {
		x: x,
		y: y
	}
}

// The following 3 functions are taken from common.js
function hasClass(el, cl){
	if (el == null || el.className == null)
	return false;
	var classes = el.className.split(" ");
	for (var i = 0; i < classes.length; i++) {
		if (classes[i] == cl) {
			return true;
		}
	}
	return false;
}

// Add a class to element
function addClass(el, cl){
	if (hasClass(el, cl))
	return;
	el.className += " " + cl;
}

//saho aç kapa
function ackapa(ac, ac2, kapa, kapa2){
	sahogoster(d(ac));
	sahogoster(d(ac2));
	sahogizle(d(kapa));
	sahogizle(d(kapa2));
}

//saho tablama
z = null
function tab(ac, k1, k2, k3, k4){
	sahogoster(d(ac));
	sahogizle(d(k1));
	sahogizle(d(k2));
	sahogizle(d(k3));
	sahogizle(d(k4));
}

// Remove a class from an element
function removeClass(el, cl){
	if (el.className == null)
	return;
	var classes = el.className.split(" ");
	var result = [];
	var changed = false;
	for (var i = 0; i < classes.length; i++) {
		if (classes[i] != cl) {
			if (classes[i]) {
				result.push(classes[i]);
			}
		}
		else {
			changed = true;
		}
	}
	if (changed) {
		el.className = result.join(" ");
	}
}

/* Constants for node types, since IE doesn't support Node.TEXT_NODE */
var TEXT_NODE = 3;
var ELEMENT_NODE = 1;


var ns6=document.getElementById&&!document.all

function restrictinput(maxlength,e,placeholder){
	if (window.event&&event.srcElement.value.length>=maxlength)
	return false
	else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){
		var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys
		if (pressedkey.test(String.fromCharCode(e.which)))
		e.stopPropagation()
	}
}

function countlimit(maxlength,e,placeholder){
	var theform=eval(placeholder)
	var lengthleft=maxlength-theform.value.length
	var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
	if (window.event||e.target&&e.target==eval(placeholder)){
		if (lengthleft<0)
		theform.value=theform.value.substring(0,maxlength)
		placeholderobj.innerHTML=lengthleft
	}
}


function displaylimit(thename, theid, thelimit)
{
	if(theid != "")
	{
		var theform = document.getElementById(theid);
	}
	else
	{
		var theform = thename;
	}
	var limit_text='<b><span id="'+theform.toString()+'">'+thelimit+'</span></b> karakter kaldı.'
	if (document.all||ns6)
	document.write(limit_text)
	if (document.all){
		//	eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
		eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
	}
	else if (ns6){
		//document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true);
		document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true);
	}
}
function displaylimit_asd(thename, theid, thelimit, yansi)
{
	if(theid != "")
	{
		var theform = document.getElementById(theid);
	}
	else
	{
		var theform = thename;
	}
	var limit_text='<b><span id="'+theform.toString()+'">'+thelimit+'</span></b> karakter kaldı.'
	if (document.all||ns6)
	document.write(limit_text)
	if (document.all){
		eval(theform).onkeypress=function(){ return veriKopyalaText(theid,yansi) }
		eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform) }
	}
	else if (ns6){
		document.body.addEventListener('keypress', function(event) { veriKopyalaText(theid,yansi) }, true);
		document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true);
	}
}

function displaylimitt(thename, theid, thelimit,yansi)
{
	if(theid != "")
	{
		var theform = document.getElementById(theid);
	}
	else
	{
		var theform = thename;
	}
	var limit_text='<b><span id="'+theform.toString()+'">'+thelimit+'</span></b> karakter kaldı.'
	if (document.all||ns6)
	document.write(limit_text)
	if (document.all){
		eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
		eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform) }
		eval(theform).onkeyup=function(){ veriKopyalaText(theid,yansi) }
	}
	else if (ns6){
		document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true);
		document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true);
		document.body.addEventListener('keyup', function(event) { veriKopyalaText(theid,yansi) }, true);

	}
}
function cikis(B){
	var A = document.getElementsByTagName("html")[0];
	A.style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	if (confirm(B)) {
		return true
	}
	else {
		A.style.filter = "";
		return false
	}
}


function loadXMLDoc_2 (url)

{
	var xmlHttp = false;
	var isMozilla = (document.all)?false:true;
	var isMS = !isMozilla;

	if(window.XMLHttpRequest) {
		try {
			xmlHttp = new XMLHttpRequest();
			if (xmlHttp.overrideMimeType) {
				xmlHttp.overrideMimeType('text/xml');
			}
		} catch(e) {
			xmlHttp = false;
		}
	}
	else if(window.ActiveXObject) {
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e) {
				xmlHttp = false;
			}
		}
	}

	if (xmlHttp)
	{
		xmlHttp.onreadystatechange = function()
		{
			if (xmlHttp.readyState == 4)
			{
				if (xmlHttp.status == 200)
				{
					try
					{
						//var oTarget = eval(handleObj);
						//var k=oTarget.options.length;
						//oTarget.length=0;
						respXML = xmlHttp.responseXML.documentElement;
						var chLen = (isMozilla)?((respXML.childNodes.length - 1) / 2):respXML.childNodes.length;

						try
						{

							for (var i=0; i<chLen; i++)
							{
								var data=respXML.childNodes[i];

								if (data.childNodes[0].nodeName=='id')
								{
									id = data.childNodes[0].text;
									arac_adi =  data.childNodes[1].text;
									//tip_adi =  data.childNodes[2].text;
									document.getElementById('arac_deger').innerText = id + ' YTL'
									document.getElementById('www_arac_deger').value = id
									document.getElementById('www_marka_adi').value = arac_adi
									//document.getElementById('www_tip_adi').value = tip_adi

									// document.getElementById('arac_deger').innerText = id + ' YTL'
									// value = data.childNodes[1].text;
									// isSelected = data.childNodes[2].text;
									// var oOption = document.createElement("OPTION");
									// oOption.text=value;
									// oOption.value=id;
									// oOption.selected = (isSelected=='1');
									// oOption = null;

								}
								else
								{
									alert(data.childNodes[0].text);
								}

							}


						}
						catch(er)
						{
							alert(er.description);
							return;
						}
					}
					catch(e)
					{
						alert("XML transferi sirasinda bir hata olustu:\n"+e.message+url);
					}
				}
				else
				alert("error retrieving data\n" + xmlHttp.status + ": " + xmlHttp.statusText);
			}
		};
		xmlHttp.open("GET", url, true);
		xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded;charset=iso-8859-9');
		xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded;language=tr');
		xmlHttp.send(null);



	}
}
function loadXMLDoc(url, handleObj)
{
	var xmlHttp = false;
	var isMozilla = (document.all)?false:true;
	var isMS = !isMozilla;
	var evalItem =  arguments[2];//SNETIT-2092

	if(window.XMLHttpRequest) {
		try {
			xmlHttp = new XMLHttpRequest();
			if (xmlHttp.overrideMimeType) {
				xmlHttp.overrideMimeType('text/xml');
			}
		} catch(e) {
			xmlHttp = false;
		}
	}
	else if(window.ActiveXObject) {
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e) {
				xmlHttp = false;
			}
		}
	}

	if (xmlHttp)
	{
		xmlHttp.onreadystatechange = function()
		{
			if (xmlHttp.readyState == 4)
			{
				if (xmlHttp.status == 200)
				{
					try
					{
						var oTarget = eval(handleObj);
						var k=oTarget.options.length;
						oTarget.length=0;
						respXML = xmlHttp.responseXML.documentElement;
						var chLen = (isMozilla)?((respXML.childNodes.length - 1) / 2):respXML.childNodes.length;

						try
						{
							var data=respXML.getElementsByTagName("data");
							for (var i=0; i<data.length; i++)
							{
								var idNode = data[i].getElementsByTagName("id");
								var valueNode = data[i].getElementsByTagName("value");
								var isSelectedNode = data[i].getElementsByTagName("isselected");
								var id = "";
								var value = "";
								var isSelected = "";
								try{
									id = idNode.item(0).firstChild.nodeValue;
								}
								catch(e){
									id = "";
								}
								try{
									value = valueNode.item(0).firstChild.nodeValue;
								}
								catch(e){
									value = "";
								}
								try{
									isSelected = isSelectedNode.item(0).firstChild.nodeValue;
								}
								catch(e){
									isSelected = "";
								}
								var newOpt = new Option(value, id);
								var selLength = handleObj.length;
								handleObj.options[selLength] = newOpt;

								if(isSelected == "1")
								handleObj.options[selLength].selected = true;
							}
							if (document.getElementById("ChlenCounter")){
								document.getElementById("ChlenCounter").value = chLen
							}
							if(evalItem){//SNETIT-2092
								eval(evalItem);
							}
						}
						catch(er)
						{
							//alert(er.description);
							return;
						}
					}
					catch(e)
					{
						alert("XML transferi sirasinda bir hata olustu:\n"+e.message+url+oTarget.Name);
					}
				}
				else
				alert("error retrieving data\n" + xmlHttp.status + ": " + xmlHttp.statusText);
			}
		};
		xmlHttp.open("GET", url, true);
		xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded;charset=iso-8859-9');
		xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded;language=tr');
		xmlHttp.send(null);
	}
}

/*
function getXMLDoc(url, handleObj)
{
var XHR = false;
var firstElement = null;
XHR = createXHTTP();
if (XHR) {
XHR.onreadystatechange = function() {
if (XHR.readyState == 4) {
if (XHR.status == 200)
{
try{
var oTarget = $(handleObj);
oTarget.length=0;
respXML = XHR.responseXML.documentElement;
for (var i=0; i < respXML.childNodes.length; i++) {
optID = $X(respXML, 'OptionValue', i);
optTX = $X(respXML, 'OptionText', i)
optSL = $X(respXML, 'isSelected', i)
var oOption = document.createElement("OPTION");
if ((optTX!=null)) {
oOption.text=optTX;
oOption.value=(optID!=null)?optID:null;
try{		//Mozilla code
oTarget.add(oOption, null);
}
catch(e){	//IE code
oTarget.add(oOption);
}
oOption.selected = (optSL=="T");
firstElement = oOption;
}
oOption = null;
}
}catch(e){ alert("XML transferi sirasinda bir hata olustu:\n\n"+ e.message); }
} else
alert("Veri alırken hata\n" + XHR.status + ": " + XHR.statusText);
}
};
XHR.open("GET", url, true);
XHR.setRequestHeader('Content-type', 'application/x-www-form-urlencoded;charset=iso-8859-9');
XHR.setRequestHeader('Content-type', 'application/x-www-form-urlencoded;language=tr');
XHR.send(null);
}
}
*/