	function checker_uyegiris(){
		if (
		document.form_uyegiris.username.value == '' || 
		document.form_uyegiris.password.value == '' 
		) { 
			alert('Sanal Emlak Ofisinize giriş için Üye Adınızı ve Şifrenizi boş geçmeyiniz.'); 
			return false;
		}
		return true;
	}

	function getCheckedValue(radioObj) {
		if(!radioObj)
			return "";
		var radioLength = radioObj.length;
		if(radioLength == undefined)
			if(radioObj.checked)
				return radioObj.value;
			else
				return "";
		for(var i = 0; i < radioLength; i++) {
			if(radioObj[i].checked) {
				return radioObj[i].value;
			}
		}
		return "";
	}

	function setCheckedValue(radioObj, newValue) {
		if(!radioObj)
			return;
		var radioLength = radioObj.length;
		if(radioLength == undefined) {
			radioObj.checked = (radioObj.value == newValue.toString());
			return;
		}
		for(var i = 0; i < radioLength; i++) {
			radioObj[i].checked = false;
			if(radioObj[i].value == newValue.toString()) {
				radioObj[i].checked = true;
			}
		}
	}

  function kelime_arabul(){
	  var URL = document.form_arabul;
	  var arabul_kelime = URL.arabul_kelime.value;
	  var arabul_turu=null;
	  var nereye=null;
	  var arabul_turu=URL.arabul_turu;

	  for(var i=0;i<arabul_turu.length;i++)
		if(arabul_turu[i].checked)
		  nereye=arabul_turu[i].value;

	  if (arabul_kelime != '' && arabul_kelime != 'bu kelimeyi ara..') {
		  if (nereye == '1') location.href = './?module=arabul&kelime='+arabul_kelime;	  
		  else location.href = 'http://www.google.com.tr/search?hl=tr&q='+arabul_kelime;	
	  }
  }

  function kelime_404(){
	  var URL = document.form_404;
	  var arabul_kelime = URL.arabul_kelime.value;
	  var arabul_turu=null;
	  var nereye=null;
	  var arabul_turu=URL.arabul_turu;

	  for(var i=0;i<arabul_turu.length;i++)
		if(arabul_turu[i].checked)
		  nereye=arabul_turu[i].value;

	  if (arabul_kelime != '' && arabul_kelime != 'bu kelimeyi ara..') {
		  if (nereye == '1') location.href = './?module=arabul&kelime='+arabul_kelime;	  
		  else location.href = 'http://www.google.com.tr/search?hl=tr&q='+arabul_kelime;	
	  }
  }

  function ilan_ara(itemArray){
	  URL = document.form_ilanlar;
	  ilan_kelime = URL.ilan_kelime.value;
  	  if (ilan_kelime ==  'bu kelimeyi ara..') ilan_kelime = '';
	  ilan_durumu = getCheckedValue(URL.ilan_durumu);
	  ilan_turu = URL.ilan_turu.options[URL.ilan_turu.selectedIndex].value;
	  sehirbolge_id = URL.sehirbolge_id.options[URL.sehirbolge_id.selectedIndex].value;
	  if (URL.ilcesemt_id.selectedIndex >=0)
	  {
		  ilcesemt_id = URL.ilcesemt_id.options[URL.ilcesemt_id.selectedIndex].value;
	  }
	  else
	  {
  		ilcesemt_id = 0;
	  }
	  ilan_fiyatbas = URL.ilan_fiyatbas.value;
	  ilan_fiyatbit = URL.ilan_fiyatbit.value;
	  ilan_alanm2bas = URL.ilan_alanm2bas.value;
	  ilan_alanm2bit = URL.ilan_alanm2bit.value;

	  yol = '';	
	  if (ilan_kelime != '') yol += '&kelime='+ilan_kelime;
	  if (ilan_durumu != '') yol += '&durumu='+ilan_durumu;
	  if (ilan_turu != '') yol += '&turu='+ilan_turu;
	  if (sehirbolge_id != '') yol += '&sehirbolge='+sehirbolge_id;
	  if (ilcesemt_id != '') yol += '&ilcesemt='+ilcesemt_id;
	  if (ilan_fiyatbas != '') yol += '&fiyatbas='+ilan_fiyatbas;
	  if (ilan_fiyatbit != '') yol += '&fiyatbit='+ilan_fiyatbit;
	  if (ilan_alanm2bas != '') yol += '&alanm2bas='+ilan_alanm2bas;
	  if (ilan_alanm2bit != '') yol += '&alanm2bit='+ilan_alanm2bit;

	  location.href = './?module=ilanlar' + yol;	  	
  }

	function sehirsec(module){
		URL = document.form_ilanlar;
		ilan_kelime = URL.ilan_kelime.value;
		ilan_durumu = getCheckedValue(URL.ilan_durumu);
		ilan_turu = URL.ilan_turu.options[URL.ilan_turu.selectedIndex].value;
		sehirbolge_id = URL.sehirbolge_id.options[URL.sehirbolge_id.selectedIndex].value;

		yol = '';	
		if (sehirbolge_id != '') yol += '&sehirbolge='+sehirbolge_id;
		if (ilan_kelime != '' && ilan_kelime !='bu kelimeyi ara..') yol += '&ilan_kelime='+ilan_kelime;
		if (ilan_durumu != '') yol += '&durumu='+ilan_durumu;
		if (ilan_turu != '') yol += '&turu='+ilan_turu;
		if (module =='') module = './?module=main';
		else module = './?module=' + module;
		location.href = module + yol;
	}

  function main_yeniuye(){
	  var URL = document.form_yeniuye;
	  location.href = './?module=yeniuye&emlakofisiadi='+URL.emlakofisiadi.value;
  }

  function main_sektorler(){
	  var URL = document.form_sektorler;
	  sektorid = URL.sektorid.options[URL.sektorid.selectedIndex].value;
	  anahtar = URL.anahtar.value;

	  yol = '';
	  if (anahtar != '') yol += '&keyword='+anahtar;
	  if (sektorid != '') yol += '&sektorid='+sektorid;

	  location.href = './?module=sektorler'+yol;
  }

  function main_ilangonder(){
	  var URL = document.form_ilangonder;
	  ilan_durumu = getCheckedValue(URL.ilan_durumu);
	  ilan_turu = URL.ilan_turu.options[URL.ilan_turu.selectedIndex].value;
	  
	  yol = '';
	  if (ilan_durumu != '') yol += '&ilan_durumu='+ilan_durumu;
	  if (ilan_turu != '') yol += '&ilan_turu='+ilan_turu;

	  location.href = './?module=ilangonder'+yol;
  }

  function main_talepgonder(){
	  var URL = document.form_talepgonder;
	  ilan_durumu = getCheckedValue(URL.ilan_durumu);
	  ilan_turu = URL.ilan_turu.options[URL.ilan_turu.selectedIndex].value;
	  
	  yol = '';
	  if (ilan_durumu != '') yol += '&ilan_durumu='+ilan_durumu;
	  if (ilan_turu != '') yol += '&ilan_turu='+ilan_turu;

	  location.href = './?module=talepgonder'+yol;
  }

