
	if ( !qFlux )
		var qFlux = {};
	qFlux.contact = {};
	
	//####################################################################################################

	qFlux.contact.sendMessage = function()
		{
			var motivation = document.getElementById('contact_motivation').selectedIndex;
			if ( motivation == 0 )
				{
					qFlux.contact.showStatus('motivation');
					return;
				}
			var parameter = 'motivation=' + document.getElementById('contact_motivation').options[motivation].text;
			if ( document.getElementById('contact_mail') )
				{
					var mail = document.getElementById('contact_mail').value;
					if ( mail )
						{
							if ( !qFlux.validateMail(mail) )
								{
									qFlux.contact.showStatus('mail');
									return;
								}
							parameter = parameter + '&mail=' + mail;
						}
				}
			var text = document.getElementById('contact_edit').value;
			if ( !text || text.replace(/\n| /g,"").length < 2 || text.length > 5000 )
				{
					qFlux.contact.showStatus('message');
					return;
				}
			parameter = parameter + '&text=' + text;
			qFlux.xmlHttpRequest('contact.php', parameter, 'qFlux.contact.receiveMessage');
		}

	//####################################################################################################

	qFlux.contact.receiveMessage = function()
		{ 
			if ( xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete' )
				{
					qFlux.contact.showStatus(xmlHttp.responseText);
					qFlux.xmlHttpSend();
				}
		}
	
	//####################################################################################################
	
	qFlux.contact.showStatus = function(status) 
		{
			document.getElementById('contact_status').style.color = 'rgb(230,0,0)';
			var text;
			if ( status == 'success' )
				{
					document.getElementById('contact_motivation').selectedIndex = 0;
					if ( document.getElementById('contact_mail') )
						{ document.getElementById('contact_mail').value = ''; }
					document.getElementById('contact_edit').value = '';
					document.getElementById('contact_status').style.color = 'rgb(0,170,0)';
					text = 'Your message was successfully sent!';
				}
			else if ( status == 'motivation' )
				{ text = 'Please select your motivation in order to send a message!'; }
			else if ( status == 'mail' )
				{ text = 'Your entered mail address is not valid! Are you sure you didn\'t mistype something?'; }
			else if ( status == 'message' )
				{ text = 'Your entered message is not valid as it has to be 2 - 5000 characters long!'; }
			else if ( status == 'server' )
				{ text = 'There seems to be a mail-server problem - please try again later'; }
			else
				{ text = 'Uhmm ... something went terribly wrong ...'; }
			document.getElementById('contact_status').innerHTML = text;
			document.getElementById('contact_status').style.display = 'block';
			window.setTimeout("document.getElementById('contact_status').style.display = 'none'", 10000);
		}

