var gbook = "";
gbook = gbook +"";
gbook = gbook +"function check(obj) {";
gbook = gbook +"document.getElementById(\"belong\").value=document.getElementById(\"gbelong\").innerHTML;";
gbook = gbook +"var strErr=\"\";";
gbook = gbook +"if(obj.gname.value==\"\") {strErr\+=\"Please enter your name!\\n\";}";
gbook = gbook +"if (obj.gemail.value!=\"\"){";
gbook = gbook +"var email = new String();";
gbook = gbook +"var flag = true;";
gbook = gbook +"email = obj.gemail.value;";
gbook = gbook +"var tagIndex = email.lastIndexOf(\'@\');";
gbook = gbook +"if((tagIndex==-1)||(tagIndex==email.length-1)) {flag = false;}";
gbook = gbook +"var tagIndex1 = email.lastIndexOf(\'.\');";
gbook = gbook +"if((tagIndex1==-1)||(tagIndex1<=tagIndex)||(tagIndex1==email.length-1)) {flag = false;}";
gbook = gbook +"if(!flag) {strErr+=\"Please check your E-mail!\\n\";}";
gbook = gbook +"}";
gbook = gbook +"if(obj.gcontent.value==\"\") {strErr+=\"The content must be filled!\\n\";}";
gbook = gbook +"if(obj.gcode.value==\"\") {strErr+=\"Please enter the confirmation code!\\n\";}";
gbook = gbook +"if(obj.gemail.value==\"\" && obj.gmsn.value==\"\") {strErr+=\"Please enter your contact information!\\n\";}";
gbook = gbook +"if(strErr!=\"\") {alert(strErr);return false;}";
gbook = gbook +"return true;";
gbook = gbook +"}";
gbook = gbook +"";
gbook = gbook +"
";
document.writeln(gbook);