function mouseOverHighlight(a) {
	a.style.backgroundColor='#ccbbbb';
}

function mouseOutReg(a) {
	a.style.backgroundColor='white';
}

function clearText(thefield) {

if (thefield.defaultValue==thefield.value)
	thefield.value = "";
} 

function winify(url, features) {
  window.open(url, "_blank", features);
}

//function killqq (a) {

//if (!a) return true
//var filter=/"/
//if (filter.test(a.value)) { 
//	alert("invalid characters")
//	a.select()
//	testresult=false
//}
//else { testresult=true }
//return (testresult)
//}

function killqq(a) {

if (a) {
	mystring=a.value;
	qqindex=mystring.indexOf("\"");
	while(qqindex >= 0) {
		mystring=mystring.substring(0,qqindex)+"''"+mystring.substring(qqindex+1);
		qqindex=mystring.indexOf("\"");
	}
	a.value = mystring
}
return true;
}



function checkemail(a) {

var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(a.value)) { testresult=true }
else{
	alert("Please input a valid email address!")
	a.select()
	testresult=false
}
return (testresult)
}

function checknumber(a) {

var filter=/(^\d+$)|(^\d+\.\d+$)/
if (filter.test(a.value)) { testresult=true }
else{
	alert("Numbers only in this field")
	a.select()
	testresult=false
}
return (testresult)
}

function checkpassword(a,b) {

var filter=/^([\w-]+(?:\.[\w-]+)*)$/i
if (filter.test(a.value) && (a.value).length > 4 && (a.value == b.value)) { testresult=true }
else{
	alert("Password not in a valid format")
	a.select()
	testresult=false
	}
return (testresult)
}


function checkphone(a) {

var filter=/\(?\d{3}(\)|\)?[\.\-\s]?)\d{3}[\.\-\s]?\d{4}$/
if (filter.test(a.value) || ((a.value).length == 0)) { testresult=true }
else{
	alert("Phone number seems invalid")
	a.select()
	testresult=false
	}
return (testresult)
}
