function mStyle(ob,act)
{
if (act==1) {ob.style.backgroundColor = '#e0e0e0';ob.style.color='#ff0000';ob.style.fontStyle = 'italic';ob.style.fontWeight = 'bold';}
else {ob.style.backgroundColor = '';ob.style.color='#000000';ob.style.fontStyle = 'normal';ob.style.fontWeight = 'normal';}
}

function onlyNumbers(ob)
{
var thekey = String.fromCharCode(event.keyCode);
var re = /[^0-9]/;
if (re.test(thekey)) {event.keyCode = false;}
}

function onlyphones(ob)
{
var thekey = String.fromCharCode(event.keyCode);
var re = /[^0-9\ ]/;
if (re.test(thekey)) {event.keyCode = false;}
}


function chkPhones(ob)
{
var re = /[^0-9\ ]/;
var ret = false;
var i = 0;
var pho;

if (re.test(ob.value)) {ret = true;}
else
	{
	while (-1 < ob.value.indexOf("  "))
		{
		ob.value = ob.value.split("  ").join(" ");
		}
	pho = ob.value.split(" ");
	while(i<pho.length)
		{
		if(pho[i].length<9) {ret = true;}
		i++;
		}
	}

if (ret) {ob.style.backgroundColor = "#ffff00";return 1;}
else {return 0;}
}

function validateEmail(email) 
{
var re;
re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
if (!re.test(email)) {return false;}
else {return true;}
} 

function chkMail(ob)
{
var ret = 1;
ob.value = ob.value.toLowerCase();
if ((ob.value != "") && (validateEmail(ob.value))) {ret = 0;}
else {ob.style.backgroundColor = "#ffff00";}
return ret;
}

function minOt(ob,min)
{
if (ob.value.length < min) {ob.style.backgroundColor = "#ffff00";return 1;}
else {return 0;}
}
function clearBgColor(ob){ob.style.backgroundColor = "";}





