<!--
function descm(form)
	{
		valid = true;
		var d_ma = trim(form1._mdesc.value);
		if ((d_ma == "") || !(isNaN(d_ma)))
		{
			alert("Information is missing in the 'Description' box.");
			form1._mdesc.focus();
			form1._mdesc.value = "";
			valid = false;
		}
		return valid;
	}
function descc(form)
{
		valid = true;
		var d_co = trim(form1._cdesc.value);
		if ((d_co == "") || !(isNaN(d_co)))
		{
			alert("Information is missing in the 'Description' box.");
			form1._cdesc.focus();
			form1._cdesc.value = "";
			valid = false;
		}
		return valid;
	}
	function descs(form)
	{
		valid = true;
		var d_su = trim(form1._sdesc.value);
		if ((d_su == "") || !(isNaN(d_su)))
		{
			alert("Information is missing in the 'Description' box.");
			form1._sdesc.focus();
			form1._sdesc.value = "";
			valid = false;
		}
		return valid;
	}
	
function datevalidate(form)
{
valid = true;
	
	
	var v_d1 = trim(cashform._da1.value);
	var v_d2 = trim(cashform._da2.value);
	var v_date = trim(cashform._date.value);
	var data = v_date.split("-");		
	var data1 = v_d1.split("-");		
	var data2 = v_d2.split("-");		
	
	////////date  format conversion
		var day1 = data[0];
		var mon1 = data[1];
		var year1= data[2];
		var date_1 = year1+"-"+mon1+"-"+day1;
	////////date  format conversion
		var year2 = data1[0];
		var mon2  = data1[1];
		var day2  = data1[2];
		var date_2 = day2+"-"+mon2+"-"+year2;
	////////date  format conversion
		var year3 = data2[0];
		var mon3  = data2[1];
		var day3  = data2[2];
		var date_3 = day3+"-"+mon3+"-"+year3;
		
	
	if(date_1 > v_d2 || date_1 < v_d1 || v_date == "")
	{
	alert("'Date' Must Between " +date_2+ " AND " +date_3);
			cashform._date.focus();
			cashform._date.select();
			valid = false;
	}
	
return valid;
}
function formvalidate(form)
{
	valid = true;
	
	var v_sh1 = trim(cashform._short.value);
	var v_vd1 = trim(cashform._vdesc.value);
	var v_su1 = trim(cashform._sub.value);
	var v_de1 = trim(cashform._desc.value);
	var v_na1 = trim(cashform._nar.value);
	var v_am1 = trim(cashform._amt.value);
		
	if ((v_sh1 == "no"))
		{
			alert("Please fill valid information in the 'Short' box.");
			cashform._short.focus();
			cashform._short.value = "";
			valid = false;
		}
	else if ((v_su1 == "") || isNaN(v_su1) || v_su1.length !=9 )
		{
			alert("Please fill valid information in the 'Code' box.");
			cashform._sub.focus();
			cashform._sub.value = "";
			valid = false;
		}
	else if ((v_de1 == ""))
		{
			alert("Please fill valid information in the 'Code' box.");
			cashform._sub.focus();
			cashform._sub.value = "";
			valid = false;
		}
	else if ((v_na1 == "") || !(isNaN(v_na1)))
		{
			alert("Please fill valid information in the 'Narration' box.");
			cashform._nar.focus();
			cashform._nar.value = "";
			valid = false;
		}
	else if (v_na1 !== v_na1.toUpperCase())
		{
			var v_na2 = v_na1.toUpperCase();
			
			cashform._nar.value = v_na2;
			valid = false;
		}	
	else if (v_am1 == "" || isNaN(v_am1))
		{
			alert("Please fill valid information in the 'Amount' box.");
			cashform._amt.focus();
			cashform._amt.value = "";
			valid = false;
		}
	return valid;
}
function populate()
{
	var v_da1 = trim(cashform._date.value);
	
	var v_sh1 = trim(cashform._short.value);
	var v_vd1 = trim(cashform._vdesc.value);
	var v_su1 = trim(cashform._sub.value);
	var v_de1 = trim(cashform._desc.value);
	var v_na1 = trim(cashform._nar.value);
	var v_am1 = trim(cashform._amt.value);
	var v_text= trim(cashform._textarea.value);
	
	if (v_text == ""){
		var text = ("CODE:(" + v_su1 + ") DESC:(" +v_de1+ ") NARR:(" +v_na1+ ") AMOUNT:("+ v_am1+ ")");
	}
	else{
	var text = (v_text +"\n"+ "CODE:(" +v_su1+ ") DESC:(" +v_de1+ ") NARR:(" +v_na1+ ") AMOUNT:(" +v_am1+ ")");
	}	
	cashform._textarea.value = text;
	
	cashform._sub.value = "";
	cashform._desc.value = "";
	cashform._nar.value = "";
	cashform._amt.value = "";
	cashform._sub.focus();
		
}
function Jpopulate()
{
	var v_da1 = trim(cashform._date.value);
	var v_su1 = trim(cashform._sub.value);
	var v_de1 = trim(cashform._desc.value);
	var v_na1 = trim(cashform._nar.value);
	var v_dr1 = trim(cashform._dr.value);
	var v_cr1 = trim(cashform._cr.value);
	var v_text= trim(cashform._textarea.value);
	
	
	if (v_text == ""){
		var text = ("CODE:(" + v_su1 + ") DESC:(" +v_de1+ ") NARR:(" +v_na1+ ") DR:("+ v_dr1+ ") CR: (" +v_cr1+ ")");
	}
	else{
	var text = (v_text +"\n"+ "CODE:(" +v_su1+ ") DESC:(" +v_de1+ ") NARR:(" +v_na1+ ") DR:(" +v_dr1+ ") CR: (" +v_cr1+ ")");
	}	
	cashform._textarea.value = text;
	
	cashform._sub.value = "";
	cashform._desc.value = "";
	cashform._nar.value = "";
	cashform._dr.value = "";
	cashform._cr.value = "";
	cashform._sub.focus();
		
}

