	function reshuffle(id,obj1,obj2)
	{
		hdnVal=obj2.value;
		hdnStr=document.frmAdd.ozelliklerhdnAll.value;
		//alert(hdnStr);
		
		if(eval(hdnVal)==eval(0))
		{
			if(hdnStr=="")	
				document.frmAdd.ozelliklerhdnAll.value=id;
			else
				document.frmAdd.ozelliklerhdnAll.value=hdnStr +","+ id;			
			obj2.value=1;			
		}
		else
		{
			temp1=hdnStr.replace(id,"");			
			temp1=temp1.replace( ",," , "," );
			char0=temp1.charAt(0)
			if(char0==",")			
			{
				char1=temp1.charAt(1);
				charAll=char0+char1;
				temp1=temp1.replace(charAll,char1);
			}
						
			lastPos=eval(temp1.length)-1			
			charLast=temp1.charAt(lastPos)
			charLast1=temp1.charAt(lastPos-1)
			
			if(charLast==",")			
			{
				charLast2=charLast1+charLast;
				temp1=temp1.replace(charLast2,charLast1);
			}
			document.frmAdd.ozelliklerhdnAll.value=temp1;
			obj2.value=0;			
		}
		
		//alert(document.frmAdd.ozelliklerhdnAll.value);		
	}
function rollOn(satir){ 
		satir.style.backgroundColor = '#C6B5B5';
}
function rollOff(satir){ 
		satir.style.backgroundColor = '';
}

function rollOn1(satir){ 
		satir.style.backgroundColor = '#F8DEDF';
}
function rollOff1(satir){ 
		satir.style.backgroundColor = '';
}

function rollOn2(satir){ 
		satir.style.backgroundColor = '#CCCCCC';
}
function rollOff2(satir){ 
		satir.style.backgroundColor = '';
}

function Trim(value)
{
    value = value.match(/^\s*(\S+(\s+\S+)*)\s*$/);
    return (value == null) ? "" : value[1];
}

function Fokus(Degis){
	if (Trim(Degis.value) == '0'){Degis.value = '';}
}

function XFokus(Degis){
	if (Trim(Degis.value) == ''){Degis.value = '0';}
}

function replace2(s, from1, to1) {
	var p,str;
	str=s;
	p = str.indexOf(from1);
	while (p > -1) {
		str=str.substring(0, p) + to1 + str.substring(p+from1.length);
		p = str.indexOf(from1);
	}
	return str;
}

function Pay_onkeypress() 	{
	if (window.event.keyCode < 48 || window.event.keyCode > 57)		return false;		
}

function Amount_onkeypress() {	
	if (window.event.keyCode<48 || window.event.keyCode>57){
	return false;}
}

function Allowed_Inputs(e,truechars){	
	var whichCode = (window.Event) ? e.which : e.keyCode;
	//alert(whichCode);
	for (i=0; i<truechars.length; i++)
	{
		if (whichCode==truechars.charCodeAt(i)) {
			return true;
		}
	}
	return false;
}

function Amount_onkeyup(thisis) {
	var tempstr,newstr,str,i,str2 ;
	var commapos,aftercomma,commacount;
	i=0;
	str = thisis.value;
	while ((str.length>1)&&(str.substr(0,1)=='0')){
		str=str.substr(1);
	}
	if (str.indexOf(",")<0){
	
		str=replace2(str,'.','');

		commacount=0;
		commapos=str.indexOf(";");
	
		if (commapos>=0) 
		{
			aftercomma=str.substr(commapos);
			str=str.substr(0,commapos);
		}
		else
			aftercomma="";
	
		if (str.length > 3) 
		{
			tempstr=str;
			newstr="";
			while (tempstr.length>3)
			{
				newstr="."+tempstr.substr(tempstr.length-3)+newstr; 
				tempstr=tempstr.substr(0,tempstr.length-3);
			}
			thisis.value = tempstr+newstr+aftercomma;
		}else{thisis.value = str;}
	}
	if(thisis.value=='0'){thisis.value='';}
}

function Amount2(thisis) {
	var tempstr,newstr,str,i,str2,str3 ;
	var commapos,aftercomma,commacount;
	i=0;
	str = thisis;
	while ((str.length>1)&&(str.substr(0,1)=='0')){
		str=str.substr(1);
	}
	if (str.indexOf(",")<0){
	
		str=replace2(str,'.','');

		commacount=0;
		commapos=str.indexOf(";");
	
		if (commapos>=0) 
		{
			aftercomma=str.substr(commapos);
			str=str.substr(0,commapos);
		}
		else
			aftercomma="";
	
		if (str.length > 3) 
		{
			tempstr=str;
			newstr="";
			while (tempstr.length>3)
			{
				newstr="."+tempstr.substr(tempstr.length-3)+newstr; 
				tempstr=tempstr.substr(0,tempstr.length-3);
			}
			str3 = tempstr+newstr+aftercomma;
		}else{str3 = str;}
	}
	if(str3==''){str3='0';}
	return str3;
}


