function form_cheking(id,reg)
{
	if(reg.test(document.getElementById(id).value)==true)
	{
		document.getElementById('i_'+id).src='resource/images/true.png';
		document.getElementById('i_'+id).title='OK';
	} 
	else 
	{
		document.getElementById('i_'+id).src='resource/images/false.png';
		document.getElementById('i_'+id).title='Error';
	}
}

function remActive(id,ev)
{
	d = document.getElementById(id);
    tleft = ev.clientX;  
    ttop = ev.clientY;
    d.style.pixelLeft = tleft+10;
    d.style.pixelTop = ttop+20;
    d.style.display = 'block';
}

function checkABA(s) {
    var i, n, t;
    // First, remove any non-numeric characters.
    t = "";
    for (i = 0; i < s.length; i++)
	{
      	c = parseInt(s.charAt(i), 10);
      	if (c >= 0 && c <= 9)t = t + c;
    }

    // Check the length, it should be nine digits.
    if (t.length != 9)return false;

    // Now run through each digit and calculate the total.
    n = 0;
    for (i = 0; i < t.length; i += 3)
	{
      	n += parseInt(t.charAt(i),     10) * 3
          +  parseInt(t.charAt(i + 1), 10) * 7
          +  parseInt(t.charAt(i + 2), 10);
    }

    // If the resulting sum is an even multiple of ten (but not zero),
    // the aba routing number is good.
    if(n != 0 && n % 10 == 0)return true;
    else return false;
}

function aba_cheking(id)
{
	if(checkABA(document.getElementById(id).value)==true)
	{
		document.getElementById('i_'+id).src='resource/images/true.png';
		document.getElementById('i_'+id).title='OK';
	} 
	else 
	{
		document.getElementById('i_'+id).src='resource/images/false.png';
		document.getElementById('i_'+id).title='Error';
	}
}