function submitform(){
	// first check the form is complete
	ERROR = "";
	if (document.getElementById("name").value.length < 1)ERROR = ERROR + "Your name is missing.\n";
	if (document.getElementById("email1").value.length < 1)ERROR = ERROR + "Your email is missing.\n";
	if (document.getElementById("email1").value !== document.getElementById("email2").value)ERROR = ERROR + "Your email address's do not match.\n";
		
	if (ERROR == ""){
		// dissable the button
		document.getElementById("Submit").disabled = true;
		document.getElementById("messagediv").innerHTML = "<img src=\"/images/loadingbar.gif\" alt=\"Please Wait Loading Data\" />";
			
		// grab the data from the server and do what needs to be done
		PARAMETERS = "name=" + encodeURI(document.getElementById("name").value);
		PARAMETERS = PARAMETERS + "&email1=" + encodeURI(document.getElementById("email1").value);
		PARAMETERS = PARAMETERS + "&email2=" + encodeURI(document.getElementById("email2").value);
		PARAMETERS = PARAMETERS + "&Submit=Submit";
						
		if (window.XMLHttpRequest) { // Mozilla, Safari
			http_request = new XMLHttpRequest();
			 if (http_request.overrideMimeType) {
				// set type accordingly to anticipated content type
				http_request.overrideMimeType('text/html');
			 }
		} else if (window.ActiveXObject) { // Internet Explorer
			try {
				http_request = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					http_request = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {}
			}
		}
		if (!http_request){
			alert("Your browser does not support AJAX methods, in order to use this website you will need to upgrade your browser.");
			return false;
		}
		
	
		var URL = "/AJAX/requestcatalogue_ajax.php?"+PARAMETERS;
		// post the info to the URL
		http_request.onreadystatechange = requestsent;
		http_request.open("GET", URL, true);
		http_request.send(null);
	} else {
		alert("There was an error with your submittion.\n"+ERROR+"Please check and try again.");
	}
}

function requestsent(){
	
	var browserName=navigator.appName; 
	var ds=paradocsize();
	if (ds.s > 0){
		TOP = parseFloat(ds.s + 10) + "px";
	} else {
		TOP = 10 + "px";
	}

	LEFT = parseFloat(ds.w / 2);
	pabl = document.getElementById("paramiliar_overlay");
	pacl = document.getElementById("Paramiliar_overlaycont");
		
	pacl.style.width = "500px";
	pacl.style.top = TOP;
	pacl.style.left = parseFloat(LEFT - 250)+"px"; // half of the width
	pacl.style.position = "absolute";
	pacl.style.zindex = "1000001";
	pacl.style.backgroundColor = "#FFFFFF";
	pacl.style.border = "2px solid #000000";

	if (browserName=="Microsoft Internet Explorer"){ 
		HEIGHT = ds.h - 5;
		WIDTH = ds.w - 22;
	} else {
		HEIGHT = ds.h;
		WIDTH = ds.w;
	}

	// setup bg alert layer
	pabl.style.left = '0px';
	pabl.style.top = '0px';
	pabl.style.position = "absolute";
	pabl.style.width = WIDTH+"px";
	pabl.style.height = HEIGHT+"px";
	pabl.style.backgroundColor = "#000000";
	pabl.style.zindex = "1000000";
	pabl.style.filter = "alpha(opacity=65)";
	pabl.style.mozOpacity = ".65";
	pabl.style.opacity = ".65";
	
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			RESPONSE = "";
			RESPONSE = http_request.responseText;
			document.getElementById("Submit").disabled = false;
			if (RESPONSE == "1"){
				// setup the innerHTML section to what we want
				pacl.innerHTML = "<div style=\"width:500px; background-color:#FFFFFF;\"><div style=\"background-color:#352070; color:#FFFFFF; font-weight:bold; width:100%; display:block;\" align=\"center\">Catalogue Request</div><div>We have received your request for our catalogue, you will receive an email shortly with a URL to download the catalogue.  A copy of this request has also been sent to the Paramiliar Design Studios Team.<br><div align=\"center\"><input name=\"Close\" type=\"button\" id=\"Close\" onclick=\"hidelayers();\" value=\"Close\"/></div></div></div>";
			} else {
				pacl.innerHTML = "<div style=\"width:500px; background-color:#FFFFFF;\"><div style=\"background-color:#352070; color:#FFFFFF; font-weight:bold; width:100%; display:block;\" align=\"center\">Catalogue Request</div><div><img src=\"/images/warning.jpg\" width=\"150\" height=\"134\" align=\"left\" alt=\"Warning\" style=\"margin:5px;\" />One or more problems where found with your submision. Please check the following errors and try again.<br><br>"+RESPONSE+"<br /><div align=\"center\"><input name=\"close\" type=\"button\" id=\"close\" style=\"margin:10px;\" onclick=\"hidelayers();\" value=\"Close\"/></div></div></div>";
			}
			document.getElementById("messagediv").innerHTML = "";
			var ds=paradocsize();
			
			if (browserName=="Microsoft Internet Explorer"){ 
				HEIGHT = ds.h - 5;
				WIDTH = ds.w - 22;
			
			} else {
				HEIGHT = ds.h;
				WIDTH = ds.w;
			}
		
			// setup bg alert layer
			pabl.style.left = '0px';
			pabl.style.top = '0px';
			pabl.style.position = "absolute";
			pabl.style.width = WIDTH+"px";
			pabl.style.height = HEIGHT+"px";
			pabl.style.backgroundColor = "#000000";
			pabl.style.zindex = "1000000";
			pabl.style.filter = "alpha(opacity=65)";
			pabl.style.mozOpacity = ".65";
			pabl.style.opacity = ".65";
			pacl.style.display = "block";
			pabl.style.display = "block";
		}
	}
}