/*** powered by saho
anka bilişim teknolojileri ***/
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 gosterTR2(id)
{
	d(id).style.display = "";
}
function gizleTR(id)
{
	d(id).style.display = "none";
}
tempGizle = "haber_alan_1";
function haberTab(goster)
{
	if(tempGizle != null)
	{
		gizleTR(tempGizle);
	}
	gosterTR2(goster);
	tempGizle = goster;	
}

function gosterGizleTR(gizle, goster)
{
	gizleTR(gizle);
	gosterTR(goster);
}
function gosterGizleTRL(gizle, goster)
{
	gizleTR(gizle);
	gosterTR("loading");
	setTimeout("gosterGizleTR('loading', '"+goster+"')",2000);
}
function gosterirkenGizleTR(goster,gizle)
{
	gizleTR(gizle);
	gosterTR(goster);
}
function kafanaGoreTR(id)
{
	var durum = d(id).style.display;
	if(durum == "none")
	{
		gosterTR(id);
	}
	else
	{
		gizleTR(id)
	}
}
var vitrinEski=0;
function vitrinDegis(id,eskii,bolum) {
	if(id!='' && id!=' ' && (id != eskii || id!= vitrinEski) )
	{
		if(vitrinEski == 0)
		{
			d(bolum+'Vitrin-baslik-'+eskii).style.display = "none";
			d(bolum+'Vitrin-resim-'+eskii).style.display = "none";
			d(bolum+'Vitrin-aciklama-'+eskii).style.display = "none";
			d(bolum+'Vitrin-tasiyici-'+eskii).style.display = "none";
		}
		else
		{
			d(bolum+'Vitrin-baslik-'+vitrinEski).style.display = "none";
			d(bolum+'Vitrin-resim-'+vitrinEski).style.display = "none";
			d(bolum+'Vitrin-aciklama-'+vitrinEski).style.display = "none";
			d(bolum+'Vitrin-tasiyici-'+vitrinEski).style.display = "none";
		}

		d(bolum+'Vitrin-baslik-'+id).style.display = "";
		d(bolum+'Vitrin-resim-'+id).style.display = "";
		d(bolum+'Vitrin-aciklama-'+id).style.display = "";
		d(bolum+'Vitrin-tasiyici-'+id).style.display = "";

		vitrinEski = id ;
	}
}
var vitrinEskiy=0;
function vitrinDegisy(id,eskii,bolum) {
	if(id!='' && id!=' ' && (id != eskii || id != vitrinEskiy) )
	{
		if(vitrinEskiy == 0)
		{
			d(bolum+'Vitrin-baslik-'+eskii).style.display = "none";
			d(bolum+'Vitrin-resim-'+eskii).style.display = "none";
			d(bolum+'Vitrin-aciklama-'+eskii).style.display = "none";
			d(bolum+'Vitrin-tasiyici-'+eskii).style.display = "none";
		}
		else
		{
			d(bolum+'Vitrin-baslik-'+vitrinEskiy).style.display = "none";
			d(bolum+'Vitrin-resim-'+vitrinEskiy).style.display = "none";
			d(bolum+'Vitrin-aciklama-'+vitrinEskiy).style.display = "none";
			d(bolum+'Vitrin-tasiyici-'+vitrinEskiy).style.display = "none";
		}

		d(bolum+'Vitrin-baslik-'+id).style.display = "";
		d(bolum+'Vitrin-resim-'+id).style.display = "";
		d(bolum+'Vitrin-aciklama-'+id).style.display = "";
		d(bolum+'Vitrin-tasiyici-'+id).style.display = "";

		vitrinEskiy = id ;
	}
}
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();
	}
	setInverval("win.window.focus()",1000);
}
//// 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 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 sahoOneri(id,kolon) {
	var kel = idval(id);
	if(kel.length>0) {
		goster("oneri"+kolon);
		JXG(1,"oneri"+kolon,"nesne.php","olay=oneri&kel="+kel+"&kolon="+kolon);
		//setTimeout(\'gizle("oneri"+kolon)\',1000);
	}
	else
	{
		gizle("oneri"+kolon);
	}

}
//function tiklat() {
//	setTimeout(\'gizle("oneri")\',1000);
//}
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 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){
	var theform=theid!=""? document.getElementById(theid) : thename
	var limit_text='<b><span id="'+theform.toString()+'">'+thelimit+'</span></b> Karakter Kalan'
	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 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);
}
}
*/
