function printpage(id){
if (id !='0')window.open('print.asp?id='+ id,'fotospage','width=660,height=510,top=75,left=135,status=no,scroolbars=no');
}

// tooltip scripti başladı ------------------------------------------

var horizontal_offset="-80px"
var vertical_offset="100"
var ie=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null){
		totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
	}
	return totaloffset;
}

function iecompattest(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
	var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
	if (whichedge=="rightedge"){
		var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
		dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
		if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
			edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
		}
	else{
		var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
		dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
		if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
			edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
	}
	return edgeoffset
}

function showhint(menucontents, obj, e, tipwidth){
	if ((ie||ns6) && document.getElementById("hintbox")){
		dropmenuobj=document.getElementById("hintbox")
		dropmenuobj.innerHTML=menucontents
		dropmenuobj.style.left=dropmenuobj.style.top=-500
		if (tipwidth!=""){
			dropmenuobj.widthobj=dropmenuobj.style
			dropmenuobj.widthobj.width=tipwidth
		}
		dropmenuobj.x=getposOffset(obj, "left")
		dropmenuobj.y=getposOffset(obj, "top")
		dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
		dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
		dropmenuobj.style.visibility="visible"
		obj.onmouseout=hidetip
	}
}

function hidetip(e){
	dropmenuobj.style.visibility="hidden"
	dropmenuobj.style.left="-500px"
}

function createhintbox(){
	var divblock=document.createElement("div")
	divblock.setAttribute("id", "hintbox")
	document.body.appendChild(divblock)
}

if (window.addEventListener)
	window.addEventListener("load", createhintbox, false)
else if (window.attachEvent)
	window.attachEvent("onload", createhintbox)
else if (document.getElementById)
window.onload=createhintbox

// tooltip scripti bitti ------------------------------------------



var req;
function Initialize(){
	try{req=new ActiveXObject("Msxml2.XMLHTTP");}
	catch(e){try{req=new ActiveXObject("Microsoft.XMLHTTP");}
	catch(oc) {req=null;}
	}
	if(!req&&typeof XMLHttpRequest!="undefined") {
		req= new XMLHttpRequest();

	}
} 

function ilceDegis(id,ilce_id){
	Initialize(); 
	var url="xml/ilce1.asp?id="+ id +"&ilce_id="+ ilce_id +"&randomSayi="+ Math.random();

	if(req!=null){


			req.onreadystatechange=ilceProcess;
			req.open("GET" ,url, true);
			req.send(null);
	}
}

function ilceProcess(){

			if (req.readyState==4)
  {// 4 = "loaded"
  if (req.status==200)
    {// 200 = OK
    document.getElementById("ilce_id").innerHTML=unescape(req.responseText);


    }
  else
    {
    alert("Problem retrieving XML data");
    }
  }
	
}






function mahalleDegis(id,ilce_id){
	Initialize(); 
	var url="xml/mahalle1.asp?id="+ id +"&mahalle_id="+ ilce_id +"&randomSayi="+ Math.random();
	
if(req!=null){
			req.onreadystatechange=mahalleProcess;
			req.open("GET" ,url, true);
			req.send(null);
	}
}

function mahalleProcess(){

			if (req.readyState==4)
  {// 4 = "loaded"
  if (req.status==200)
    {// 200 = OK
    document.getElementById("mahalle_id").innerHTML=unescape(req.responseText);
    }
  else
    {
    alert("Problem retrieving XML data");
    }
  }


	
}




function ilceDegis2(id,ilce_id){
	Initialize(); 
	var url="xml/ilce2.asp?id="+ id +"&ilce_id="+ ilce_id +"&randomSayi="+ Math.random();

	if(req!=null){


			req.onreadystatechange=ilceProcess2;
			req.open("GET" ,url, true);
			req.send(null);
	}
}

function ilceProcess2(){

			if (req.readyState==4)
  {// 4 = "loaded"
  if (req.status==200)
    {// 200 = OK
    document.getElementById("ilce_id2").innerHTML=unescape(req.responseText);
    }
  else
    {
    alert("Problem retrieving XML data");
    }
  }
	
}






