
function tarihcheckscr(tarih) {
if (tarih.length!=10){return false;}
else{
if (tarih.substr(0,2)=='00'){return false;}
else{
if (tarih.substr(3,2)=='00'){return false;}
else{
toplam=0
for (say=0;say<10;say++){
if (tarih.substr(say,1)=="." || tarih.substr(say,1)=="-" || tarih.substr(say,1)=="/")
{if(say==2||say==5){toplam=toplam+1}else{toplam=3}}}
if (toplam!=2){return false;}
else{
gun=tarih.substr(0,2)
ay=tarih.substr(3,2)
yil=tarih.substr(6,4)
if (ay=='01'||ay=='03'||ay=='05'||ay=='07'||ay=='08'||ay=='10'||ay=='12'){if(gun>'31'){return false;}else{return true;}}
else{
if (ay=='04'||ay=='06'||ay=='09'||ay=='11'){if(gun>'30'){return false;}else{return true;}}
else{
if (ay=='02'){
if (parseInt(yil)%4==0){if (gun>'29'){return false;}else{return true;}} else{if (gun>'28'){return false;}else{return true;}}
}else{return false;}
}
}
}
}
}
}
}

function tarih_topla1_1(){
	return document.all.tr1_1.value+'.'+document.all.tr1_2.value+'.'+document.all.tr1_3.value
}

function tarih_topla2_1(){
	return document.all.tr2_1.value+'.'+document.all.tr2_2.value+'.'+document.all.tr2_3.value
}

function tarih_topla3_1(){
	return document.all.tr3_1.value+'.'+document.all.tr3_2.value+'.'+document.all.tr3_3.value
}

function tarih_topla4_1(){
	return document.all.tr4_1.value+'.'+document.all.tr4_2.value+'.'+document.all.tr4_3.value
}

function tarih_topla5_1(){
	return document.all.tr5_1.value+'.'+document.all.tr5_2.value+'.'+document.all.tr5_3.value
}


function tarih_topla6_1(){
	return document.all.tr6_1.value+'.'+document.all.tr6_2.value+'.'+document.all.tr6_3.value
}


function tarih_topla1_2(){
	return document.all.tr1_3.value+document.all.tr1_2.value+document.all.tr1_1.value
}

function tarih_topla2_2(){
	return document.all.tr2_3.value+document.all.tr2_2.value+document.all.tr2_1.value
}

function tarih_topla3_2(){
	return document.all.tr3_3.value+document.all.tr3_2.value+document.all.tr3_1.value
}

function tarih_topla4_2(){
	return document.all.tr4_3.value+document.all.tr4_2.value+document.all.tr4_1.value
}

function tarih_topla5_2(){
	return document.all.tr5_3.value+document.all.tr5_2.value+document.all.tr5_1.value
}

function tarih_topla6_2(){
	return document.all.tr6_3.value+document.all.tr6_2.value+document.all.tr6_1.value
}


function tar1_onclick() {
deger=showModalDialog("./calender/takvim.htm?"+ tarih_topla1_1(), "window","dialogHeight: " + 300 + "px; dialogWidth: " + 210 + "px;status:no;help:no;close:no")
if (deger!=null){
document.all.tr1_1.value=deger.substr(0,2)
document.all.tr1_2.value=deger.substr(3,2)
document.all.tr1_3.value=deger.substr(6,4)
}
}

function tar2_onclick() {
deger=showModalDialog("./calender/takvim.htm?"+ tarih_topla2_1(), "window","dialogHeight: " + 300 + "px; dialogWidth: " + 210 + "px;status:no;help:no;close:no")
if (deger!=null){
document.all.tr2_1.value=deger.substr(0,2)
document.all.tr2_2.value=deger.substr(3,2)
document.all.tr2_3.value=deger.substr(6,4)
}
}

