var ie = (document.all) ? 1 : 0;

var disableOnClickMap = 0;
var zoomIn;
var curImgWidth;
var curImgHeight;
var eventSorguFlag = 0;
var eventPanFlag = 0;
panLeftlick = 0;



function yukleniyor(strDiv) {

document.getElementById(strDiv).style.display = "block";
document.getElementById(strDiv).innerHTML = "<div align=center><img src='images/worldSmall.png'/><br/><font color='#333333'>Yükleniyor...</font><br/><br/></center>";

}

function rightClickDisable() {	//FONKSIYON OLARAK BURAYA TASINDI Ozgur KUVVET 08-11-2011

		// SAG TIKLAYINCA WINDOWS MENU ACILMASINI ENGELLEDIK 12-01-2011 Ozgur KUVVET
		
		var message="";
		function clickIE() {if (document.all) {(message);return false;}}
		function clickNS(e) {if 
		(document.layers||(document.getElementById&&!document.all)) {
		if (e.which==2||e.which==3) {(message);return false;}}}
		if (document.layers) 
		{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
		else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

		document.oncontextmenu=new Function("return false");

}

function chooseEvent(str) {	// SECTIGIMIZ BUTONA GORE BUTON RENKLERINI VE EVENTFLAG LARI DEGISTIREN FONKSIYON Ozgur KUVVET 07-11-2011

document.getElementById('resizeToolSorgu').style.display = "none";

document.getElementById('btnZoomInRect').style.backgroundColor = "black";
document.getElementById('btnZoomToExt').style.backgroundColor = "black";
document.getElementById('btnZoomOut').style.backgroundColor = "black";
document.getElementById('btnZoomIn').style.backgroundColor = "black";
document.getElementById('btnMeasure').style.backgroundColor = "black";
document.getElementById('btnInfo').style.backgroundColor = "black";
document.getElementById('btnPan').style.backgroundColor = "black";
document.getElementById('btn3D').style.backgroundColor = "black";

//eventFlag = 0;
eventPanFlag = 0;
panLeftClick = 0;
eventSorguFlag = 0;
doZoomIn = 0;
doZoomOut = 0;
ClearMeasure();

	switch(str) {
	
		case 'sorgu':
		eventFlag = 4;
		document.getElementById("map").style.cursor = "default";
		document.getElementById('closeRelTable').style.display = "none";
		break;

		case 'btnPan':
		eventPanFlag = 1;
		document.getElementById('btnPan').style.backgroundColor = "red";
		document.getElementById('map').style.cursor = "move";
		break;

		case 'btnInfo':
		eventFlag = 2;
		document.getElementById('btnInfo').style.backgroundColor = "red";
		document.getElementById('map').style.cursor = "help";
		document.getElementById('closeRelTable').style.display = "none";
		break;

		case 'btnMeasure':
		eventFlag = 3;
		document.getElementById('btnMeasure').style.backgroundColor = "red";
		document.getElementById("map").style.cursor = "url('images/pen.cur'),default";
		document.getElementById('closeRelTable').style.display = "none";
		break;
		
		case 'btnZoomToExt':
		eventFlag = 15;
		document.getElementById('btnZoomToExt').style.backgroundColor = "red";
		break;
		
		case 'btnZoomInRect':
		eventFlag = 1;
		document.getElementById("btnZoomInRect").style.backgroundColor = "red";
		document.getElementById("map").style.cursor = "crosshair";
		break;
		
		case 'btnZoomIn':
		eventFlag = 8;
		document.getElementById("btnZoomIn").style.backgroundColor = "red";
		document.getElementById("map").style.cursor = "url('images/zoomIn.cur'),default";
		doZoomIn = 1;
		break;
		
		case 'btnZoomOut':
		eventFlag = 9;
		document.getElementById("btnZoomOut").style.backgroundColor = "red";
		document.getElementById("map").style.cursor = "url('images/zoomOut.cur'),default";
		doZoomOut = 1;
		break;
		
		case 'btn3D':
		eventFlag = 9;
		document.getElementById("btn3D").style.backgroundColor = "red";
		document.getElementById("map").style.cursor = "default";
		doZoomOut = 1;
		break;

		default:;
	}
}

// SELECT OZELLIGINI DISABLE YAPAN FONKSIYON
function disableSelect(el){			
    if(el.attachEvent){
        el.attachEvent("onselectstart",disabler);
    } else {
        el.addEventListener("mousedown",disabler,"false");
    }
}
 
function enableSelect(el){
    if(el.attachEvent){
        el.detachEvent("onselectstart",disabler);
    } else {
        el.removeEventListener("mousedown",disabler,"false");
    }
}
 
function disabler(e){
    if(e.preventDefault){ e.preventDefault(); }
    return false;
} 


// BUTONLARIN ONMOUSEOVER da CIKAN ACIKLAMA MESAJLARI

function mesajGoster(str,strColor) {

	document.getElementById('mesaj').innerHTML = '<nobr>' + str + '</nobr>';
	document.getElementById('mesaj').style.backgroundColor = strColor;
	document.getElementById('mesaj').style.padding = '3px';

}

//-----------------------------------------------------
// BUTONLARIN ONMOUSEOUT DURUMUNDA
	
function mesajGizle(strColor) {
	
	document.getElementById('mesaj').innerHTML = '';
	document.getElementById('mesaj').style.backgroundColor = strColor;
	document.getElementById('mesaj').style.padding = '0';
	
}

//-----------------------------------------------------

var jg;
var jg1;
var measurePointsX = new Array();
var measurePointsY = new Array();
var eventFlag		= 0; //1-rect zoom 2-Info 3-Measure 4-

function pencereGosterSorgu(str,sorguTitle) { // POPUP PENCERELERI GOSTEREN FONKSIYONLAR

	if(!ie){
	document.getElementById('styled_popup_sorgu_table').style.maxHeight = "150px";
	}
	document.getElementById("resizeToolSorgu").style.display = "none";
	
	chooseEvent('sorgu');
	
	document.getElementById("styled_popup_sorgu").style.top = "115";

	document.getElementById("styled_popup_info").style.display = "none";
	document.getElementById("styled_popup_measure").style.display = "none";
	document.getElementById("styled_popup_sorgu").style.display = "block";
	document.getElementById("styled_popup_sorgu").style.width = "366px";
	document.getElementById("styled_popup_sorgu_table").style.width = "366px";
	document.getElementById("sorguFormBack").style.width = "366px";
	
	var pencereContent='';
	var radioButtons = '<tr><td colspan="3" class="beyazRenk"><div id="showRadioButtons" style="visibility:hidden;"><input type="radio" name="kelime" id="tamKelime" value="tamKelime" class="inputRadio">Tam Metin <input type="radio" name="kelime" id="icerenKelime" value="icerenKelime" class="inputRadio" checked>Metini içeren <input type="radio" name="kelime" id="baslayanKelime" value="baslayanKelime" class="inputRadio">Metin ile başlayan</div></td></tr>';
	
	if(str=="ada"){
		document.getElementById("styled_popup_sorgu_table").innerHTML = "";
		document.getElementById("styled_popup_sorgu_table").style.display = "none";
		//document.getElementById('pencereContent').style.margin = "5px 25px 25px 12px";
		document.getElementById('map').style.cursor = "default";
		pencereContent = '<div id=divSorgu class=divSorgu><table border="0"><tr><td colspan="3" height="25" valign="top" align="right" class="adaParsel"><img src="images/bulb.png"/> 189/8 ya da 189/* şeklinde giriniz.</td></tr><tr><td><font color="#FFFFFF">Ada /Parsel No: </font>&nbsp;</td><td><input id="adaParselNo" name="adaParselNo" class="input"></input></td><td valign=top>&nbsp;<button id="adaParselSor" onClick="AdaParselBul()" class="button7"><img src="images/buttons/buttonAra.png"/></button></td></tr><tr><td><font color="#FFFFFF">Mahalle: </font>&nbsp;</td><td><input id="mahalle" name="mahalle" class="input" onfocus="showRadioButtons();"></input></td><td valign=top>&nbsp;<button id="mahalleSor" onClick="AdaParselMahBul()" class="button7"><img src="images/buttons/buttonAra.png"/></button></td></tr>'+radioButtons+'</table></div>';
         	} else if (str == "neczane") {
    		document.getElementById("styled_popup_sorgu_table").innerHTML = "";
   		document.getElementById("styled_popup_sorgu_table").style.display = "none";
		pencereContent = '<div id=divSorgu class=divSorgu style=text-align:center;><IFRAME width="420" allowtransparency="true" class="neczane" name="frame_ismi" src="http://portal.belsis.local/inegol.bel.tr/eczaneler1.php" scrolling="auto" frameborder="0" marginwidth="0" marginheight="0" hspace="-25" align="center"></IFRAME></div>';

        	} else if (str == "cadde") {
		document.getElementById("styled_popup_sorgu_table").innerHTML = "";
		document.getElementById("styled_popup_sorgu_table").style.display = "none";
		pencereContent = '<div id=divSorgu class=divSorgu><table border=0 id=caddeSorguTable height=57><tr><td><font color="#FFFFFF">Cadde / Sokak Adı: </font>&nbsp;</td><td><input id=caddeSokakAdi name=caddeSokakAdi class="input" value="" onfocus="showRadioButtons();"></input></td><td>&nbsp;<button id=btnCaddeSokakAdi onClick="CaddeSokakBul()" class=button7><img src="images/buttons/buttonAra.png"/></button></td></tr><tr><td align="right" height="25">&nbsp;<!--<font color="#FFFFFF">Kapı No: </font>&nbsp;</td><td><input id=kapiNo name=kapiNo class="input" value=""></input></td><td>&nbsp;<button id=btnAdresBul onClick="AdresBul()" class=button7><img src="images/buttons/buttonAra.png"/></button>--></td></tr>' + radioButtons + '</table></div>';
		} else if(str=="onemli"){
		document.getElementById("styled_popup_sorgu_table").innerHTML = "";	
		document.getElementById("styled_popup_sorgu_table").style.display = "none";	
		pencereContent = '<div id=divSorgu class=divSorgu><table height=57><tr><td><font color="#FFFFFF"><nobr>Önemli Yer : </nobr></font>&nbsp;</td><td><select name="cbOnemliYer" id="cbOnemliYer" class="inputSelect" onchange="hideRadioButtons();"><option value="">Önemli Yer Seçiniz</option><option value="BANKA">Bankalar</option><option value="BELEDIYE_BINALARI">Belediye Binaları</option><option value="CAMI">Camiler</option><option value="ECZANE">Eczaneler</option><option value="EGITIM">Eğitim</option><option value="MAHALLE">Mahalleler</option><option value="RESMI">Resmi Kurumlar</option><option value="SAGLIK">Sağlık</option><option value="SANAYI">Sanayi</option><option value="SOSYAL_KULT">Sosyal Kültürel</option><option value="SPOR">Spor</option></select></td><td></td></tr><tr><td align="right"><font color="#FFFFFF">Adı: </font>&nbsp;</td><td><input type="text" name="onemliYerAdi" id="onemliYerAdi" size="25" class="input" onfocus="showRadioButtons();"></input></td><td>&nbsp;<button id="btnOnemliYer" onClick="OnemliYerBul()" class="button7"><img src="images/buttons/buttonAra.png"/></button></td></tr>'+radioButtons+'</table></div>';
		} else {
		document.getElementById("styled_popup_sorgu_table").innerHTML = "";
		document.getElementById("styled_popup_sorgu_table").style.display = "none";		
		pencereContent = '<div id=divSorgu class=divSorgu><table id="kentliSorguTable" height=110 cellpadding=0 cellspacing=0><tr><td align=left><table width=315><tr><td align=right><font color="#FFFFFF">Adı : </font></td><td>&nbsp;<input id=kentliAdi name=kentliAdi size="25" class="input" onclick="enableSelect(document.body);this.focus();" onblur="disableSelect(document.body)"></input></td></tr><tr><td align=right><font color="#FFFFFF">Soyadı : </font></td><td>&nbsp;<input id=kentliSoyadi name=kentliSoyadi size="25" class="input" onclick="enableSelect(document.body);this.focus();" onblur="disableSelect(document.body)"></input></td></tr><tr><td align=right><font color="#FFFFFF">Sicil No : </font></td><td>&nbsp;<input id=gttsicilno name=gttsicilno size="25" class="input" onclick="enableSelect(document.body);this.focus();" onblur="disableSelect(document.body)"></input></td></tr><tr><td align=right><font color="#FFFFFF">TC Kimlik No :</font></td><td>&nbsp;<input id=tcKimlikNo name=tcKimlikNo size="25" class="input" onclick="enableSelect(document.body);this.focus();" onblur="disableSelect(document.body)"></input></td><td>&nbsp;&nbsp;<button id=btnKentliAra onClick="kentliAra()" class="button7"><img src=images/buttons/buttonAra.png /></button></td></tr></table></td></tr>'+radioButtons+'</table></div>';			
		}
		
		document.getElementById("pencereContent").innerHTML = pencereContent;
		document.getElementById("sorguTitle").innerHTML = sorguTitle;

		if (str == "neczane") {
		document.getElementById("styled_popup_sorgu").style.width = document.getElementById("divSorgu").offsetWidth + 40 + "px";
		}


}

function closeRelTable() {	// ILISKILI VERI SETLERI PENCERESINI KAPATTIGIMIZ FONKSIYON Ozgur KUVVET 04-02-2011
	
document.getElementById('styled_popup_iliskili_table').style.display='none';
addResizeButton('styled_popup_info_table','styled_popup_iliskili_table','resizeTool');
document.getElementById('closeRelTable').style.display = "none";

}

function pencereGizleSorgu() { // SORGU PENCERELERINI KAPATTIGIMIZ FONKSIYON

	document.getElementById("styled_popup_sorgu").style.width="366px";
	document.getElementById("sorguFormBack").style.width="366px";
	document.getElementById("styled_popup_sorgu_table").style.width = document.getElementById("styled_popup_sorgu").offsetWidth + "px";
	document.getElementById("resizeToolSorgu").style.width = document.getElementById("styled_popup_sorgu").offsetWidth + "px";
	document.getElementById("styled_popup_sorgu").style.display = "none";
	eventFlag = 15;
	eventSorguFlag = 0;
	eventPanFlag = 0;
	panLeftlick = 0;
	
}

function btnMeasureClick(){ // OLCME ISLEMI BUTONUNA TIKLADIGIMIZDA

  //if (eventFlag != 3) {
	 chooseEvent('btnMeasure');

	 click2 = 0;
     //window.event.srcElement.style.borderStyle = "inset";
	 //eventFlag = 3;
	 //document.getElementById("map").style.cursor = "url('images/pen.cur'),default";
     document.getElementById('styled_popup_measure').style.display = "block";
     document.getElementById("styled_popup_measure").style.top="115";
	 //document.getElementById('btnMeasure').style.backgroundColor="red";
	 //document.getElementById('btnInfo').style.backgroundColor="black";
	 //document.getElementById('btnPan').style.backgroundColor = "black";
	 //document.getElementById('btnZoomInRect').style.backgroundColor="black";
     //btnZoomInRect.style.borderStyle = "outset";     
     isZoomRectEvent = 0; 
 
     //btnInfo.style.borderStyle="outset";
     document.getElementById("styled_popup_info").style.display="none";
	 document.getElementById("styled_popup_sorgu").style.display="none";
 
 /* }
  else
  {
     eventFlag = 0;
	 ClearMeasure();
	 click2 = 0;
     //window.event.srcElement.style.borderStyle = "outset";
	 document.getElementById('btnMeasure').style.backgroundColor="black";
     document.getElementById("styled_popup_measure").style.display="none";
	 document.getElementById("map").style.cursor = "default";
     ClearMeasure();
    }  */
}

function btnInfoClick(){ // INFO BUTONUNA TIKLADIGIMIZDA	

	chooseEvent('btnInfo');
 	  //eventFlag = 2; 
  	  //document.getElementById("map").style.cursor = "help";
     //window.event.srcElement.style.borderStyle = "inset"; 

	 document.getElementById('styled_popup_info_table').innerHTML="";
     document.getElementById('styled_popup_info').style.display="block";
     if(ie) {
     document.getElementById('styled_popup_info_table').style.width="365";
     document.getElementById('styled_popup_iliskili_table').style.width="365";
     } else {
     document.getElementById('styled_popup_info_table').style.width="363";
     document.getElementById('styled_popup_iliskili_table').style.width="363";
     }
     
     document.getElementById('styled_popup_iliskili_table').innerHTML="";
     document.getElementById('infoTable').style.width="";
 	 var comboBox = document.getElementById('cbRelTableItems');
	 comboBox.innerHTML = '';
	 
	 //document.getElementById("iliskiliText").style.visibility = "hidden";
	 document.getElementById("cbRelTableItems").style.visibility = "hidden";
	 document.getElementById("resizeTool").style.display = "none";
	 
	 document.getElementById('styled_popup_info_table').innerHTML="<div style='padding:10px; color:#333333; height:50px; margin-top:8px;'><div style='float:left; width:25px;'><img src='images/icon.gif' style='vertical-align:middle' /></div><div style='float:right; width:310px;'>Lütfen harita üzerinde bilgi almak istediğiniz noktaya tıklayın.</div></div>";
     document.getElementById('styled_popup_info').style.top="115px";

     //btnZoomInRect.style.borderStyle = "outset";
     isZoomRectEvent = 0;     
     //btnMeasure.style.borderStyle = "outset"; 
     document.getElementById("styled_popup_measure").style.display="none";
	 document.getElementById("styled_popup_sorgu").style.display="none"; 
	 
	 document.getElementById('styled_popup_iliskili_table').style.display="none";
     //ClearMeasure();  

 /* } else {
     eventFlag = 0;
	 //ClearMeasure();
     document.getElementById("styled_popup_info").style.display="none";
	 document.getElementById('btnInfo').style.backgroundColor="black";
	 document.getElementById("map").style.cursor = "default";
     //window.event.srcElement.style.borderStyle = "outset";
            
  }  */

}

// YARDIM BUTONUNA TIKLANDIGINDA
function btnHelpClick() {
	//eventFlag = 5;
	document.getElementById("styled_popup_yardim").style.display="block";
	document.getElementById("styled_popup_yardim").bottom="20px";
	document.getElementById("styled_popup_yardim").right="20px";
}

// ACILAN PENCERELERI SURUKLEME 

function init() {

document.onmousedown=selectmouse;

document.onmouseup=new Function("isdrag=false;");
   
}

window.onload = init;


var ie = document.all;
var nn6 = document.getElementById &&! document.all;

var isdrag = false;
var x, y;
var dobj;


function movemouse( e ) {
	
    var t = screen.width;
    var z = screen.height;
    var h = ie ? window.event.clientX : e.clientX;
    var m = ie ? window.event.clientY : e.clientY;

  if(isdrag) {

	if(eventFlag==100) { // RESIM ICIN ACILAN MESAJ PENCERESININ SURUKLEME KONTROLLERI
		
		if(ie) { // INTERNET EXPLORER
		   if((tx + event.clientX - x)<screen.width-50 && (tx + event.clientX - x)>-800 && (ty + event.clientY - y)>10 && (ty + event.clientY - y)<(screen.height-400)){
    	   dobj.style.left = tx + event.clientX - x;
    	   dobj.style.top  = ty + event.clientY - y;
    	   return false;
		   }
		} else { // MOZILLA
		   if((tx + e.clientX - x)<screen.width-50 && (tx + e.clientX - x)>-800 && (ty + e.clientY - y)>10 && (ty + e.clientY - y)<(screen.height-300)){
	       dobj.style.left = tx + e.clientX - x;
	       dobj.style.top  = ty + e.clientY - y;
	       return false;
		   }
		}

	} else { // HATA MESAJLARI ICIN ACILAN PENCERENIN SURUKLEME KONTROLLERI
		
    if((h < 50) || (h > (t-10)) || (m < 129) || m > (z-200)) {

	   if((dobj.style.left).substring(0,(dobj.style.left).length-2) > 574 && m < 129) {
		   
		   	if(m < 10) {		
			dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
    		dobj.style.top  = 10;
    		return false;
			} else {
			dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
    		dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y;
			return false;
			}
			
	} else {
		
			dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
    		dobj.style.top  = 129;
    		return false;
    		
		}			

		if(h < 50) {
			    dobj.style.left = 10;
    			dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y;
    			return false;
		}

		if(h > (t-50)) {
			dobj.style.left = (t-100);
    			dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y;
return false;
        	}

		if(m > (z-100)) {
    			dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
    			dobj.style.top  = (z-0);
    			return false;
		}

    } else {

    	dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
    	dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y;
    	return false;


    }
	}
  }
}

function doSomething(e) {
	var rightclick;
	if (!e) var e = window.event;
	if (e.which) rightclick = (e.which == 3);
	else if (e.button) rightclick = (e.button == 2);
	return rightclick;
}

function selectmouse( e ) {
  var fobj       = nn6 ? e.target : event.srcElement;
  var topelement = nn6 ? "HTML" : "BODY";
  
  while (fobj.tagName != topelement && fobj.className != "dragme") {
    fobj = nn6 ? fobj.parentNode : fobj.parentElement;
  }
//alert(fobj.className);
  if (fobj.className=="dragme" ) {
    if(doSomething(e)==false) {
	isdrag = true;
	} else {
	isdrag = false; 
	}
    
    switch (eventFlag){		// EVENTFLAG DURUMUNA GORE ACIK OLAN PENCEREYI SURUKLENECEK PENCERE OLARAK BELIRLIYORUZ

      case 2:  dobj = document.getElementById("styled_popup_info");
               break;
      case 3:  dobj = document.getElementById("styled_popup_measure");
               break; 
      case 4:  dobj = document.getElementById("styled_popup_sorgu");	
               break;
      case 5:  dobj = document.getElementById("styled_popup_yardim");	
      		   break;
      case 100:  dobj = document.getElementById("msgPanel");	
      		   break; 
      		   
    }
    
    tx = parseInt(dobj.style.left+0);
    ty = parseInt(dobj.style.top+0);
    x = nn6 ? e.clientX : event.clientX;
    y = nn6 ? e.clientY : event.clientY;
    document.onmousemove=movemouse;
    return false;
  }
}

// ALERT LERIN YERINE BUTUN HATA MESAJLARINI YAZDIRDIGIMIZ ACILAN PENCERE

// ACILAN IMAGE PENCERESININ UZERINDE ZOOM IN / ZOOM OUT / PAN BUTONLARI Ozgur KUVVET 09-02-2011
var imgTools = "<div id='imgTools' class='imgTools''>";
imgTools = imgTools + "<div style='float:left;cursor:pointer;' id='imgZoomIn'><img id='btnImgZoomIn' src='images/buttons/imgZoomIn.gif' border='0'/></div>";
imgTools = imgTools + "<div style='float:left;cursor:pointer;' id='imgZoomOut'><img id='btnImgZoomOut'  src='images/buttons/imgZoomOut.gif' border='0'/></div>";
//imgTools = imgTools + "<div style='float:left;cursor:pointer;' id='imgPan'><img id='btnImgPan' src='images/buttons/imgPan.gif' border='0'/></div>";
imgTools = imgTools + "<div style='float:right;cursor:pointer;' id='imgPrint' onclick='printImage()'><img id='btnImgPrint' src='images/buttons/imgPrint.gif' border='0'/></div>";
imgTools = imgTools + "</div>";
//-----------------------------------------------------------------------------------------------

var imgWidth = 400; // RESIM GENISLIGI
var imgHeight = 0;
var thumbWidth = 0;
var thumbHeight = 0;

function msgGoster(strMsg,strImage) {
	
	//alert(strImage);

	var msgBack = document.getElementById('msgBack');
	var msgPanel = document.getElementById('msgPanel');
	
	if(strImage){ // ACILAN MESAJ PENCERESINDE RESIM GOSTERME

		eventFlag = 100;
		var strImg="";
	
		var objImg = new Image();
		objImg.src = strImage;   
		objImg.onload = function() {

			strImg += "<div id='zoomText' style='display:none;font-weight:normal;'>"+imgTools+"</div><br/>";
			strImg += "<div id='imgPanel' class='imgPanel'>";
			strImg += "<img id='image' border='0' style='border:10px solid #CCCCCC;' src=" + strImage + ">";
			strImg += "</div>";
	
			msgBack.style.display = "block";
			msgPanel.style.display = "block";
			
			msgPanel.style.width = imgWidth + 200 + "px";
			msgPanel.style.height = (screen.height-400)+"px";		
			
			msgPanel.style.top = "70px";
			msgPanel.style.background="#FFFFFF";
			msgPanel.innerHTML = msgPanel.innerHTML + '<br/>'+strImg+'<br/><br/>';
			msgPanel.style.left = ((screen.width/2)-((imgWidth + 200)/2)) + "px";
			
			imgHeight = (screen.height-500);
	
			curImgWidth = document.getElementById('image').offsetWidth;
			curImgHeight = document.getElementById('image').offsetHeight;

			// HIDDEN INPUT LARA RESIM BILGILERINI GIRIYORUZ			
			document.getElementById('curImgWidth').value = curImgWidth;
			document.getElementById('curImgHeight').value = curImgHeight;
			
			if(curImgHeight<400) { 
			
			document.getElementById('image').style.marginTop = "70px";
			
				if(curImgHeight<200) { 
					document.getElementById('image').style.marginTop = "150px";
				} 
				
			}

			if(curImgWidth>imgWidth || curImgHeight>imgHeight) {
	
				if(curImgWidth>imgWidth) {
					
					document.getElementById('image').style.width = imgWidth + "px";
					
					var curImgHeight1 = document.getElementById('image').offsetHeight;
					
					if(curImgHeight1>imgHeight) {
						document.getElementById('image').style.height = imgHeight + "px";
					}
					
				} else if(curImgHeight>imgHeight) {
					
					document.getElementById('image').style.height = imgHeight + "px";
					
					var curImgWidth1 = document.getElementById('image').offsetWidth;
					
					if(curImgWidth1>imgWidth) {
						document.getElementById('image').style.width = imgWidth + "px";
					}
					
				}
				
				// RESIME VERILMIS BORDER GENISLIGINI BULUYORUZ
				var imgBorderWidth = (document.getElementById('image').style.borderWidth).replace('px','');

				// RESIMIN KUCUK HALININ BOYUTLARIN DEGISKENLERE ATIYORUZ BORDER GENISLIGINI DE 2 ILE CARPIP CIKARIYORUZ
				thumbWidth = document.getElementById('image').offsetWidth - (imgBorderWidth*2);	
				thumbHeight = document.getElementById('image').offsetHeight - (imgBorderWidth*2);
				
				document.getElementById('curImgWidth').value = thumbWidth;
				document.getElementById('curImgHeight').value = thumbHeight;
				
				document.getElementById('zoomText').style.display = "block";	
				document.getElementById('imgZoomIn').onclick = Function("imgZoom(1,"+curImgWidth+");");
				document.getElementById('imgZoomOut').style.cursor = "default";
				document.getElementById('btnImgZoomOut').src = "images/buttons/imgZoomOut1.gif";
				
				document.getElementById('msgPanel').overflow = "hidden";
				document.getElementById('imgPanel').overflow = "hidden";

			} else {	// RESIM 400 px DEN KUCUKSE 
			
				document.getElementById('zoomText').style.display = "block";
				
				document.getElementById('btnImgZoomOut').src = "images/buttons/imgZoomOut1.gif";
				document.getElementById('imgZoomOut').style.cursor = "default";
				
				document.getElementById('btnImgZoomIn').src = "images/buttons/imgZoomIn1.gif";
				document.getElementById('imgZoomIn').style.cursor = "default";
				
			}

		}
	
	} else { // ACILAN MESAJ PENCERESINDE HATA MESAJLARI
	
		msgPanel.style.zIndex = "210000000000000000000000000000000";
		
		msgPanel.style.width = "250";
		msgPanel.style.height = "150";
    	msgPanel.style.left = ((screen.width/2)-125);
   		msgBack.style.display = "block";
    	msgPanel.style.display = "block";
    	msgPanel.style.top = "200px";
		
    	msgPanel.innerHTML = '<img src=images/err.png vspace=10><br/>';
		msgPanel.innerHTML = msgPanel.innerHTML + strMsg;
		msgPanel.innerHTML = msgPanel.innerHTML + ' !!<br/><br/><div id=kapat class=kapat><a href=# onClick=javascript:msgGizle() class=belsis>Kapat</a></div>';
    
	}
}

function imgZoom(zoomIn,curImgWidth) {
	
	var msgPanel = document.getElementById('msgPanel');
	var imgPanel = document.getElementById('imgPanel');
	var imgPanelbar = document.getElementById('imgPanelBar');
	var zoomText = document.getElementById('zoomText');
	var image = document.getElementById('image');
	
	if(zoomIn==1){	// ZOOM IN BUTONUNA TIKLANDIGINDA
		
	msgPanel.style.width = screen.width - 200 + "px";
	imgPanel.style.width = msgPanel.offsetWidth - 50 + "px";
	
	
	if(ie) {
		msgPanel.style.height = screen.height - 450 + "px";
		imgPanelBar.style.width = msgPanel.style.width;
	} else {
		msgPanel.style.height = screen.height - 400 + "px";
		imgPanelBar.style.width = msgPanel.style.width;
		imgPanelBar.style.width = imgPanelBar.offsetWidth + 40 + "px";
	}
	
	if(ie) {
		imgPanel.style.height = (msgPanel.style.height).replace('px','') + "px";
	} else {
		imgPanel.style.height = (msgPanel.style.height).replace('px','') - 60 + "px";
	}
	
	msgPanel.style.left = ((screen.width/2)-(msgPanel.offsetWidth/2)) + "px";
	
	zoomText.innerHTML = imgTools;
	image.style.width = curImgWidth + "px";
	image.style.height = curImgHeight + "px";
	
	document.getElementById('curImgWidth').value = curImgWidth;
	document.getElementById('curImgHeight').value = curImgHeight;
	
	document.getElementById('imgZoomIn').style.cursor = "default";
	document.getElementById('btnImgZoomIn').src = "images/buttons/imgZoomIn1.gif";
	//document.getElementById('imgPrint').style.cursor = "default";
	//document.getElementById('imgPrint').onclick = "";
	//document.getElementById('btnImgPrint').src = "images/buttons/imgPrint1.gif";
	zoomIn = 0;
	document.getElementById('imgZoomOut').onclick = Function("imgZoom("+zoomIn+","+curImgWidth+")");
	
	imgPanel.style.overflow = "scroll";
	
	} else {	// ZOOM OUT BUTONUNA TIKLANDIGINDA
		
	if(ie) { 
		msgPanel.style.width = imgWidth + 200 + "px";
		imgPanelBar.style.width = msgPanel.style.width;
	} else {
		msgPanel.style.width = imgWidth + 100 + "px";
		imgPanelBar.style.width = msgPanel.style.width;
		imgPanelBar.style.width = imgPanelBar.offsetWidth + 40 + "px";
	}
	
	imgPanel.style.width = imgWidth + 100 + "px";
	
	
	msgPanel.style.left = ((screen.width/2)-((imgWidth + 200)/2));
		
	zoomText.innerHTML = imgTools;

	//imgPanel.style.overflow = "scroll";
	document.getElementById('image').style.width = thumbWidth + "px";
	document.getElementById('image').style.height = thumbHeight + "px";
	
	document.getElementById('curImgWidth').value = thumbWidth;
	document.getElementById('curImgHeight').value = thumbHeight;

	zoomIn = 1;
	
	document.getElementById('imgZoomIn').onclick = Function("imgZoom("+zoomIn+","+curImgWidth+")");
	document.getElementById('imgZoomOut').style.cursor = "default";
	document.getElementById('btnImgZoomOut').src = "images/buttons/imgZoomOut1.gif";
	//document.getElementById('imgPan').style.cursor = "default";
	//document.getElementById('btnImgPan').src = "images/buttons/imgPan1.gif";
	
	imgPanel.style.overflow = "hidden";
	
	}

}

// ACILAN MESAJI KAPATTIGIMIZ FONKSIYON

function msgGizle() {
document.getElementById('msgBack').style.display = "none";
document.getElementById('msgPanel').style.display = "none";
document.getElementById('msgPanel').innerHTML = '<div id="imgPanelBar" class="dragme" style="background:#000000;height:30px;margin-top:-20px;margin-right:-20px;margin-left:-20px;text-align:right;"><a href="javascript:msgGizle();"><img src="images/x11_close.gif" border="0"></a>';
//document.getElementById('btnPan').style.backgroundColor = "black";



if(document.getElementById("styled_popup_info") && document.getElementById("styled_popup_info").style.display=="block") {
	eventFlag = 2;
}

if(document.getElementById("styled_popup_sorgu") && document.getElementById("styled_popup_sorgu").style.display=="block") {
	eventFlag = 4;
}

}



function btn3DClick() { // 3D HARITA ICIN ACILAN PENCERE 

eventFlag = 6;
chooseEvent('btn3D');


}


function btnPanClick() {	// PAN OZELLIGI ICIN EKLENEN BUTON Ozgur KUVVET 07-02-2011

	chooseEvent('btnPan');
	
}


// YARDIM PENCERESINI KAPATTIGIMIZ FONKSIYON
function styledYardimPopupClose() {
	
 document.getElementById("styled_popup_yardim").style.display = "none";
 eventFlag=0;  
 //document.getElementById('btnMeasure').style.backgroundColor = "black";
 document.getElementById("map").style.cursor  = "default";
 ClearMeasure();  
	
}

// OLCUM POPUP PENCERESINI KAPATTIGIMIZ FONKSIYON
function styledPopupClose() {
  document.getElementById("styled_popup_measure").style.display = "none";
  eventFlag=0;  
  //btnMeasure.style.borderStyle = "outset"; 
  document.getElementById('btnMeasure').style.backgroundColor = "black";
  document.getElementById("map").style.cursor  = "default";
  ClearMeasure();  
}

// INFO POPUP PENCERECINI KAPATTIGIMIZ FONKSIYON

function styledPopupInfoClose(){
  document.getElementById("styled_popup_info").style.display = "none";
  eventFlag=0;  
  //btnInfo.style.borderStyle = "outset"; 
  document.getElementById('btnInfo').style.backgroundColor = "black";
  document.getElementById("map").style.cursor  = "default";
}

// GELEN VERIYI BUYUK HARFE CEVIRDIGIMIZ FONKSIYON

function trUpperCase(inpElement){
tmp = inpElement.value;
tmp = inpElement;
tmp = tmp.replace(/i/,"İ");
tmp = tmp.replace(/ı/,"I");
tmp = tmp.toUpperCase();
inpElement.value = tmp;
}


// SAYFA ACILDIGINDA HARITAYI YUKLEYEN FONKSIYON

function haritaYukle() {

	init();

	disableSelect(document.body); // Sayfanin select ozelligini disable yapar

	document.getElementById('Map-panel').style.width = screen.width +"px";
	document.getElementById('Map-panel').style.height = screen.height +"px";
	document.getElementById('Map-panel').style.top = "0px";
	document.getElementById('Map-panel').style.bottom = "0px";
	document.getElementById('Map-panel').style.left = "0px";

	jg = new jsGraphics("Map-panel");
    	jg1 = new jsGraphics("Map-panel");
	map = document.getElementById("map");

	zoomRect = document.getElementById("ZoomRect");
	//zoomRectOuther = document.getElementById("ZoomRectOuther");

	var requestStr = getCapabilities();
	loadCapabilitiesXML(requestStr,'');
 
	InitializeZoomFactors();   // t0 aninda cur<Extensions> = proj<Extentions>
	//zoomingV2.js dosyasi 25.satırda mevcut 

	//mapOnResize() fonksiyonu buraya tasindi. mapOnresize FireFox ta calismiyordu. 24-11-2010 Ozgur KUVVET
	ClearMeasure();
  	click2 = 0;
  	eventFlag = 15;


// KODLAR ACILISTA HARITAYI KUCULTEREK EKRANA SIGDIRMAK ICIN EKLENDI Ozgur KUVVET 25-03-2011

	var DeltaX = ((curMaxX - curMinX)/(ZoomRatio-2));
	var DeltaY = ((curMaxY - curMinY)/(ZoomRatio-2));	
	
	curMinX = curMinX - DeltaX;
	curMinY = curMinY - DeltaY - 500;
	curMaxX = curMaxX + DeltaX;
	curMaxY = curMaxY + DeltaY - 500;
//-------------------------------------------------------------------------------------------



  	getMap(curMinX, curMinY, curMaxX, curMaxY);			

 	if (document.getElementById('externalAdaParselNo').value != "null")  {
		adaParselNo.value = externalAdaParselNo.value;
		AdaParselBul();
			    }
 	
	}	

// ILISKILI VERI SETLERI PENCERESINI, RESIZE YAPILDIKCA INFO PENCERESININ 
// KONUMUNA GORE KONUMLANDIRIR 07-01-2011 Ozgur KUVVET
// AYRICA ILISKILI VERI SETININ KAPATMA ICONUNU DA BURAYA EKLEDIM  04-02-2011 Ozgur KUVVET

function placeRelTable(strTable1,strTable2) {
	
	if(strTable2) {
		
		var iliskili_table = document.getElementById(strTable2);
		var closeIcon = document.getElementById('closeRelTable');
		var resizeTool = document.getElementById('resizeTool');
	
	}
	
	var info_table = document.getElementById(strTable1);
	var tableTop = info_table.offsetHeight;
	
	if(ie) {
	tableTop = tableTop;
	} else {
	tableTop = tableTop + 5;
	}
	
	if(strTable2) {

		if(document.getElementById('styled_popup_iliskili_table').style.display=="block") {
		closeIcon.style.display = "block";
		}
		closeIcon.style.marginTop = tableTop + "px";
		iliskili_table.style.marginTop = tableTop + closeIcon.offsetHeight + "px";
		if(ie) {	// INTERNET EXPLORER DA ILISKILI PENCERE KAPATMA ICONU CIKINCA ILISKILI PENCERE KAYIYOR DUZELTMEK ICIN ASAGIDAKI KODU EKLEDIM Ozgur KUVVET 07-02-2011
		iliskili_table.style.marginLeft = "-" + closeIcon.offsetWidth + "px";
		resizeTool.style.marginLeft = "-" + closeIcon.offsetWidth + "px";
		}
	}
	
}

// INFO PENCERESINI RESIZE YAPAR 07-11-2011 Ozgur KUVVET

function resizeWindow(e) {
	var ev=(!e)?window.event:e;
	if (ev.preventDefault) {ev.preventDefault();}
	disableOnClickMap = 0;
	document.onmousemove = MouseMove;
}

function MouseMove(e) {
	
	 var ell=(!e)?window.event:e;

	 disableOnClickMap = 1;
	//document.getElementById('logoBaslik').innerHTML = disableOnClickMap;
	
	if (eventFlag == 2) { // INFO PENCERESININ RESIZE DURUMLARI Ozgur KUVVET 31-01-2011
		
	 var strDivId3 = document.getElementById("styled_popup_info");
	 var resizeW = document.getElementById("styled_popup_info_table");
	 var resizeTool = document.getElementById("resizeTool");
	 var resizeW1 = document.getElementById("styled_popup_iliskili_table");
	 var resizeW2 = document.getElementById("infoTable");
	 var wLeft = strDivId3.offsetLeft;
	 
	 		if(ell.clientX>250 && ell.clientX<(screen.width-100)) {
			if(resizeW.offsetWidth>150) {
			resizeTool.style.cursor = "nw-resize";
			resizeW.style.width = (ell.clientX-wLeft)+"px";
			resizeW1.style.width = resizeW.style.width;
			resizeW2.style.width = resizeW.style.width;
			resizeTool.style.width = resizeW.style.width;
			}
			addResizeButton('styled_popup_info_table','styled_popup_iliskili_table','resizeTool');
			placeRelTable('styled_popup_info_table','styled_popup_iliskili_table');
		}
		return false;
	 
	} else {  // ACIK OLAN PENCERE INFO DEGILSE SORGU OLABILIR
	
		if(eventSorguFlag==1) {	// ONEMLI YER PENCERESININ RESIZE DURUMLARI Ozgur KUVVET 31-01-2011
		
	 		var strDivId3 = document.getElementById("styled_popup_sorgu");
			//var caddeSorguTable = document.getElementById("caddeSorguTable");
	 		//var divSorgu = document.getElementById("divSorgu");
	 		var resizeW = document.getElementById("styled_popup_sorgu_table");
	 		var resizeTool = document.getElementById("resizeToolSorgu");
	 		var wHeight = strDivId3.offsetTop;	
			var wWidth = strDivId3.offsetLeft;
			
			var sonucTableWidth = document.getElementById('sonucTable').offsetWidth;
			var sonucTableHeight = document.getElementById('sonucTable').offsetHeight;
				
				var kisaltmaLimit = screen.height - (ell.clientY-strDivId3.offsetTop);
				
	 			if(ell.clientY<screen.height-250 && kisaltmaLimit<800 ) { // DUSEYDE EN BUYUK VE EN KUCUK BOYUTU KONTROL EDER
				//if(resizeW.offsetHeight<100) { resizeW.style.height = 102; }
				if(!ie) { document.getElementById('styled_popup_sorgu_table').style.maxHeight = "1000px"; }
				resizeTool.style.cursor = "nw-resize";
				
				if(sonucTableHeight>100) { // DONEN KAYIT SAYISI AZ ISE YATAYDA UZATMAYI ENGELLIYORUZ
				resizeW.style.height = (ell.clientY-(wHeight+165))+"px";	// MOUSE UN RESIZE BUTONUN UZERINDE DURMASI ICIN
				}
				
				if((ell.clientX-strDivId3.offsetLeft)<sonucTableWidth+20) {	// YATAYDA EN BUYUK BOYUTU KONTROL EDIYOR
					
					if((ell.clientX-strDivId3.offsetLeft)>368) {  // YATAYDA EN KUCUK BOYUTU KONTROL EDIYOR
					
					//document.getElementById('logoBaslik').innerHTML = sonucTableWidth+" - "+sonucTableHeight;
					resizeW.style.width = (ell.clientX-(wWidth))+"px";
					strDivId3.style.width = (ell.clientX-(wWidth))+"px";
					
						if(ie){ 					
						document.getElementById('sorguFormBack').style.width = (ell.clientX-(wWidth+2))+"px";				
						} else {					
						document.getElementById('sorguFormBack').style.width = (ell.clientX-(wWidth))+"px";	
						}
					}
					
					//kentliSorguTable.style.width = (ell.clientX-(wWidth)-40)+"px";
					//document.getElementById('divSorgu').style.width = (ell.clientX-(wWidth)-40)+"px";
					
				}
				
				resizeTool.style.top = resizeW.style.top;
				addResizeButton('styled_popup_sorgu_table','','resizeToolSorgu');
			}
			return false;	
			
		} else if(eventSorguFlag==2) {	// KENTLI ARAMA PENCERESI ACIKCA	
		
			var strDivId3 = document.getElementById("styled_popup_sorgu");
			var kentliSorguTable = document.getElementById("kentliSorguTable");
	 		//var divSorgu = document.getElementById("divSorgu");
	 		var resizeW = document.getElementById("styled_popup_sorgu_table");
	 		var resizeTool = document.getElementById("resizeToolSorgu");
	 		var wHeight = strDivId3.offsetTop;	
			var wWidth = strDivId3.offsetLeft;
			
			var kentliSonucTableWidth = document.getElementById('sonucTable').offsetWidth;
			var kentliSonucTableHeight = document.getElementById('sonucTable').offsetHeight;
				
				var kisaltmaLimit = screen.height - (ell.clientY-strDivId3.offsetTop);
				
	 			if(ell.clientY<screen.height-250 && kisaltmaLimit<730) { // DUSEYDE EN BUYUK VE EN KUCUK BOYUTU KONTROL EDER

				if(!ie) { document.getElementById('styled_popup_sorgu_table').style.maxHeight = "1000px"; }
				
				resizeTool.style.cursor = "nw-resize";
				
				if(kentliSonucTableHeight>100) {	// AZ KAYIT DONERSE YATAYDA UZATMAYI ENGELLIYORUZ
				resizeW.style.height = (ell.clientY-(wHeight+220))+"px";	// MOUSE UN RESIZE BUTONUN UZERINDE DURMASI ICIN
				}
				
				if((ell.clientX-strDivId3.offsetLeft)<kentliSonucTableWidth+20) {	// YATAYDA EN BUYUK BOYUTU KONTROL EDIYOR
					
					if((ell.clientX-strDivId3.offsetLeft)>385) {  // YATAYDA EN KUCUK BOYUTU KONTROL EDIYOR
					
					//document.getElementById('logoBaslik').innerHTML = kentliSonucTableHeight+" - "+strDivId3.offsetWidth;
					resizeW.style.width = (ell.clientX-(wWidth))+"px";
					strDivId3.style.width = (ell.clientX-(wWidth))+"px";
					
						if(ie){ 					
						document.getElementById('sorguFormBack').style.width = (ell.clientX-(wWidth+2))+"px";				
						} else {					
						document.getElementById('sorguFormBack').style.width = (ell.clientX-(wWidth))+"px";	
						}
					}
					
					//kentliSorguTable.style.width = (ell.clientX-(wWidth)-40)+"px";
					//document.getElementById('divSorgu').style.width = (ell.clientX-(wWidth)-40)+"px";
					
				}
				
				resizeTool.style.top = resizeW.style.top;
				addResizeButton('styled_popup_sorgu_table','','resizeToolSorgu');
			}
			return false;	
			
		} else if(eventSorguFlag==3) {	// ADA PARSEL PENCERESI ACIKSA		
			
			var strDivId3 = document.getElementById("styled_popup_sorgu");
	 		//var divSorgu = document.getElementById("divSorgu");
	 		var resizeW = document.getElementById("styled_popup_sorgu_table");
	 		var resizeTool = document.getElementById("resizeToolSorgu");
	 		var wHeight = strDivId3.offsetTop;	
	 
	 			if(ell.clientY>300 && ell.clientY<(screen.height-250)) {
				if(!ie) { document.getElementById('styled_popup_sorgu_table').style.maxHeight = "1000px"; }
				resizeTool.style.cursor = "nw-resize";
				resizeW.style.height = (ell.clientY-(wHeight+195))+"px";	// MOUSE UN RESIZE BUTONUN UZERINDE DURMASI ICIN
				resizeTool.style.top = resizeW.style.top;
				addResizeButton('styled_popup_sorgu_table','','resizeToolSorgu');
			}
			return false;
			
		} else if(eventSorguFlag==4) {	// CADDE/SOKAK SORGU PENCERESI ACIKSA
		
			var strDivId3 = document.getElementById("styled_popup_sorgu");
			//var caddeSorguTable = document.getElementById("caddeSorguTable");
	 		//var divSorgu = document.getElementById("divSorgu");
	 		var resizeW = document.getElementById("styled_popup_sorgu_table");
	 		var resizeTool = document.getElementById("resizeToolSorgu");
	 		var wHeight = strDivId3.offsetTop;	
			var wWidth = strDivId3.offsetLeft;
			
			var sonucTableWidth = document.getElementById('sonucTable').offsetWidth;
			var sonucTableHeight = document.getElementById('sonucTable').offsetHeight;
				
				var kisaltmaLimit = screen.height - (ell.clientY-strDivId3.offsetTop);
				
	 			if(ell.clientY<screen.height-250 && kisaltmaLimit<800 ) { // DUSEYDE EN BUYUK VE EN KUCUK BOYUTU KONTROL EDER
				//if(resizeW.offsetHeight<100) { resizeW.style.height = 102; }
				if(!ie) { document.getElementById('styled_popup_sorgu_table').style.maxHeight = "1000px"; }
				resizeTool.style.cursor = "nw-resize";
				
				if(sonucTableHeight>100) { // DONEN KAYIT SAYISI AZ ISE YATAYDA UZATMAYI ENGELLIYORUZ
				resizeW.style.height = (ell.clientY-(wHeight+165))+"px";	// MOUSE UN RESIZE BUTONUN UZERINDE DURMASI ICIN
				}
				
				if((ell.clientX-strDivId3.offsetLeft)<sonucTableWidth+20) {	// YATAYDA EN BUYUK BOYUTU KONTROL EDIYOR
					
					if((ell.clientX-strDivId3.offsetLeft)>368) {  // YATAYDA EN KUCUK BOYUTU KONTROL EDIYOR
					
					//document.getElementById('logoBaslik').innerHTML = sonucTableWidth+" - "+sonucTableHeight;
					resizeW.style.width = (ell.clientX-(wWidth))+"px";
					strDivId3.style.width = (ell.clientX-(wWidth))+"px";
					
						if(ie){ 					
						document.getElementById('sorguFormBack').style.width = (ell.clientX-(wWidth+2))+"px";				
						} else {					
						document.getElementById('sorguFormBack').style.width = (ell.clientX-(wWidth))+"px";	
						}
					}
					
					//kentliSorguTable.style.width = (ell.clientX-(wWidth)-40)+"px";
					//document.getElementById('divSorgu').style.width = (ell.clientX-(wWidth)-40)+"px";
					
				}
				
				resizeTool.style.top = resizeW.style.top;
				addResizeButton('styled_popup_sorgu_table','','resizeToolSorgu');
			}
			return false;	
			
		}
	 
	}
	 
}

function resizeWindowMouseOut(e) {
	var ev=(!e)?window.event:e;
	//if (ev.preventDefault) {ev.preventDefault();}
	document.getElementById('map').style.cursor = "default";
	disableOnClickMap = 0;
	//document.getElementById('resizeTool').onmousemove = "";

}

//INFO PENCERESINI RESIZE YAPAN BUTON EKLENIYOR 07-01-2011 Ozgur KUVVET

function addResizeButton(strTable1,strTable2,strResize) {

if(strTable1 && strTable2) {  // INFO PENCERESI ISE
	
	var resizeTool = document.getElementById(strResize);
	resizeTool.style.display = "block";
	var infoWindow = document.getElementById(strTable1);
	var infoWindow1 = document.getElementById(strTable2);
	
	var closeIconHeight = document.getElementById('closeRelTable').offsetHeight;

	var infoWindowWidth = infoWindow.offsetWidth;
	var infoWindowHeight = infoWindow.offsetHeight;
	var resizeToolHeight = resizeTool.offsetHeight;
	var resizeToolWidth = resizeTool.offsetWidth;
	
} else if(eventFlag==4) {  // SORGU PENCERESI ISE
	
	var resizeTool = document.getElementById(strResize);
	resizeTool.style.display = "block";
	var infoWindow = document.getElementById(strTable1);

	var infoWindowWidth = infoWindow.offsetWidth;
	var infoWindowHeight = infoWindow.offsetHeight;
	var resizeToolHeight = resizeTool.offsetHeight;
	var resizeToolWidth = resizeTool.offsetWidth;
	
}
	if(strTable2) {		// ACIK OLAN INFO PENCERESI ISE
		
		if(infoWindow1.style.display=="block"){ // ILISKILI PENCERESI ACIKSA
		
			var infoWindowWidth1 = infoWindow1.offsetWidth;
			var infoWindowHeight1 = infoWindow1.offsetHeight;

			if(ie){
				resizeTool.style.top = infoWindowHeight + resizeToolHeight+ closeIconHeight + (infoWindowHeight1+12) + "px";
				resizeTool.style.width = infoWindowWidth+"px";
			} else {
				resizeTool.style.top = infoWindowHeight + closeIconHeight + resizeToolHeight + (infoWindowHeight1+15) + "px";
				resizeTool.style.width = infoWindowWidth-10+"px";
			}
	
		} else {	// ILISKILI PENCERESI KAPALIYSA
		
			if(ie){
				resizeTool.style.top = (infoWindowHeight+11) + resizeToolHeight + "px";
				resizeTool.style.width = infoWindowWidth;
				resizeTool.style.marginLeft = "0px";
			} else {
				resizeTool.style.top = (infoWindowHeight+11) + resizeToolHeight + "px";
				resizeTool.style.width = (infoWindowWidth-10)+"px";
				resizeTool.style.marginLeft = "0px";
			}
		} 
		
	} else { 	// INFO PENCERESI DEGIL SORGU OLABILIR

	    if(eventSorguFlag == 1) {  // ACIK OLAN PENCERE ONEMLI YER BULMA PENCERESI ISE 

			if(ie && resizeTool){		// INTERNET EXPLORER
				resizeTool.style.top = (infoWindowHeight+137) + resizeToolHeight + "px";
				resizeTool.style.width = infoWindowWidth;
				resizeTool.style.marginLeft="-1px";
			} else if(!ie && resizeTool) {	// FIREFOX
				resizeTool.style.top = (infoWindowHeight+137) + resizeToolHeight + "px";
				resizeTool.style.width = (infoWindowWidth-10)+"px";
				resizeTool.style.marginLeft="-1px";
			}
			
			
		} else if(eventSorguFlag == 2) {  // ACIK OLAN PENCERE KENTLI ARAMA PENCERESI ISE		
		
			if(ie){		// INTERNET EXPLORER
				resizeTool.style.top = (infoWindowHeight+180) + resizeToolHeight + "px";
				resizeTool.style.width = infoWindowWidth;
				resizeTool.style.marginLeft="-1px";
			} else {  	// FIREFOX
				resizeTool.style.top = (infoWindowHeight+180) + resizeToolHeight + "px";
				resizeTool.style.width = (infoWindowWidth-10)+"px";
				resizeTool.style.marginLeft="-1px";
			}
		
		} else if(eventSorguFlag == 3) {	// ACIK OLAN ADAPARSEL SORGULAMA PENCERESI ISE
		
			if(ie){		// INTERNET EXPLORER
				resizeTool.style.top = (infoWindowHeight+163) + resizeToolHeight + "px";
				resizeTool.style.width = infoWindowWidth;
				resizeTool.style.marginLeft="-1px";
			} else {	// FIREFOX
				resizeTool.style.top = (infoWindowHeight+167) + resizeToolHeight + "px";
				resizeTool.style.width = (infoWindowWidth-10)+"px";
				resizeTool.style.marginLeft="-1px";
			}	
		
		} else if(eventSorguFlag == 4) {	// ACIK OLAN CADDE/SOKAK ARAMA PENCERESI ISE
		
			if(ie && resizeTool){		// INTERNET EXPLORER
				resizeTool.style.top = (infoWindowHeight + 136 + resizeToolHeight) + "px";
				resizeTool.style.width = infoWindowWidth;
				resizeTool.style.marginLeft="-1px";
			} else if(!ie && resizeTool) {  	// FIREFOX
				resizeTool.style.top = (infoWindowHeight + 136 + resizeToolHeight) + "px";
				resizeTool.style.width = (infoWindowWidth-10)+"px";
				resizeTool.style.marginLeft="-1px";
			}
		
		}

	}
}

function printImage () {	// RESIM GOSTERME PANELINDEN PRINT YAPTIGIMIZDA CALISIR  Ozgur KUVVET 10-02-2011

var printImg = document.getElementById('image').src;
var curImgWidth = document.getElementById('curImgWidth').value;
var curImgHeight = document.getElementById('curImgHeight').value;

var printHTML = "";

printHTML = printHTML + "<table align='center'><tr><td align='center'>Odunpazarı Belediyesi - Resim Çıktısı</td></tr><tr><td align='center'>";

if(curImgHeight>800) {
	printHTML = printHTML + "<img height='800' src='" + printImg + "' />";
} else {
	printHTML = printHTML + "<img width='"+curImgWidth+"' height='"+curImgHeight+"' src='" + printImg + "' />";
}

printHTML = printHTML + "</td></tr></table>";

document.getElementById("imgPrintlayer").innerHTML = printHTML;

window.print();
	
}

function showRadioButtons() {
	
	document.getElementById('showRadioButtons').style.visibility = "visible";
}

function hideRadioButtons() {
	
	document.getElementById('showRadioButtons').style.visibility = "hidden";
}


// RECTANGLE ZOOM CALISIRKEN HARITA DISINDA BIR BOLUME TIKLANIRSA BU FONKSIYONU CAGIRARAK RECTANGLE ZOOM U DEVRE DISI BIRAKACAGIZ Ozgur KUVVET 16-03-2011
function rectZoomProof(strAction) {

document.onmousemove='';
d.style.visibility = "hidden";
click1=0;

}


function buyukHarf(str){

str = str.replace('i','İ');
str = str.toUpperCase();

return str;
}


function kucukHarf(str){

str = str.toLowerCase();
str = str.replace('İ','i');


return str;
}

function cevir1(str){

str = str.replace('i','İ');

return str;
}

 












