function chk_regExp_test( obj, target )
{
	var re = new RegExp( target );
	var m = re.exec( obj.value );
	return m;
}
function chk_regExp( obj, target, sample, exectLength, wypelnianieDoKonca )
{
	if( exectLength )
		obj.maxLength = sample.length;
	var m = chk_regExp_test( obj, target );
	if( m == null )
	{
		obj.style.backgroundColor="yellow";
	}
	else
	{
		obj.style.backgroundColor = null;
	}
	//document.getElementById("ala").innerHTML = m;
	//alert(obj.selectionStart);
	if( m == null && ( wypelnianieDoKonca ) )
	{
		var cur = obj.selectionStart;
		var toAdd = sample.substring(
			cur,
			sample.length
			);
		obj.value+= toAdd;
		obj.selectionStart = cur;
	}
	//document.getElementById("alaS").innerHTML = toAdd;
}

