// JavaScript Document


function Amount_onkeyup(thisis) {

	//alert("aa: "+thisis.value);

	var tempstr,newstr,str,i,str2 ;
	var commapos,aftercomma,commacount;
	i=0;
	str = thisis.value;
	if (str.indexOf(",")<0)
	{	// çalışma
		//alert(str);
		//str = str.replace(".","");
		//alert(str);

		while ( 15 > i)
		{
			str = str.replace(".","");
			i=i+1;
		}
		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 //Aysun
		{
			str = str.replace(".","");
			thisis.value=str
		}
	}//indexOf
	return true;



/*
	var tempstr,newstr,str,i,str2 ;
	var commapos,aftercomma,commacount;
	i=0;
	str = thisis.value;
	if (str.indexOf(",")<0){

            while ( 15 > i) {
                    str = str.replace(".","");
                    i=i+1;
                    }
            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;
            }
	}//indexOf
	return true;
*/
}

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 popUp(URL) 
{
	day = new Date();
	id = day.getTime();

eval("page" + id + " =	 window.open(URL,'test','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=765,height=640,left = 200,top = 0');");
}
 
function windowControl()
	{
		if (document.body.offsetWidth != 765)
			{
			
			//alert("Sayin Ortagimiz Ortak Online Sayfanıza Giriş Yapmak İçin \n İnternet Explorer yada Firefox Ürünlerini Kullanınız");
			//window.location = "../default.asp"
			//window.close();
			
			}
	}

function PrintThisPage(baslik, elementid) 
{ 
   var sOption="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
       sOption+="scrollbars=yes,width=750,height=600,left=100,top=25"; 
	

var sWinHTML = document.getElementById(elementid).innerHTML; 

var winprint=window.open("","",sOption); 
       winprint.document.open(); 
       winprint.document.write('<html><head><link href="../mainStyle.css" rel="stylesheet" type="text/css" /></head><body bgcolor=#ffffff>'); 
	   winprint.document.write('<center>POLİS BAKIM VE YARDIM SANDIĞI</center><br>'); 
	   winprint.document.write('<center>'+baslik+'</center>'); 
       winprint.document.write(sWinHTML);          
       winprint.document.write('</body></html>'); 
       winprint.document.close(); 
	   winprint.focus(); 
	   winprint.print();
	   winprint.close();
	   
}


function closeSession()
{
 //capturing ALT + F4
 if (event.altKey==true && event.keyCode==0 )
	{
		 //alert("closed1")
		 document.location.href="SessionEndFile.asp";
		 window.close();
	 }

Xwidth=window.document.body.offsetWidth-window.event.clientX
YHeight=window.event.clientY
if(Xwidth<=30&&YHeight<0)
{
	  // alert("closed2")
	 document.location.href="SessionEndFile.asp";
	 window.close();

}

}
//window.onbeforeunload=closeSession    TBM:Sayfa kapatılmadan önce sorulsunmu fonksiyonunu içeririr

//or we can use body(unload) method
