// JavaScript Document
function textCounter(field, hangisi) {
	//var muharrem;
	var mytotal;
	var remtotal;
	var cuttotal;
	//document.form1.SpanArea_obj.value = (document.form1.yorum.value.length);
	//document.form1.SpanArea_met.value = (document.form1.report_method_design.value.length);
	//document.form1.SpanArea_res.value = (document.form1.report_result.value.length);
	//document.form1.SpanArea_conc.value = (document.form1.report_conclusion.value.length);
	//mytotal = (document.form1.report_objective.value.length)+(document.form1.report_method_design.value.length)+(document.form1.report_result.value.length)+(document.form1.report_conclusion.value.length);
	mytotal = document.form1.yorum.value.length;
	remtotal = 500 - mytotal;
	if (mytotal > 500){
		if(hangisi == 1) mytotal-= document.form1.yorum.value.length;
//		if(hangisi == 2) mytotal-= document.form1.report_method_design.value.length;
//		if(hangisi == 3) mytotal-= document.form1.report_result.value.length;
//		if(hangisi == 4) mytotal-= document.form1.report_conclusion.value.length;
	cuttotal = 500 - mytotal
	field.value = field.value.substring(0,cuttotal);
	}
	else{
		document.form1.remLen.value = remtotal;
	}
}
/*function ilksay(){
	var ilktotal;
	document.form1.SpanArea_obj.value = document.form1.report_objective.value.length;
	document.form1.SpanArea_met.value = document.form1.report_method_design.value.length;
	document.form1.SpanArea_res.value = document.form1.report_result.value.length;
	document.form1.SpanArea_conc.value = document.form1.report_conclusion.value.length;
	ilktotal = (document.form1.report_objective.value.length)+(document.form1.report_method_design.value.length)+(document.form1.report_result.value.length)+(document.form1.report_conclusion.value.length);
	ilktotal = 500 - ilktotal;
	document.form1.remLen.value = ilktotal;
}
function karaktersay(boyut){       
    var allchar
	allchar =boyut-(document.form1.report_objective.value.length)+(document.form1.report_method_design.value.length)+(document.form1.report_result.value.length)+(document.form1.report_conclusion.value.length);
	if(allchar < 0){
          alert("Maximum Karakter Sayısı: " + boyut);
			return false;
        }
    return true;
}*/
