function trim(s) {
while (s.substring(0,1) == ' ') {
s = s.substring(1,s.length);
}
while (s.substring(s.length-1,s.length) == ' ') {
s = s.substring(0,s.length-1);
}
return s;
}
function checkEmail (strng) {
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (filter.test(strng)) return true;
else return false;
}
function checkString (strng) {
if (trim(strng) == "") return false;
else return true;
}
function checkCaptcha (question, answer) {
 var array = question.split(" ");
 if (array[1] == '+') result = Number(array[0]) + Number(array[2]);
 else result = Number(array[0]) * Number(array[2]);
 if (result == answer) return true;
 else return false;
}

