  
  
    // <script language="javascript" src="klscripts.js" type="text/javascript"></script>
    // onkeypress="return(SayiFormati(this,'',event))"
    // onkeypress="return YtlKeyPress(event);" onkeyup="return YtlKeyUp(this,25,5);"
    // onkeypress="return(TarihFormati(this,'.','a',event))"
//function DegerDonenPopup(frm,ControlName,h,w)
//{NewWindow = window.open(frm + '?FormName=' + document.forms[0].name + '&ControlName=' + ControlName, "PopUpRichTextEditor", "height="+h+",width="+w+",top=270,left=280,toolbars=no,scrollbars=no,status=no,resizable=no,titlebar=no ");}   
      
      
   function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

     
	function ShowForm(frm,ControlName)    
		{  
		NewWindow = window.open( frm + '?FormName=' + document.forms[0].name + '&ControlName=' + ControlName, "PopUpCalendar", "width=400,height=400,top=270,left=280,toolbars=no,scrollbars=no,status=no,resizable=no,titlebar=no ");    
 
		//NewWindow = window.open(frm + '?FormName=' + document.forms[0].item. + '&ControlName=' + ControlName, "PopUpCalendar", "width=500,height=400,top=270,left=280,toolbars=no,scrollbars=no,status=no,resizable=no,titlebar=no ");    
		}   
 
    
function Sekme(showthis,hidethis,runoperation){
	expression1='document.all.' + showthis + '.style.display=\'\'';
	expression2='document.all.' + hidethis + '.style.display=\'none\'';
	expression3=runoperation + '()'
	eval(expression1);
	eval(expression2);
	eval(expression3);
}
	//	function ShowPopup(filename, h, w)    
	//	{   
	//	NewWindow = window.open(filename,"popDialog","height="+h+",width="+w+",scrollbars=yes,status=yes,titlebar=yes,toolbars=yes,resizable=yes"); 
	//	}   
//ytl dönüştürme fonksiyonu
			function YtlKeyUp(thisis,digit,decimal) {	
				var v1,v2,v3,i,str2 ; var v4,v5,v6; var v7;
				i=0; v3 = thisis.value;
				decimal=parseFloat(decimal); digit=parseFloat(digit);
				while ( 15 > i) { v3 = v3.replace(".",""); i=i+1; }
				v6=0; v4=v3.indexOf(",");
				if (v4>=0) { v5=v3.substr(v4); v3=v3.substr(0,v4); }
				else
				v5="";
				if(v3.length>=digit) { v3=v3.substr(0,digit); }
				if(v5.length>decimal+1) {
					if (decimal<=0)
						v5="";
					else
						v5=v5.substr(0,decimal+1);
				}else { if (decimal<=0) v5=""; }

				if (v4>=0)  { v7 = v5.substr(1,decimal);
					if (v7.indexOf(",")>=0)
						v5 = "," }
				if (v3.length > 3){ v1=v3; v2="";
					while (v1.length>3) { v2="."+v1.substr(v1.length-3)+v2; v1=v1.substr(0,v1.length-3); }
					v3=v1+v2+v5; }
				else { if(v4>=0) { v3=v3+v5; } }
				thisis.value= v3;}
			//sadece sayısal değer girilsin
			function YtlKeyPress(e) {	
				var whichCode = (window.Event) ? e.which : e.keyCode;
				if (whichCode == 13) return true;  // Enter
				if (whichCode == 44) return true;  // virgül
				if (whichCode == 45) return true;  // -
				if (whichCode > 57 ){
				return false;}
				if (whichCode < 48 && whichCode > 13){return false;}}

function SayiFormati(fld, 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
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) != 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 =  decSep + aux;
if (len == 2) fld.value =  decSep + aux;
if (len >= 3) fld.value =  decSep + aux;
return false;}

function TarihFormati(fld, milSep, decSep, e) {
var sep = 0;
var onc='';
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
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) != 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){
if (key<=3) fld.value =  aux;
}
if (len == 2){
if (fld.value<3) fld.value =  aux;
if (fld.value==3) {
if (key<=1) fld.value =  aux;
}
}
if (len == 3){
if (key<=1){
if (fld.value.charAt(2)==milSep){
fld.value = fld.value + key;}
if (fld.value.length==2) fld.value = fld.value + milSep + key;
onc=key;
}
}
if (len == 4) {
if (fld.value.charAt(3)==0) fld.value =  fld.value + key;
if (fld.value.charAt(3)==1){ 
  if(key<=2) fld.value =  fld.value + key;
  }
}
if (len == 5) {
if (key>=1) {
if (fld.value.charAt(5)==milSep){
fld.value = fld.value + key;
}
if (fld.value.length==5) fld.value =  fld.value + milSep + key;
}
}
if (decSep=='a')
{
if ((len > 5) && (len<=8)) fld.value =  fld.value +  key;
return false;
}

}