function tar3_onclick() {
deger=showModalDialog("./calender/takvim.htm?"+ tarih_topla3_1(), "window","dialogHeight: " + 300 + "px; dialogWidth: " + 210 + "px;status:no;help:no;close:no")
if (deger!=null){
document.all.tr3_1.value=deger.substr(0,2)
document.all.tr3_2.value=deger.substr(3,2)
document.all.tr3_3.value=deger.substr(6,4)
}
}

function tar4_onclick() {
deger=showModalDialog("./calender/takvim.htm?"+ tarih_topla4_1(), "window","dialogHeight: " + 300 + "px; dialogWidth: " + 210 + "px;status:no;help:no;close:no")
if (deger!=null){
document.all.tr4_1.value=deger.substr(0,2)
document.all.tr4_2.value=deger.substr(3,2)
document.all.tr4_3.value=deger.substr(6,4)
}
}


function tar5_onclick() {
deger=showModalDialog("./calender/takvim.htm?"+ tarih_topla5_1(), "window","dialogHeight: " + 300 + "px; dialogWidth: " + 210 + "px;status:no;help:no;close:no")
if (deger!=null){
document.all.tr5_1.value=deger.substr(0,2)
document.all.tr5_2.value=deger.substr(3,2)
document.all.tr5_3.value=deger.substr(6,4)
}
}

function tar6_onclick() {
deger=showModalDialog("./calender/takvim.htm?"+ tarih_topla6_1(), "window","dialogHeight: " + 300 + "px; dialogWidth: " + 210 + "px;status:no;help:no;close:no")
if (deger!=null){
document.all.tr6_1.value=deger.substr(0,2)
document.all.tr6_2.value=deger.substr(3,2)
document.all.tr6_3.value=deger.substr(6,4)
}
}



function tarih_blur(tip){
//  Edit close 31.08
if (tarihcheckscr(tarih_topla1_1())){if(tip<3){document.all('tr1_'+(parseInt(tip)+1)).focus()}else{document.all.tar1.focus()}}else{document.all('tr1_'+tip).focus();return true}
}


function bos_doldur(deger){
bosluk_deg=''
for (don=1;don<=deger;don++){
bosluk_deg=bosluk_deg+'0'
}
return bosluk_deg
}

function tarih_onblur(tip){
switch (parseInt(tip)){
//  Edit close 31.08
//case 1:
//	document.all.tr1_1.value=bos_doldur(2-document.all.tr1_1.value.length)+document.all.tr1_1.value
//	break;
//case 2:
//	document.all.tr1_2.value=bos_doldur(2-document.all.tr1_2.value.length)+document.all.tr1_2.value
//	break;
//case 3:
//	if(document.all.tr1_3.value.length<4){
//	document.all.tr1_3.value='2'+bos_doldur(3-document.all.tr1_3.value.length)+document.all.tr1_3.value
//	}
//	break;
}
}



/*------------------------------------------------------------------------------------*/

function tarih_topla2_1(){
	return document.all.tr2_1.value+'.'+document.all.tr2_2.value+'.'+document.all.tr2_3.value
}

function tarih_topla2_2(){
	return document.all.tr2_3.value+document.all.tr2_2.value+document.all.tr2_1.value
}



function tarih_blur2(tip){
//  Edit close 31.08
	if (tarihcheckscr(tarih_topla2_1())){if(tip<3){document.all('tr2_'+(parseInt(tip)+1)).focus()}else{document.all.tar2.focus()}}else{document.all('tr2_'+tip).focus();return true}
}


function tarih_onblur2(tip){
switch (parseInt(tip)){
//  Edit close 31.08
//case 1:
//	document.all.tr2_1.value=bos_doldur(2-document.all.tr2_1.value.length)+document.all.tr2_1.value
//	break;
//case 2:
//	document.all.tr2_2.value=bos_doldur(2-document.all.tr2_2.value.length)+document.all.tr2_2.value
//	break;
//case 3:
//	if(document.all.tr2_3.value.length<4){
//	document.all.tr2_3.value='2'+bos_doldur(3-document.all.tr2_3.value.length)+document.all.tr2_3.value
//	}
//	break;
}
}

