
		Prayer = Class.create();

		Object.extend(Prayer.prototype, {
			initialize: function(obj){
				if(obj != null){
					this.pid = obj.pid;
					this.uid = obj.uid;
					this.cid = obj.cid;
					this.title = obj.title;
					this.excerpt = obj.excerpt;
					this.body = obj.body;
					this.post_date = obj.post_date;
					this.edit_date = obj.edit_date;
				}
			},

			getPid: function(){
				return this.pid;
			},
			setPid: function(pid){
				this.pid = pid;
			},
			getUid: function(){
				return this.uid;
			},
			setUid: function(uid){
				this.uid = uid;
			},
			getCid: function(){
				return this.cid;
			},
			setCid: function(cid){
				this.cid = cid;
			},
			getTitle: function(){
				return this.title;
			},
			setTitle: function(title){
				this.title = title;
			},
			getExcerpt: function(){
				return this.excerpt;
			},
			setExcerpt: function(excerpt){
				this.excerpt = excerpt;
			},
			getBody: function(){
				return this.body;
			},
			setBody: function(body){
				this.body = body;
			},
			getPost_date: function(){
				return this.post_date;
			},
			setPost_date: function(post_date){
				this.post_date = post_date;
			},
			getEdit_date: function(){
				return this.edit_date;
			},
			setEdit_date: function(edit_date){
				this.edit_date = edit_date;
			}
		});//End Prayer.prototype

		
	
		PrayerController = Class.create();
		Object.extend(PrayerController.prototype, {
		

			initialize: function(){},
			
			setAjaxRendered: function(val) {
				this.reRendered = val;
			},			
			getAjaxRendered: function() {
				return this.reRendered;
			},			
			


			_create: function(obj){
				var ajaxRenderedIds = new Array();
				
				if(this.reRendered == true) {
					$$('.ajaxRendered').each(function(elm) {
						ajaxRenderedIds[ajaxRenderedIds.length] = elm.id;
					});
				}
				
				var onSuccess = function(transport) {
					if(this.getAjaxRendered() == true) {
						var newHTML = JSON.parse(transport.responseText).renderedHTML;
						var ajaxDivs = $$('.ajaxRendered');
						
						for (var index = 0, len = ajaxDivs.length; index < len; ++index) {
							ajaxDivs[index].update(newHTML[index]);
						}
					}
					
					doPrayerControllerCreate(JSON.parse(transport.responseText).result);
				
				}.bind(this);
				
					
				new Ajax.Request('/remote/remote.php', {
					parameters: { funct:"create", data:obj, clazz:"PrayerController" , reRenderIds:JSON.stringify(ajaxRenderedIds), inputs:new Hash(Form.serializeElements($$('.ajax_input'),{getHash:true})).toJSON() },
					onSuccess: onSuccess,
    				onFailure: function(){ alert('Something went wrong...') }
				});
			},
			_retrieve: function(obj){
				var ajaxRenderedIds = new Array();
				
				if(this.reRendered == true) {
					$$('.ajaxRendered').each(function(elm) {
						ajaxRenderedIds[ajaxRenderedIds.length] = elm.id;
					});
				}
				
				var onSuccess = function(transport) {
					if(this.getAjaxRendered() == true) {
						var newHTML = JSON.parse(transport.responseText).renderedHTML;
						var ajaxDivs = $$('.ajaxRendered');
						
						for (var index = 0, len = ajaxDivs.length; index < len; ++index) {
							ajaxDivs[index].update(newHTML[index]);
						}
					}
					
					doPrayerControllerRetrieve(JSON.parse(transport.responseText).result);
				
				}.bind(this);
				
					
				new Ajax.Request('/remote/remote.php', {
					parameters: { funct:"retrieve", data:obj, clazz:"PrayerController" , reRenderIds:JSON.stringify(ajaxRenderedIds), inputs:new Hash(Form.serializeElements($$('.ajax_input'),{getHash:true})).toJSON() },
					onSuccess: onSuccess,
    				onFailure: function(){ alert('Something went wrong...') }
				});
			},
			_delete: function(obj){
				var ajaxRenderedIds = new Array();
				
				if(this.reRendered == true) {
					$$('.ajaxRendered').each(function(elm) {
						ajaxRenderedIds[ajaxRenderedIds.length] = elm.id;
					});
				}
				
				var onSuccess = function(transport) {
					if(this.getAjaxRendered() == true) {
						var newHTML = JSON.parse(transport.responseText).renderedHTML;
						var ajaxDivs = $$('.ajaxRendered');
						
						for (var index = 0, len = ajaxDivs.length; index < len; ++index) {
							ajaxDivs[index].update(newHTML[index]);
						}
					}
					
					doPrayerControllerDelete(JSON.parse(transport.responseText).result);
				
				}.bind(this);
				
					
				new Ajax.Request('/remote/remote.php', {
					parameters: { funct:"delete", data:obj, clazz:"PrayerController" , reRenderIds:JSON.stringify(ajaxRenderedIds), inputs:new Hash(Form.serializeElements($$('.ajax_input'),{getHash:true})).toJSON() },
					onSuccess: onSuccess,
    				onFailure: function(){ alert('Something went wrong...') }
				});
			},
			_update: function(obj){
				var ajaxRenderedIds = new Array();
				
				if(this.reRendered == true) {
					$$('.ajaxRendered').each(function(elm) {
						ajaxRenderedIds[ajaxRenderedIds.length] = elm.id;
					});
				}
				
				var onSuccess = function(transport) {
					if(this.getAjaxRendered() == true) {
						var newHTML = JSON.parse(transport.responseText).renderedHTML;
						var ajaxDivs = $$('.ajaxRendered');
						
						for (var index = 0, len = ajaxDivs.length; index < len; ++index) {
							ajaxDivs[index].update(newHTML[index]);
						}
					}
					
					doPrayerControllerUpdate(JSON.parse(transport.responseText).result);
				
				}.bind(this);
				
					
				new Ajax.Request('/remote/remote.php', {
					parameters: { funct:"update", data:obj, clazz:"PrayerController" , reRenderIds:JSON.stringify(ajaxRenderedIds), inputs:new Hash(Form.serializeElements($$('.ajax_input'),{getHash:true})).toJSON() },
					onSuccess: onSuccess,
    				onFailure: function(){ alert('Something went wrong...') }
				});
			}		});//End PrayerController.prototype

		