﻿// JavaScript Document


if(typeof parkside == "undefined") var parkside = new Object();
if(typeof parkside.ce_contact == "undefined") parkside.ce_contact = new Object();

// Constructor
parkside.ce_contact = function() {
}

/// Class members
parkside.ce_contact.prototype = {
/// Properties

/// Methods
	request: function(form, cmsdata_id) { 

		if( typeof http == "undefined" ) {
			alert("JSMX not included!");
			return;
		}
/*		document.getElementById("loading_" + cmsdata_id).style.display = 'block';
*/		
		http( "POST" , "custom/data_components.cfc?method=contactEmail" , this.response, form ); //notice the third argument = list_response. This is the callback function below.

	}
	,
	response: function(obj) { //callback functions always take one argument. This is the result passed back from the server.
		/*
		document.getElementById("loading_" + obj.cmsdata_id).style.display = 'none';
		if (obj.error == "true") {
			document.getElementById("contact_form_" + obj.cmsdata_id + "_error").innerHTML = obj.result;
			if (obj.reset == "true") {
				document.form1.name.value = "Name";
				document.form1.email.value = "EMail";
			}
		} else {
			document.getElementById("contact_form_" + obj.cmsdata_id ).innerHTML = obj.result;
			if (obj.reset == "true") {
				document.form1.name.value = "Name";
				document.form1.email.value = "EMail";
			}
			
			
		
		}*/
		
		document.getElementById("contact_form_" + obj.cmsdata_id ).innerHTML = obj.result;
		document.getElementById("newsletter-message-container_" + obj.cmsdata_id ).style.display = "block";
		var nl_sign_timeout = setTimeout(x = function() { document.getElementById("newsletter-message-container_" + obj.cmsdata_id ).style.display = "none"; }, 10000);
			if (obj.reset == "true") {
				document.form1.name.value = "Name";
				document.form1.email.value = "EMail";
			}
	}

}

ce_contact = new parkside.ce_contact();