function Name_onkeypress() {	
	if (window.event.keyCode<65 && window.event.keyCode!=32){
	return false;}
}

function Comma(number) {
	number = '' + number;
	if (number.length > 3) {
		var mod = number.length % 3;
		var output = (mod > 0 ? (number.substring(0,mod)) : '');
		for (i=0 ; i < Math.floor(number.length / 3); i++) {
			if ((mod == 0) && (i == 0))
				output += number.substring(mod+ 3 * i, mod + 3 * i + 3);
			else
				output+= '.' + number.substring(mod + 3 * i, mod + 3 * i + 3);
		}
		return (output);
	}
	else return number;
}

function Numeric_Control(e) {	
	//alert(window.event.srcElement.value);
	var whichCode = (window.Event) ? e.which : e.keyCode;
	
	if (whichCode == 13) return true;  // Enter
	
	if (whichCode > 57 ){
	return false;}
	if (whichCode < 48){
	return false;}
}

function Only_Numeric(e) {	
	//alert(window.event.srcElement.value);
	var whichCode = (window.Event) ? e.which : e.keyCode;
	
	if (whichCode == 13) return true;  // Enter
	if (whichCode == 44) return true;  // Comma
	if (whichCode > 57 ){
	return false;}
	if (whichCode < 48 && whichCode > 13){
	return false;}
}

function Only_Character(e) {	
	//alert(window.event.srcElement.value);
	var whichCode = (window.Event) ? e.which : e.keyCode;
	

	
	if (whichCode == 13) return true;  // Enter
	if (whichCode == 44) return true;  // Enter
	if (whichCode > 47 && whichCode < 58){
	return false;}
}


function Only_LetterANDDigit(e) {	
	//alert(window.event.srcElement.value);
	var whichCode = (window.Event) ? e.which : e.keyCode;
	
	
	if (whichCode > 47 && whichCode < 58){
	return true;}
	if (whichCode > 96 && whichCode < 123){
	return true;}
	
	return false;

}


function Only_Digit(e) {	
	//alert(window.event.srcElement.value);
	var whichCode = (window.Event) ? e.which : e.keyCode;
	
	if (whichCode == 13) return true;  // Enter
	if (whichCode > 57 ){
	return false;}
	if (whichCode < 48 && whichCode > 13){ 
	return false;}
}

function Only_Letter(e) {	

	var whichCode = (window.Event) ? e.which : e.keyCode;

	if (whichCode == 13) return true;  // Enter
	if (whichCode == 0) return true;  //Delete etc.
	
	if ((whichCode >=97 && whichCode <=122) || (whichCode <=90 && whichCode >=65)){
	return true;}
	
	var validChars="üÜğĞışŞİçÇöÖ ";

	for (i=0; i<validChars.length; i++)
	{
		if (whichCode==validChars.charCodeAt(i)) {
			return true;
		}
	}
	
	return false;
	
}		

	
function Open(message,titletxt){

var msgWindow; 

	msgWindow=window.open("","Ornek","toolbar=0,top=50,left=50,width=300,height=80,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,copyhistory=0"); 
	msgWindow.document.close(); 
	msgWindow.document.open();
	msgWindow.document.write("<html><head><meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-9'>");
	msgWindow.document.write("<meta http-equiv='Content-Type' content='text/html; charset=windows-1254'>");
	msgWindow.document.write("<title>" + titletxt + "</title></head><body>");
	msgWindow.document.write("<table  width=250 ><tr><td style='FONT: 10px Helvetica, sans-serif, Arial;HEIGHT: 20px'>" + message + "</td></tr></table>");
	msgWindow.document.write("</body>");
	msgWindow.focus();
}	

function Only_LetterANDDigit(e) {	
	//alert(window.event.srcElement.value);
	var whichCode = (window.Event) ? e.which : e.keyCode; 
	
	
	if (whichCode > 47 && whichCode < 58){
	return true;}
	if (whichCode > 96 && whichCode < 123){
	return true;}
	if (whichCode > 64 && whichCode < 91){
	return true;}
	
	return false;

}

function PadField(thisis, other, len) {
	var	str = thisis.value;
  var i, l = str.length;
  for (i=0; i<len - l; i++)	{
  	str = "0" + str;
  }
	other.value = str;
  return true;
}

