﻿// 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;
		} else {
			document.getElementById("contact_form_" + obj.cmsdata_id ).innerHTML = obj.result;
		}
	}
	
}

ce_contact = new parkside.ce_contact();

