function GenerateNames() {
	
	new Ajax.Request('http://www.bebisnamn.se/bebisnamn.se/bn-content/randomize.php',
	{
		method:'post',
		parameters: {girlnames: $('girlname').value, boynames: $('boyname').value},
		onSuccess: function(randomize){
		var response = randomize.responseText || "no response text";
		$('randomizediv').innerHTML=response;
		},
		onFailure: function(){ alert('Something went wrong...') }
	});

}

function Contact() {
	
	new Ajax.Request('http://www.bebisnamn.se/bebisnamn.se/bn-content/contactform.php',
	{
		method:'post',
		parameters: {subject: $('subject').value, message: $('message').value, name: $('name').value, mail: $('mail').value},
		onSuccess: function(contact){
		var response = contact.responseText || "";
		$('contactdiv').innerHTML=response;
		},
		onFailure: function(){ alert('Ett fel uppstod, testa igen..') }
	});

}

function GenerateNamesOfNames() {
	
	new Ajax.Request('http://www.bebisnamn.se/bebisnamn.se/bn-content/generatename.php',
	{
		method:'post',
		parameters: {names: $('names').value, gender: $('gender').value, nbchars: $('nbchars').value},
		onSuccess: function(generate){
		var response = generate.responseText || "";
		$('generatediv').innerHTML=response;
		},
		onFailure: function(){ alert('Something went wrong...') }
	});

}