function tarih_topla3_1(){
	return document.all.tr3_1.value+'.'+document.all.tr3_2.value+'.'+document.all.tr3_3.value
}

function tarih_topla3_2(){
	return document.all.tr3_3.value+document.all.tr3_2.value+document.all.tr3_1.value
}

function tarih_blur3(tip){
//  Edit close 31.08
	if (tarihcheckscr(tarih_topla3_1())){if(tip<3){document.all('tr3_'+(parseInt(tip)+1)).focus()}else{document.all.tar3.focus()}}else{document.all('tr3_'+tip).focus();return true}
}

function tarih_onblur3(tip){
switch (parseInt(tip)){
//  Edit close 31.08
//case 1:
//	document.all.tr3_1.value=bos_doldur(2-document.all.tr3_1.value.length)+document.all.tr3_1.value
//	break;
//case 2:
//	document.all.tr3_2.value=bos_doldur(2-document.all.tr3_2.value.length)+document.all.tr3_2.value
//	break;
//case 3:
//	if(document.all.tr3_3.value.length<4){
//	document.all.tr3_3.value='2'+bos_doldur(3-document.all.tr3_3.value.length)+document.all.tr3_3.value
//	}
//	break;
}
}

function tarih_blur4(tip){
	if (tarihcheckscr(tarih_topla4_1())){if(tip<3){document.all('tr4_'+(parseInt(tip)+1)).focus()}else{document.all.tar4.focus()}}else{document.all('tr4_'+tip).focus();return true}
}


function tarih_onblur4(tip){
switch (parseInt(tip)){
case 1:
	document.all.tr4_1.value=bos_doldur(2-document.all.tr4_1.value.length)+document.all.tr4_1.value
	break;
case 2:
	document.all.tr4_2.value=bos_doldur(2-document.all.tr4_2.value.length)+document.all.tr4_2.value
	break;
case 3:
	if(document.all.tr4_3.value.length<4){
	document.all.tr4_3.value='2'+bos_doldur(3-document.all.tr4_3.value.length)+document.all.tr4_3.value
	}
	break;
}
}

function tarih_blur5(tip){
	if (tarihcheckscr(tarih_topla5_1())){if(tip<3){document.all('tr5_'+(parseInt(tip)+1)).focus()}else{document.all.tar5.focus()}}else{document.all('tr5_'+tip).focus();return true}
}


function tarih_onblur5(tip){
switch (parseInt(tip)){
case 1:
	document.all.tr5_1.value=bos_doldur(2-document.all.tr5_1.value.length)+document.all.tr5_1.value
	break;
case 2:
	document.all.tr5_2.value=bos_doldur(2-document.all.tr5_2.value.length)+document.all.tr5_2.value
	break;
case 3:
	if(document.all.tr5_3.value.length<4){
	document.all.tr5_3.value='2'+bos_doldur(3-document.all.tr5_3.value.length)+document.all.tr5_3.value
	}
	break;
}
}

function tarih_blur6(tip){
	if (tarihcheckscr(tarih_topla6_1())){if(tip<3){document.all('tr6_'+(parseInt(tip)+1)).focus()}else{document.all.tar5.focus()}}else{document.all('tr6_'+tip).focus();return true}
}


function tarih_onblur6(tip){
switch (parseInt(tip)){
case 1:
	document.all.tr6_1.value=bos_doldur(2-document.all.tr6_1.value.length)+document.all.tr6_1.value
	break;
case 2:
	document.all.tr6_2.value=bos_doldur(2-document.all.tr6_2.value.length)+document.all.tr6_2.value
	break;
case 3:
	if(document.all.tr6_3.value.length<4){
	document.all.tr6_3.value='2'+bos_doldur(3-document.all.tr6_3.value.length)+document.all.tr6_3.value
	}
	break;
}
}



function tarih_format(tarih_deg) {
return tarih_deg.substr(6,2)+'.'+tarih_deg.substr(4,2)+'.'+tarih_deg.substr(0,4)
}

