/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Chris van Marle |  */

FormName  = "contest"  //Name of the form
CheckName = "task" //Name of the checkboxes (without 1,2,3...10,11,12...)
TextName  = "answer"  //Name of the textfields (without 1,2,3...10,11,12...)

var Condition=new Array(
'a!=""', //Must be filled
'a!=""', //Must be filled
'a!=""&&a.length>5&&a.indexOf("@")!=-1&&a.indexOf(".")!=-1', //Must be longer than 5 characters, have @, and atleast one '.'
'a.length>7&&!(a.split("/")[0]*1>12)&&!(a.split("/")[1]*1>31)&&!(a.split("/")[2]*1<1900)' //Must be longer than 7 characters, first (two) digit(s) NOT greater than 12, second (two) digit(s) NOT greater than 31 and last 4 greater than 1900
);
function docheck(w) {
eval("a=document." + FormName + "." + TextName + w + ".value");
if (eval(Condition[w])) eval("document." + FormName + "." + CheckName + w + ".checked=true");
else eval("document." + FormName + "." + CheckName + w + ".checked=false");
}