function jvalidate(form)
{
	valid = true;
		
	var v_su1 = trim(cashform._sub.value);
	var v_de1 = trim(cashform._desc.value);
	var v_na1 = trim(cashform._nar.value);
	var v_dr1 = trim(cashform._dr.value);
	var v_cr1 = trim(cashform._cr.value);
			
	if ((v_su1 == "") || isNaN(v_su1) || v_su1.length !=9 )
		{
			alert("Please fill valid information in the 'Code' box.");
			cashform._sub.focus();
			cashform._sub.value = "";
			valid = false;
		}
	else if ((v_na1 == ""))
		{
			alert("Please fill valid information in the 'Narration' box.");
			cashform._nar.focus();
			cashform._nar.value = "";
			valid = false;
		}
	else if (v_na1 !== v_na1.toUpperCase())
		{
			var v_na2 = v_na1.toUpperCase();
			
			cashform._nar.value = v_na2;
			valid = false;
		}
	return valid;
}

function validatecash()
{
	var err = false;
/**	valid = true;
	var v_da = trim(cashform._date.value);
	var v_cb = trim(cashform._cbal.value);
	var v_sh = trim(cashform._short.value);
	var v_vd = trim(cashform._vdesc.value);
	var v_vn = trim(cashform._vno.value);
	var v_su = trim(cashform._sub.value);
	var v_de = trim(cashform._desc.value);
	var v_na = trim(cashform._nar.value);
	var v_am = trim(cashform._amt.value);

	if ((v_da == ""))
		{
			alert("Please fill valid information in the 'Date' box.");
			cashform._date.focus();
			cashform._date.value = "";
			valid = false;
		}
	else if ((v_sh == ""))
		{
			alert("Please fill valid information in the 'Short' box.");
			cashform._short.focus();
			cashform._short.value = "";
			valid = false;
		}
	else if ((v_su == "") || isNaN(v_su) || v_su.length !=9 )
		{
			alert("Please fill valid information in the 'Code' box.");
			cashform._sub.focus();
			cashform._sub.value = "";
			valid = false;
		}
	else if ((v_na == "") || !(isNaN(v_na)))
		{
			alert("Please fill valid information in the 'Narration' box.");
			cashform._nar.focus();
			cashform._nar.value = "";
			valid = false;
		}
	else if ((v_am == "") || isNaN(v_am))
		{
			alert("Please fill valid information in the 'Amount' box.");
			cashform._amt.focus();
			cashform._amt.value = "";
			valid = false;
		}
**/
	if(!err)	
	{
		var cnt = document.cashform.counting.value;
		
		document.cashform.action='table.php?tk=login&dt='+data+'&count='+cnt+'';
		document.cashform.submit();
	}
	else
	{
		alert('There is some invalid data');
	}
}



	function subsidary(form)
	{

		valid = true;
		
		var v_ma = trim(form._cat.value);
		var v_co = trim(form._subcat.value);
		var v_sub = trim(form._sub.value);
		var v_sdesc = trim(form._sdesc.value);
		var v_dr = trim(form._od.value);
		var v_cr = trim(form._oc.value);
		
				
		if ((v_ma == ""))
		{
			alert("Please fill valid information in the 'Main' box.");
			form._cat.focus();
			form._cat.value = "";
			valid = false;
		}
		else if ((v_co == ""))
		{
			alert("Please fill valid information in the 'Control' box.");
			form._subcat.focus();
			form._subcat.value = "";
			valid = false;
		}
		else if ((v_sub == "") || isNaN(v_sub) || v_sub.length != 4)
		{
			alert("Please fill valid information in the 'Subsidary' box.");
			form._sub.focus();
			form._sub.value = "";
			valid = false;
		}
		else if ((v_sdesc == "") || !(isNaN(v_sdesc)))
		{
			alert("Information is missing in the 'Description' box.");
			form._sdesc.focus();
			form._sdesc.value = "";
			valid = false;
		}
		else if ((v_dr == ""))
		{
			alert("Information is missing in the 'OPening DR' box.");
			form._od.focus();
			form._od.value = "";
			valid = false;
		}
		else if ((v_cr == ""))
		{
			alert("Information is missing in the 'Opening CR' box.");
			form._oc.focus();
			form._oc.value = "";
			valid = false;
		}
		
		return valid;
	}
	

		
	function branches(form)
	{

		valid = true;

		var v_br = trim(form._br.value);
		
		
		if ((v_br == ""))
		{
			alert("Please fill valid information in the 'Branch' box.");
			form._br.focus();
			form._br.value = "";
			valid = false;
		}
		
		return valid;
	}
	
		
	
	function control(form)
	{

		valid = true;

		var v_cd = trim(form._cd.value);
		var v_ma = trim(form._main.value);
		var v_na = trim(form._cont.value);
		var v_co = trim(form._cdesc.value);
		
		if ((v_cd == "") || isNaN(v_cd) || v_cd.length != 2)
		{
			alert("Please fill valid information in the 'Main' box.");
			form._cd.focus();
			form._cd.value = "";
			valid = false;
		}
		else if ((v_ma == ""))
		{
			alert("Please fill valid information in the 'Main' box.");
			form._main.focus();
			form._main.value = "";
			valid = false;
		}
		else if ((v_na == "") || isNaN(v_na) || v_na.length != 3)
		{
			alert("Please fill valid information in the 'Control' box.");
			form._cont.focus();
			form._cont.value = "";
			valid = false;
		}
		else if ((v_co == "") || !(isNaN(v_co)))
		{
			alert("Information is missing in the 'Description' box.");
			form._cdesc.focus();
			form._cdesc.value = "";
			valid = false;
		}
		
		return valid;
	}
	
		
	function validate(form)
	{

		valid = true;

		var v_na = trim(form._main.value);
		var v_co = trim(form._mdesc.value);
		
		if ((v_na == "") || isNaN(v_na) || v_na.length != 2)
		{
			alert("Please fill valid information in the 'Main' box.");
			form._main.focus();
			form._main.value = "";
			valid = false;
		}
		else if ((v_co == "") || !(isNaN(v_co)))
		{
			alert("Information is missing in the 'Description' box.");
			form._mdesc.focus();
			form._mdesc.value = "";
			valid = false;
		}
		
		return valid;
	}
	
	
	function subsidary(form)
	{

		valid = true;

		var v_ma = trim(form.cat.value);
		var v_co = trim(form.subcat.value);
		var v_sub = trim(form._sub.value);
		var v_sdesc = trim(form._sdesc.value);
		
		if ((v_ma == ""))
		{
			alert("Please fill valid information in the 'Main' box.");
			form.cat.focus();
			form.cat.value = "";
			valid = false;
		}
		else if ((v_co == ""))
		{
			alert("Please fill valid information in the 'Control' box.");
			form.subcat.focus();
			form.subcat.value = "";
			valid = false;
		}
		else if ((v_sub == "") || isNaN(v_sub) || v_sub.length != 4)
		{
			alert("Please fill valid information in the 'Subsidary' box.");
			form._sub.focus();
			form._sub.value = "";
			valid = false;
		}
		else if ((v_sdesc == "") || !(isNaN(v_sdesc)))
		{
			alert("Information is missing in the 'Description' box.");
			form._sdesc.focus();
			form._sdesc.value = "";
			valid = false;
		}
		
		return valid;
	}
		
	
	function pa(form)
	{
	
		valid = true;
	
		var p_o = form.o_.value;
		var p_n = form.n_.value;
		var p_r = form.r_.value;


		if (p_o == "")
		{
			alert("Information is missing in the 'Old Password' box.");
			form.o_.focus();
			valid = false;
		}

		else if (p_n == "")
		{
			alert("Information is missing in the 'New Password' box.");
			form.n_.focus();
			valid = false;
		}

		else if (p_r == "")
		{
			alert("Information is missing in the 'Re Password' box.");
			form.r_.focus();
			valid = false;
		}

		else if (p_r != p_n)
		{
			alert("Both New Passwords Doesn't Match");
			form.n_.value = "";
			form.r_.value = "";
			form.n_.focus();
			valid = false;
		}

		
		return valid;
	}
	
	function trim(str)
	{
		var i=0,p = str.length-1;
		while(str.charAt(i)==' ') i++;
		while(str.charAt(p)==' ') p--;
		if(i>p) return '';
		return str.substring(i,p+1);
	}
	
	

	
//-->