function ToUCase(thisis, other) {
	var	str = thisis.value;
	var chr, recStr;
	var i, l = str.length;
	recStr = "";
	for (i=0; i<l; i++)	{
		chr = str.charCodeAt(i);		
		if (chr > 96 && chr < 123){
			chr = chr - 32;
		}
		recStr = recStr + String.fromCharCode(chr);	
	}	
	thisis.value = recStr;
	return true;
}

function AutoTab(fld,n) {
	var f = eval("document.mainform.x_param" + n);
	if (f !=null)	{
		if(fld.value.length==fld.maxLength)	{
			f.focus();
		}
	}	else	{
  	f = eval("document.mainform.input_param" + n);
		if (f != null)	{
			if(fld.value.length==fld.maxLength)	{
				f.focus();
			}
		}
	}
}

function saatgoster(){
     saat.style.display = 'block';
     saat.style.left = (document.body.clientWidth - saat.clientWidth) / 2 + document.body.scrollLeft;
     saat.style.top = (document.body.clientHeight - saat.clientHeight) / 2 + document.body.scrollTop;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function ofisSec()
{
	var dest = "ofissec.asp?baba=3012";
	detail_window = window.open(dest, "displayWindow","width=300,height=350,scrollbars=yes,resizable=no,toolbar=no,location=no,menubar=no,status=no");
	self.name = "anne";
	return false;
}
function ilceSec()
{
	var id = document.getElementById('ilID').value;
	if(id==0){
		alert("Lütfen önce il seçiniz!");
		return false;
	}
	else{
		var dest = "ilcesec.asp?baba=3012&ilID="+id;
		detail_window = window.open(dest, "displayWindow", "width=300,height=350,scrollbars=yes,resizable=no,toolbar=no,location=no,menubar=no,status=no")
		self.name = "anne";
		return false;
	}
	return false;
}
function mtSec()
{
	var id = document.getElementById('ofisID').value;
	if(id==0){
		alert("Lütfen önce ofis seçiniz!");
		return false;
	}
	else{
		var dest = "mtsec.asp?baba=3012&ofisID="+id;
		detail_window = window.open(dest, "displayWindow", "width=300,height=350,scrollbars=yes,resizable=no,toolbar=no,location=no,menubar=no,status=no")
		self.name = "anne";
		return false;
	}
	return false;
}
function ilceReset()
{
	document.getElementById('ilceID').value="";
	document.getElementById('ilce').value="";
}
function semtSec()
{
	var id = document.getElementById('ilceID').value;
	if(id==0){
		alert("Lütfen önce ilçe seçiniz!");
		return false;
	}
	else{
		var dest = "semtsec.asp?baba=3012&ilceID="+id;
		detail_window = window.open(dest, "displayWindow", "width=300,height=450,scrollbars=yes,resizable=no,toolbar=no,location=no,menubar=no,status=no")
		self.name = "anne";
		return false;
	}
	return false;
}
function semtReset()
{
	toggle2('semtAlani');
	if(document.getElementById('ilID').value==7 || document.getElementById('ilID').value==40 || document.getElementById('ilID').value==41){
		toggle('semtAlani');
	}
	document.getElementById('semt').value="";
}
function mtReset()
{
	document.getElementById('mtID').value="";
	document.getElementById('mt').value="";
}
function manzaraReset()
{
	document.getElementById('manzara1').value="";
	document.getElementById('manzara').value="";
	return false;
}
function manzaraSec(id)
{
	var dest = "manzarasec.asp?baba=3012&secenek="+id;
	detail_window = window.open(dest, "displayWindow", "width=300,height=230,scrollbars=yes,resizable=no,toolbar=no,location=no,menubar=no,status=no")
	self.name = "anne";
	return false;
}
function ozellikSec()
{
	var ozellikid=1;
	if(document.frmSrc1.tip(0).checked){ozellikid=1;}
	if(document.frmSrc1.tip(1).checked){ozellikid=2;}
	if(document.frmSrc1.tip(2).checked){ozellikid=3;}
	var dest = "ozelliksec.asp?baba=3012&emlakTipi="+ozellikid;
	detail_window = window.open(dest, "displayWindow", "width=400,height=450,scrollbars=yes,resizable=no,toolbar=no,location=no,menubar=no,status=no")
	self.name = "anne";
	return false;
}
function ozellikOlayi2(nesne){
  toggle2('secenek1');
  toggle2('secenek3');
  var deger = nesne.value;
  var deger2 = deger;
  if(deger2==2) deger2=1;
  toggle('secenek'+deger2);
  document.frmSrc1.ozellikler.value = "";
  document.frmSrc1.ozelliklerID.value = "";
}
