function blurText(elementID,defaultText) {
                if (document.getElementById(elementID).value == "") {
                    document.getElementById(elementID).value = defaultText;
                    document.getElementById(elementID).style.color = "#999999";
                }
			}
			function focusText(elementID,defaultText) {
                if (document.getElementById(elementID).value == defaultText) {
                    document.getElementById(elementID).value = "";
                    document.getElementById(elementID).style.color = "#000000";
                }
			}
            function createAjaxRequest() {
	            var xmlHttp;
                // Create the object for XML requests via HTTP
            	try {
                    // Firefox, Opera, and Safari...
            		xmlHttp = new XMLHttpRequest();
            	} catch (e) {
                    // Internet Explorer...
            		try {
            			xmlHttp = new ActiveXObject("Msxml6.XMLHTTP");
            		} catch (e) {
            			try {
            				xmlHttp = new ActiveXObject("Msxml3.XMLHTTP");
            			} catch (e) {
                            // Only Msxml3 and Msxml6 are currently supported by Microsoft.
                            // Msxml, Msxml2, Msxml4, and Msxml5 are deprecated and/or unsupported (i.e. no security or stability updates)
            				alert("Your browser doesn't support AJAX! Please download the newest version of Mozilla Firefox, Apple Safari, or Microsoft Internet Explorer.");
            				return false;
            			}
            		}
            	}
                return xmlHttp;
            }
            function validEmail(email) {
                // Validate an email address
                var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
                if(reg.test(email) == false) {
                    return false;
                } else {
                    return true;
                }
            }
            function submitContactForm() {
				var xmlHttp;
                // Validate and process the "Contact Me" form when it is submitted
                var contactName = document.getElementById("name").value;
                var contactEmail = document.getElementById("email").value;
                var contactMsg = document.getElementById("msg").value;
                var errMsg = "";
                
                if (contactName == null) {
                    errMsg += "\"Name\" is a required field!\n";
                } else {
                    if (contactName == "") {
                        errMsg += "\"Name\" is a required field!\n";
                    }
                }
                
                if (contactEmail == null) {
                    errMsg += "\"Email\" is a required field!\n";
                } else {
                    if (contactEmail == "") {
                        errMsg += "\"Email\" is a required field!\n";
                    } else {
                        if (!validEmail(contactEmail)) {
                            errMsg += "\"Email\" is invalid!\n";
                        }
                    }
                }
                
                if (contactMsg == null) {
                    errMsg += "\"Message\" is a required field!\n";
                } else {
                    if (contactMsg == "") {
                        errMsg += "\"Message\" is a required field!\n";
                    }
                }
                
                if (errMsg != "") {
                    alert("The \"Contact Me\" form you submitted had the following errors:\n\n" + errMsg);
                    return;
                } else {
                    xmlHttp = createAjaxRequest();
                    xmlHttp.onreadystatechange = function(){
                    	if(xmlHttp.readyState == 4) {
                            if(xmlHttp.status == 200) {
                                document.getElementById("content_swap").innerHTML = xmlHttp.responseText;
                            }
                   	    }
                    }
                    xmlHttp.open("POST", "/process_contact_form.php", true);
                    xmlHttp.setRequestHeader("X-Requested-With","XMLHttpRequest");
					xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
                    xmlHttp.send("name=" + escape(contactName) + '&email=' + escape(contactEmail) + '&msg=' + escape(contactMsg));
                }
            }
