Warning: include_once(js/t.inc.php) [function.include-once]: failed to open stream: No such file or directory in /home1/hksuning/public_html/js/com.lang.php on line 1
Warning: include_once() [function.include]: Failed opening 'js/t.inc.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home1/hksuning/public_html/js/com.lang.php on line 1
function sendemail()
{
var f = document.frmcontact;
var msg = "";
if (isEmpty(f.message)) {
msg += "Please input message.\n";
}
if (isEmpty(f.yourname)) {
msg += "Please input your name.\n";
}
if (isEmpty(f.youremail)) {
msg += "Please input your email address.\n";
}
if (!isEmpty(f.youremail)) {
if (!isEMail(f.youremail)) {
msg += "Your email address is not valid, please input again.\n";
}
}
if (msg != "") {
alert(msg);
return false;
}
ajax.setVar("yourname", f.yourname.value);
ajax.setVar("youremail", f.youremail.value);
ajax.setVar("message", f.message.value);
ajax.requestFile = "sendmail.php";
ajax.method = "POST";
ajax.onCompletion = showMailSent;
ajax.runAJAX();
}
function clearform(needconfirm)
{
if (needconfirm == undefined) {
if (!confirm("Clear the information you have entered ?")) return;
}
var f = document.frmcontact;
f.reset();
}
function showMailSent()
{
clearform(false);
alert("Thank you for your comments!");
}
function isEmpty(t)
{
var s = new String(t.value);
var re = /^\s*$/;
return (s.match(re));
}
function isEMail(t)
{
var s = new String(t.value);
var re = /^\s*\S+[@]\S+[\.]\S+\s*$/;
return (s.match(re));
}