function checkFormAndSubmit(theForm) {
	var stop = false;
	theForm.PEK_TUTAR.value = dotremove(theForm.PEK_TUTAR.value);

	// prim
	theForm.PRIM_ASIL_BORC.value = dotremove(theForm.PRIM_ASIL_BORC.value);
	theForm.PRIM_GECIKME_ZAMMI.value = dotremove(theForm.PRIM_GECIKME_ZAMMI.value);
	theForm.PRIM_TECIL_FAIZI.value = dotremove(theForm.PRIM_TECIL_FAIZI.value);
	theForm.PRIM_KANUNI_FAIZ.value = dotremove(theForm.PRIM_KANUNI_FAIZ.value);

	// işsizlik
	theForm.ISS_ASIL_BORC.value = dotremove(theForm.ISS_ASIL_BORC.value);
	theForm.ISS_GECIKME_ZAMMI.value = dotremove(theForm.ISS_GECIKME_ZAMMI.value);
	theForm.ISS_TECIL_FAIZI.value = dotremove(theForm.ISS_TECIL_FAIZI.value);
	theForm.ISS_KANUNI_FAIZ.value = dotremove(theForm.ISS_KANUNI_FAIZ.value);

	// idari para cezası
	theForm.IPC_ASIL_BORC.value = dotremove(theForm.IPC_ASIL_BORC.value);
	theForm.IPC_GECIKME_ZAMMI.value = dotremove(theForm.IPC_GECIKME_ZAMMI.value);
	theForm.IPC_TECIL_FAIZI.value = dotremove(theForm.IPC_TECIL_FAIZI.value);
	theForm.IPC_KANUNI_FAIZ.value = dotremove(theForm.IPC_KANUNI_FAIZ.value);
	
	if (isNaN(theForm.PEK_TUTAR.value)) {
		alert("PEK TUTAR girdinizi kontrol ediniz !");
		return false;
	}
	if (isNaN(theForm.PRIM_ASIL_BORC.value)) {
		alert("PRİM ASIL BORC girdinizi kontrol ediniz !");
		return false;
	}
	if (isNaN(theForm.PRIM_GECIKME_ZAMMI.value)) {
		alert("PRİM GECİKME ZAMMI girdinizi kontrol ediniz !");
		return false;
	}
	if (isNaN(theForm.PRIM_TECIL_FAIZI.value)) {
		alert("PRİM TECİL FAİZİ girdinizi kontrol ediniz !");
		return false;
	}
	if (isNaN(theForm.PRIM_KANUNI_FAIZ.value)) {
		alert("PRİM KANUNİ FAİZ girdinizi kontrol ediniz !");
		return false;
	}
	if (isNaN(theForm.ISS_ASIL_BORC.value)) {
		alert("İŞS. ASIL BORÇ girdinizi kontrol ediniz !");
		return false;
	}
	if (isNaN(theForm.ISS_GECIKME_ZAMMI.value)) {
		alert("İŞS. GECİKME ZAMMI girdinizi kontrol ediniz !");
		return false;
	}
	if (isNaN(theForm.ISS_TECIL_FAIZI.value)) {
		alert("İŞS. TECİL FAİZİ girdinizi kontrol ediniz !");
		return false;
	}
	if (isNaN(theForm.ISS_KANUNI_FAIZ.value)) {
		alert("İŞS. KANUNİ FAİZ girdinizi kontrol ediniz !");
		return false;
	}
	if (isNaN(theForm.IPC_ASIL_BORC.value)) {
		alert("İPC ASIL BORÇ girdinizi kontrol ediniz !");
		return false;
	}
	if (isNaN(theForm.IPC_GECIKME_ZAMMI.value)) {
		alert("İPC GECİKME ZAMMI girdinizi kontrol ediniz !");
		return false;
	}
	if (isNaN(theForm.IPC_TECIL_FAIZI.value)) {
		alert("İPC TECİL FAİZİ girdinizi kontrol ediniz !");
		return false;
	}
	if (isNaN(theForm.IPC_KANUNI_FAIZ.value)) {
		alert("İPC KANUNİ FAİZ girdinizi kontrol ediniz !");
		return false;
	}
	if (theForm.PEK_TUTAR.value == "") {
		alert("PEK TUTAR girdisini boş geçemezsiniz !");
		return false;
	}
	if (theForm.PRIM_ASIL_BORC.value == "" &&
		theForm.PRIM_GECIKME_ZAMMI.value == "" &&
		theForm.PRIM_TECIL_FAIZI.value == "" &&
		theForm.PRIM_KANUNI_FAIZ.value == "" &&
		theForm.ISS_ASIL_BORC.value == "" &&
		theForm.ISS_GECIKME_ZAMMI.value == "" &&
		theForm.ISS_TECIL_FAIZI.value == "" &&
		theForm.ISS_KANUNI_FAIZ.value == "" &&
		theForm.IPC_ASIL_BORC.value == "" &&
		theForm.IPC_GECIKME_ZAMMI.value == "" &&
		theForm.ISS_TECIL_FAIZI.value == "" &&
		theForm.ISS_KANUNI_FAIZ.value == "") {
		alert("En az bir girdiyi doldurmalısınız !");
		return false;
	}
//	alert("me");
	theForm.submit();
}
function dotremove(elementvalue) {
	var len = elementvalue.length;
	var x = 0, temp;
	while (elementvalue.search(".") != -1) {
		elementvalue = elementvalue.replace(".","");
		++x;
		if (x>len) break;
		continue;
	}
	return elementvalue;
}
function setdot(formelement) {
	formelement.value = makedotted(formelement.value);
	formelement.focus();
	return true;
}
function makedotted(elementvalue) {
	var elementnewvalue,elementoldvalue,newstring,pre,post,len,count,rest,charpos,dottedvalue,firstcharacter = "",sonuc = false;
	elementoldvalue = elementvalue;
	if (elementoldvalue.charAt(0) == "-")
		firstcharacter = "-";
	for(count=0; count < elementoldvalue.length; count++) {
		if (elementoldvalue.charAt(count) >= '1' && elementoldvalue.charAt(count) <= '9') {
			newstring = elementoldvalue.charAt(count);
			charpos = count + 1;
			sonuc = true;
			count = elementoldvalue.length; // break
		}
	}
	if (sonuc) {
		for(count=charpos; count < elementoldvalue.length; count++) {
			if (elementoldvalue.charAt(count) >= '0' && elementoldvalue.charAt(count) <= '9')
				newstring = new String(newstring+elementoldvalue.charAt(count));
		}
		len = newstring.length;
		if (len > 3) {
			rest = len % 3;
			if (rest > 0) {
				pre = new String(newstring.substring(0, rest));
				post = new String(newstring.substring(rest, len));
			} else {
				pre = new String(newstring.substring(0, 3));
				post = new String(newstring.substring(3, len));
			}
			len = post.length;
			elementnewvalue = new String("");
			for(count = 0; count < len; count += 3)
				elementnewvalue = elementnewvalue.concat(new String("."+post.substr(count, 3)));
			dottedvalue = new String(firstcharacter+pre+elementnewvalue);
		} else {
			dottedvalue = new String(firstcharacter + newstring);
		}
		return dottedvalue;
	} else {
		if (elementoldvalue.search("0") != -1)
			dottedvalue = new String("0");
		else
			dottedvalue = new String("");
		return dottedvalue;
	}
}
function virgul(formelement, y) {
	var a,b;
	if ((event.keyCode < 48) || (event.keyCode > 57))
		event.returnValue = false;
	else
		if (formelement.value.length >= y)
			event.returnValue = false;
		else
			if (formelement.value.length >= 3) {
				a = String.fromCharCode(event.keyCode);
				formelement.value = new String(formelement.value+a);
				formelement.value = makedotted(formelement.value);
				event.returnValue = false;
			} else 
				return true;
}