/*
	Clock Time In Turkish for Mozilla and IE 4.0+
	info: leventuysal@gmail.com
	09.02.2005
*/
	function clock(){
		days = new Array('Ocak','Şubat','Mart','Nisan','Mayıs','Haziran','Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık');
		current = new Date();

		if(current.getSeconds()<10) Seconds = "0"+current.getSeconds();
		else Seconds = current.getSeconds();

		if(current.getMinutes()<10) Minutes = "0"+current.getMinutes();
		else Minutes = current.getMinutes();

		if(current.getHours()<10) Hours = "0"+current.getHours();
		else Hours = current.getHours();

		document.getElementById("saat").innerHTML = '&nbsp;<span class=yazi>'+current.getDate()+' '+days[current.getMonth()]+' '+current.getFullYear()+' '+Hours+':'+Minutes+':'+Seconds+'</span>&nbsp;';
		setTimeout("clock()",1000);
	}

/*
	Money Formatting Function on Key-Up for YTL (New Turkish Lira) for Mozilla and IE 4.0+
	info: leventuysal@gmail.com
	09.10.2004
*/

	function FindComma(value){
		var len=value.length-1;
		
		for (i=len;i>=0;i--){
			if(value.charAt(i)== ",") { return i;}
		}
		return 0;
	}

	function NewMoneyFormat(obj) {

		var value=obj.value;
		var len=obj.value.length-1;

		var fstr="";
		var fstr_comma="";

		var zerocount=4; // numbers before comma as 111,xxxx

		var tmp="";
		var comma=0;
		var intlen=0;
		var upperlimit=0;

		comma=FindComma(value);	// finds comma position

		for (i=0;i<=len;i++){
			(
				(
					value.charAt(i).match(/^([0-9])$/) 
					|| (value.charAt(i)== "," && (comma && comma==i))
				)
				&& value.charAt(i)!= "."
			) ? tmp=tmp+value.charAt(i) : NaN;
		}
		comma=FindComma(tmp);	

		if(comma>0) { intlen=comma-1; }
		else { intlen = tmp.length-1; }

		j=0
		for (i=intlen;i>=0;i--){
			j++;
			if ((j % 3)==0 && i>0){
				fstr="." + tmp.charAt(i) + fstr;
				j=0;
			}			
			else
				fstr=tmp.charAt(i) + fstr;
		}

		if (comma>0) {
			upperlimit = comma+zerocount	// upperlimit = len 

			for (i=upperlimit;i>=comma;i--){
				fstr_comma=tmp.charAt(i) + fstr_comma;
			}
		}
		return fstr+fstr_comma;
	}



	function isEmail(str) {
		i=0;
		notvalid=false;
		atcount=0;
		atpos=str.indexOf("@");
		firstdotpos=str.indexOf(".");
		notlast=str.lastIndexOf(".");
		if (firstdotpos < atpos) {
			posdist=atpos-firstdotpos;
		}
		dotpos=str.indexOf(".",atpos+1);
		if ((atpos > 0) && (firstdotpos > 0) && ((dotpos - atpos) > 2) && (dotpos < str.length-3) && (notlast != (str.length-1))) {
			while (i < str.length) {
				charmore=str.charAt(i);
				if (charmore == "@") {
					atcount++;
				}
				if (charmore == ".") {
					charagain=str.charAt(i+1);
					if (charmore == charagain) {
						showselect();
						return false;
					}
				}
				charmore=str.charAt(i);
				i++;
			}     
			if (atcount == 1) notvalid=true;
		} else {
			notvalid=false;
			showselect();
		}
		return notvalid;
	}

	function harita(){
		URL = "http://www.bursa.bel.tr/kbs/default.asp?tip=genel";
		c1 = screen.width;
		c2 = screen.height;

		if (c1==800){
			window.open(URL, '', 'fullscreen=yes, scrollbars=yes, toolbar=yes, menubar=yes');
		}
		else{
			window.open(URL, '', 'width=800,height=650,left=0,top=0,menubar=no,toolbar=no,location=no,scrollbars=no,status=no,resizable=no');
		}
	}

	function ImarDurumu(type){
		URL = ""
		switch (type) {
			case 0: URL= "http://www.nilufer.bel.tr:9079/map"; break;
			case 1: URL= "http://www.osmangazi.bel.tr/harita/webplan.asp"; break;
			case 2: URL= "http://www.yildirim.bel.tr/harita/webplan.asp"; break;
			default: URL= "http://www.nilufer.bel.tr:9079/map"; break;		
		}

		c1 = screen.width
		c2 = screen.height

		if (c1==800){
			window.open(URL, '', 'fullscreen=yes, scrollbars=yes, toolbar=yes, menubar=yes');
		}
		else{
			window.open(URL, '', 'width=825,height=625,left=0,top=0,menubar=no,toolbar=no,location=no,scrollbars=no,status=no,resizable=no');
		}
	}

	function CreateSelectItem(selectctrl, itemArray, defaultItem, goodPrompt, badPrompt) {
		var i, j;
		var prompt;
		for (i = selectctrl.options.length; i >= 0; i--) {
			selectctrl.options[i] = null; 
		}
		prompt = (itemArray != null) ? goodPrompt : badPrompt;
		if (prompt == null) {
			j = 0;
		}
		else {
			selectctrl.options[0] = new Option(prompt);
			j = 1;
		}
		if (itemArray != null) {
			for (i = 0; i < itemArray.length; i++) {
				selectctrl.options[j] = new Option(itemArray[i][0]);
				if (itemArray[i][1] != null) {
					selectctrl.options[j].value = itemArray[i][1]; 
					if (itemArray[i][1] ==defaultItem)
					{
						selectctrl.options[j].selected = true;
					}
				}
				j++;
			}
			
	   }
	}



