//requires to include successFunc and failFunc in other js 
var AjaxUtil = Class.create({
					   initialize: function(pg, paramVal, methodChoise)
					   {
					   	  this.setConfig(pg, paramVal, methodChoise);
					   },
					   test: function()
					   {
						   alert('');
					   },
					   setConfig:function(pg, paramVal, methodChoise)
					   {
						  this.page = pg;
						  this.param = paramVal;
						  this.meth = methodChoise;
					   },
					   request:function()
					   {
							new Ajax.Request(this.page, {
							parameters: this.param,
							method: this.meth,
							onLoading:function(){
								//$('commentInput').hide();
								$('commentInput').update('<img id="imgLoading" src="http://www.whofindwho.com/post/theme/images/loading.gif" alt="loading" />');
								$('commentInput').innerHTML;	
							},
							onSuccess: function(transport)
							{
								var response = transport.responseText || "no response text";
								//successFunc(response);
								//alert('done');
								//$(msg).innerHTML('Done');
								//$('commentInput').update('Done');
								// -> HTMLElement
								//$('commentInput').innerHTML;
								// -> '<p>Kiwi, banana <em>and</em> apple.</p>'
								window.location.reload();
							},
							onFailure: function()
							{ 
								failFunc(); 
							}
							});
					   },
					   updater:function(con)
					   {
							new Ajax.Updater(con,this.page, {
							parameters: this.param,
							method: this.meth,
							onSuccess: function(transport)
							{
								var response = transport.responseText || "no response text";
								successFunc(response);
							},
							onFailure: function()
							{ 
								failFunc(); 
							}
							});
					   },
					   loadPeriodicalUpdater: function(con, frequen, dec)
					   {	
							this.pUdater = new Ajax.PeriodicalUpdater(con,this.page, {
							parameters: this.param,
							method: this.meth,
							frequency: frequen,
							decay: dec,
							onSuccess: function(transport)
							{
								var response = transport.responseText || "no response text";
								successFunc(response);
							},
							onFailure: function()
							{ 
								failFunc(); 
							}
							});
					   },
					   stopPeriodicalUpdater:function()
					   {
						   this.pUdater.stop();
					   }
					   }); 