/*** powered by saho
anka bilişim teknolojileri ***/
/// göster - gizle tablar başlar
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 gosterirkenGizleTR(goster,gizle)
{
	gizleTR(gizle);
	gosterTR(goster);
}
function kafanaGoreTR(id)
{
	var durum = d(id).style.display;
	if(durum == "none")
	{
		gosterTR(id);
	}
	else
	{
		gizleTR(id)
	}
}
/// a linke göre

function gosterTRA(id)
{
	d(id).style.display = "";
}
function gizleTRA(id)
{
	d(id).style.display = "none";
}
function kafanaGoreTRA(id)
{
	var durum = d(id).style.display;
	if(durum == "none")
	{
		gosterTRA(id);
	}
	else
	{
		gizleTRA(id)
	}
}
function toggleJS(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;
}
/// göster gizle tabları biter
function xmlYukle(obje,kaynak,doldurx,suanki){
	var kaynakx = document.getElementById(kaynak);
	var doldurxx = document.getElementById(doldurx);
	var url = "xml.php?obje=" + obje + "&kriter=" + kaynakx.value+"&suanki="+suanki;
	loadXMLDoc(url, doldurxx);
}
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 islem(sayfa,method,datam,div_alani) {
	if(datam == null)
	{
		datam = '';
	}
	$('#'+div_alani).ajaxStart(function(){

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

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

}
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 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 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ç


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();
	}
}

// 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(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);
	}
}


 

  