/*
	Image Viewer
*/
	var ua = navigator.userAgent.toLowerCase();
	var divw=0;
	var divh=0;

	if (document.getElementById || document.all)
		document.write('<div id="imgtrailer" style="position:absolute; z-index:4; visibility:hidden;" /></div>')

	function gettrailobject()
	{
		if (document.getElementById)
			return document.getElementById("imgtrailer")
		else if (document.all)
			return document.all.trailimagid
	}

	function gettrailobj()
	{
		if (document.getElementById)
			return document.getElementById("imgtrailer").style
		else if (document.all)
			return document.all.trailimagid.style
	}

	function truebody()
	{
		return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
	}

	function hidetrail()
	{
		gettrailobject().innerHTML=" ";
		document.onmousemove='';
		gettrailobj().visibility="hidden";
	}

	function trailOn(thumbimg,imgtitle,imgscription,imgsize,filesize,credit,level,thw,thh,flvvid,samplepath)
	{
		//if(ua.indexOf('opera') == -1 && ua.indexOf('safari') == -1)
		//{
		gettrailobj().left="-500px";
		divthw = parseInt(thw) + 2;
		
		if(flvvid){
			var vidsample = samplepath + flvvid;
			newHTML = "";
			newHTML = newHTML + '<div align="center" style="width:'+thw+'px; font-family: verdana; font-size: 11px; padding: 0px; border: 1px solid #333333; background-color: #FFFFFF; layer-background-color: #FFFFFF; background-image: url(images/img_load.gif); background-repeat: no-repeat;" >';
			newHTML = newHTML +	'<object width="'+thw+'" height="'+thh+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0">';
			newHTML = newHTML + '<param name="movie" value="./images/flashthumb.swf">';
			newHTML = newHTML + '<param name="quality" value="best">';
			newHTML = newHTML + '<param name="loop" value="true">';	
			newHTML = newHTML + '<param name="FlashVars" value="myfile=' + vidsample + '">';
			newHTML = newHTML + '<EMBED SRC="./images/flashthumb.swf" LOOP="true" QUALITY="best" FlashVars="myfile=' + vidsample + '" WIDTH="'+thw+'" HEIGHT="'+thh+'">';
			newHTML = newHTML + '</object><div align="left" style="padding: 3px;"><b>Title: </b>'+imgtitle+'<br><b>Description: </b>'+imgscription+'</div></div>';
			gettrailobject().innerHTML = newHTML;
		} else {
			gettrailobject().innerHTML = '<div style="background-color: #FFFFFF; layer-background-color: #FFFFFF; border: 1px solid #000000; background-image: url(images/img_load.gif); background-repeat: no-repeat;"><center><img src="'+thumbimg+'" border="0" width="'+thw+'" height="'+thh+'" /></center></div>';
		}
		
		gettrailobj().visibility="visible";
		divw = parseInt(thw)+25;
		divh = parseInt(thh)+130;
		document.onmousemove=followmouse;
		//}
	}

	function followmouse(e)
	{
		var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
		var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(document.body.offsetHeight, window.innerHeight)

		if(typeof e != "undefined")
		{
			if(docwidth < 15+e.pageX+divw)
				xcoord = e.pageX-divw-5;
			else
				xcoord = 15+e.pageX;
			if(docheight < 15+e.pageY+divh)
				ycoord = 15+e.pageY-Math.max(0,(divh + e.pageY - docheight - truebody().scrollTop - 30));
			else
				ycoord = 15+e.pageY;
		}
		else if (typeof window.event != "undefined")
		{
			if(docwidth < 15+truebody().scrollLeft+event.clientX+divw)
				xcoord = truebody().scrollLeft-5+event.clientX-divw;
			else
				xcoord = truebody().scrollLeft+15+event.clientX;

			if(docheight < 15+truebody().scrollTop+event.clientY+divh)
				ycoord = 15+truebody().scrollTop+event.clientY-Math.max(0,(divh + event.clientY - docheight - 30));
			else
				ycoord = truebody().scrollTop+15+event.clientY;
		}
		gettrailobj().left=xcoord+"px"
		gettrailobj().top=ycoord+"px"
	}