function mahalleDegis2(id,ilce_id){
	Initialize(); 
	var url="xml/mahalle2.asp?id="+ id +"&mahalle_id="+ ilce_id +"&randomSayi="+ Math.random();
	
if(req!=null){
			req.onreadystatechange=mahalleProcess2;
			req.open("GET" ,url, true);
			req.send(null);
	}
}

function mahalleProcess2(){

			if (req.readyState==4)
  {// 4 = "loaded"
  if (req.status==200)
    {// 200 = OK
    document.getElementById("mahalle_id2").innerHTML=unescape(req.responseText);
    }
  else
    {
    alert("Problem retrieving XML data");
    }
  }


	
}




function koyDegis(id,mahalle_id){
	Initialize(); 
	var url="xml/koy2.asp?id="+ id +"&koy_id="+ mahalle_id +"&randomSayi="+ Math.random();
	
if(req!=null){
			req.onreadystatechange=koyProcess;
			req.open("GET" ,url, true);
			req.send(null);
	}
}

function koyProcess(){

			if (req.readyState==4)
  {// 4 = "loaded"
  if (req.status==200)
    {// 200 = OK
    document.getElementById("koy_id").innerHTML=unescape(req.responseText);
    }
  else
    {
    alert("Problem retrieving XML data");
    }
  }


	
}



function mevkiDegis(id,koy_id){
	Initialize(); 
	var url="xml/mevki2.asp?id="+ id +"&mevki_id="+ koy_id +"&randomSayi="+ Math.random();
	
if(req!=null){
			req.onreadystatechange=mevkiProcess;
			req.open("GET" ,url, true);
			req.send(null);
	}
}

function mevkiProcess(){

			if (req.readyState==4)
  {// 4 = "loaded"
  if (req.status==200)
    {// 200 = OK
    document.getElementById("mevki_id").innerHTML=unescape(req.responseText);
    }
  else
    {
    alert("Problem retrieving XML data");
    }
  }


	
}




/* otomatik fiyata dönüştürücü */
function currencyFormat(fld, milSep, decSep, e) {
  var sep = 0;
  var key = '';
  var i = j = 0;
  var len = len2 = 0;
  var strCheck = '0123456789';
  var aux = aux2 = '';
  var whichCode = (window.Event) ? e.which : e.keyCode;

  if (whichCode == 13) return true;  // Enter
  if (whichCode == 8) return true;  // Delete
  key = String.fromCharCode(whichCode);  // Get key value from key code
  if (strCheck.indexOf(key) == -1) return false;  // Not a valid key
  len = fld.value.length;
  for(i = 0; i < len; i++)
  if ((fld.value.charAt(i) != '0') && (fld.value.charAt(i) != decSep)) break;
  aux = '';
  for(; i < len; i++)
  if (strCheck.indexOf(fld.value.charAt(i))!=-1) aux += fld.value.charAt(i);
  aux += key;
  len = aux.length;
  if (len == 0) fld.value = '';
  if (len == 1) fld.value = '0'+ decSep + '0' + aux;
  if (len == 2) fld.value = '0'+ decSep + aux;
  if (len > 2) {
    aux2 = '';
    for (j = 0, i = len - 3; i >= 0; i--) {
      if (j == 3) {
        aux2 += milSep;
        j = 0;
      }
      aux2 += aux.charAt(i);
      j++;
    }
    fld.value = '';
    len2 = aux2.length;
    for (i = len2 - 1; i >= 0; i--)
    fld.value += aux2.charAt(i);
    fld.value += decSep + aux.substr(len - 2, len);
  }
  return false;
}
/* otomatik fiyata dönüştürücü */



// sadece sayı scripti ------------------------------------------

var isIE = document.all?true:false;
var isNS = document.layers?true:false;
function onlyDigits(e) {
var _ret = true;
if (isIE) {
		if (window.event.keyCode < 47 || window.event.keyCode > 57) {
				window.event.keyCode = 0;
				_ret = false;
			}
}
if (isNS) {
		if (e.which < 47 || e.which > 57) {
				e.which = 0;
				_ret = false;
		}
}
return (_ret); 
}

// sadece sayı scripti bitti ------------------------------------------
