﻿// JavaScript Document


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

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

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

/// Methods
	request: function(form) { 

		if( typeof http == "undefined" ) {
			alert("JSMX not included!");
			return false;
		}
		//document.getElementById("loading_" + cmsdata_id).style.display = 'block';
		
//		if (form.plz.value.length < 4 && form.liefermenge.value == "" ) {
//			document.getElementById("bestellung_kosten_" + form.cmsdata_id.value).innerHTML = "";
//			return false;
//		}
			
		http( "POST" , "custom/data_components.cfc?method=pelletsBestellung" , this.response, form ); //notice the third argument = list_response. This is the callback function below.
		return false;
	}
	,
	response: function(obj) { //callback functions always take one argument. This is the result passed back from the server.
		document.getElementById("bestellung_kosten_" + obj.cmsdata_id).innerHTML = obj.response;		
	}

}

ce_bestellung = new parkside.ce_bestellung();

