function writeObject(str, mdiv) {
    var d = document.getElementById(mdiv);
    d.innerHTML = str;
}

function sizedPopup(url,width,height,top,left,type) {
	  self.name = "opener";
	  remote = open(url, "remote", "resizable,scrollbars=0,status,width="+width+",height="+height+",left="+left+",top="+top);
	  if (type==1) {
		   window.focus();
		   remote.blur();
	  } else {
		   remote.focus();
	  }
}

function checkEmail(emailAddress) {
        if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(emailAddress)) {
            return (true)
        }
        return (false)
    }

function validateForm(fullname,address1,citystatezip,email) {
		if (fullname == "" || fullname == null || address1 == "" || address1 == null || citystatezip == "" || citystatezip == null || email =="" || email == null) {
		alert ('Please provide data for all required fields \(those marked with an asterisk\).');
		return false;
		}
		if (!checkEmail(email)) {
			alert("That e-mail address appears to be invalid, please double-check it and try again.");
			return false;
		}
		else {
				return true;	
		}
}





