﻿function submitForm(name){
                var f=document.forms[name];
                if(f){
                                if(submitForm.arguments.length>1)
                                                if(submitForm.arguments[1])
                                                                f.method=submitForm.arguments[1];
                                if(submitForm.arguments.length>2)
                                                if(submitForm.arguments[2])
                                                                f.action=submitForm.arguments[2];
                                if(f.onsubmit)
                                                f.onsubmit();
                                f.submit();
                }
                else
                                alert('Form not found.');
}
function doPost(formID, action, emailControlName){
				//alert('Form found.');
	if (checkEmail(emailControlName)){
		submitForm(formID, 'post', action);
	}
}
function checkEmail(emailControlName) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById(emailControlName).value)){
	return true;
}
	alert("Invalid E-mail Address! Please re-enter.");
	return false;
}