var profilemsg = {
					test: null ,
					msgid: null,
					ajaxURL: 'ajax/ajaxchat.php',

					leavemsg: function(id) 
						{
							$('showmessage').innerHTML ='';
							this.msgid = id;
							if ($('message').style.display=="none") $('message').style.display = 'block';
								else $('message').style.display = 'none';
							$('comment').style.display = 'none';
							$('commentslist').style.display = 'none';
							
						}, 

					send: function() 
						{
							msg='';
							if ( $('msgtext').value.length < 2 ) msg = "Schrijf een msg! \r\n";
							if (msg.length > 0 ) alert(msg); 
								else this.sendajax();
						},

					sendajax: function() 
						{
							temp = Base64.encode($('msgtext').value);
							new Ajax.Request(this.ajaxURL, {
															  	parameters:'sendmsg=1&msg='+escape(temp)+'&id='+this.msgid,
															  	onSuccess: function(transport) 
																	{ ;
																		profilemsg.saythanks();
																		temp =  transport.getResponseHeader('Doreload') ;	
																		if (temp)
																		location.reload(true);
																	},
																onFailure: function()
																	{ 
																		alert("Error : Could not  conntect to server."); return false; 
																	}
															});
						},

					saythanks: function() 
						{
							$('showmessage').innerHTML ='Thanks!';
							$('message').style.display = 'none';
						}
					}










