function viewCTP(name, language)
{
	var post = "name=" + name + '&language=' + language;
	$.ajax({
		type: "post",
		url: "/tipbox/view/", 
		data: post,
		success: function(response) 
		{
			document.getElementById("view").innerHTML = response;
			Recaptcha.create("6LfAG8ISAAAAAJH2lfzu0giHPcpumjY8iKUj5c4c",  "captcha", {theme: "white", lang: 'nl' });
			addSaveButton();
		},
		error:function (XMLHttpRequest, textStatus, errorThrown) 
		{
			alert(textStatus);
		}
	});
	
	return false;
}

function viewCtpReplyform(name, id)
{
	var post = "name=" + name + '&id=' + id;
	$.ajax({
		type: "post",
		url: "/functions/viewReplyForm/", 
		data: post,
		success: function(response) 
		{
			document.getElementById("replyform").innerHTML = response;
			Recaptcha.create("6LfAG8ISAAAAAJH2lfzu0giHPcpumjY8iKUj5c4c",  "captcha", {theme: "clean", lang: 'nl' });
			addSaveButton();
		},
		error:function (XMLHttpRequest, textStatus, errorThrown) 
		{
			alert(textStatus);
		}
	});
	
	return false;
}

function emptyFields(form_name)
{
	switch(form_name)
	{
		case 'blog':
			$("#WebBlogAuthor").val('');
			$("#WebBlogEmail").val('');
			$("#WebBlogTitle").val('');
			$("#WebBlogDescription").val('');
			$("#WebBlogVideo").val('');
			$("#WebBlogImage").val('');
			break;
		case 'tip':
			$("#TipboxName").val('');
			$("#TipboxEmailaddress").val('');
			$("#TipboxTitle").val('');
			$("#TipboxDescription").val('');
			$("#TipboxVideo").val('');
			$("#TipboxLink").val('');
			break;
		case 'newsletter':
			$("#NewsletterSubscriptionEmailaddress").val('');
			break;
		case 'activity':
			$("#WebActivityAuthor").val('');
			$("#WebActivityEmail").val('');
			$("#WebActivityTitle").val('');
			$("#WebActivityDescription").val('');
			break;
		case 'image':
			$("#WebImageRequestEmailaddress").val('');
			$("#WebImageRequestName").val('');
			$("#WebImageRequestImage").val('');
			break;
	}
}
