function portfoyOver(satir){ 
		satir.className = 'L2';
}
function portfoyOut(satir){ 
		satir.className = 'L1';
}
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 Amount_onkeypress() {	
	if (window.event.keyCode<48 || window.event.keyCode>57){
	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 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 mtSec()
{
	var dest = "mtsec.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 ilceReset()
{
	document.getElementById('ilceID').value="";
	document.getElementById('ilce').value="";
}
function semtReset()
{
	document.getElementById('semt').value="";
	document.getElementById('semtID').value="";
}
function fillIn(anaparentID,parentID,catID,hiddenText,hiddenID,kolon,anaID,anaVar,fieldType,aciklama)
{
	var hiddenTextVal="";
	var hiddenIDVal="";
	var anaIDVal="";

	if(hiddenText!="")
		hiddenTextVal = document.getElementById(hiddenText).value;
	if(hiddenID!="")
		hiddenIDVal = document.getElementById(hiddenID).value;
	if(anaID!="")
		anaIDVal = document.getElementById(anaID).value;
	var dest = "fill.asp?baba=3012&anaparentID="+anaparentID+"&parentID="+parentID+"&catID="+catID+"&hiddenText="+hiddenTextVal+"&hiddenID="+hiddenIDVal+"&fieldText="+hiddenText+"&fieldHidden="+hiddenID+"&kolon="+kolon+"&anaID="+anaIDVal+"&anaVar="+anaVar+"&fieldType="+fieldType;
	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 fillIn2(anaparentID,parentID,catID,hiddenText,hiddenID,kolon,anaID,anaVar,fieldType,aciklama)
{
	var hiddenTextVal="";
	var hiddenIDVal="";
	var anaIDVal="";

	if(hiddenText!="")
		hiddenTextVal = document.getElementById(hiddenText).value;
	if(hiddenID!="")
		hiddenIDVal = document.getElementById(hiddenID).value;
	if(anaID!="")
		anaIDVal = document.getElementById(anaID).value;
	var dest = "fill2.asp?baba=3012&anaparentID="+anaparentID+"&parentID="+parentID+"&catID="+catID+"&hiddenText="+hiddenTextVal+"&hiddenID="+hiddenIDVal+"&fieldText="+hiddenText+"&fieldHidden="+hiddenID+"&kolon="+kolon+"&anaID="+anaIDVal+"&anaVar="+anaVar+"&fieldType="+fieldType;
	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 toggle(id)
{
	el = document.getElementById(id);
	var display = el.style.display ? '' : 'none';
	el.style.display = display;
}
function toggle2(id)
{
	el = document.getElementById(id);
	var display = el.style.display ? 'none' : '';
	el.style.display = 'none';
}
function kolayerisim(id){
	document.frmTitle.tip.value=id;
	document.frmTitle.submit();
	return true;
}

