function isUrl(s) {
	var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
	return regexp.test(s);}

function voegNieuwsToe() {if (gwUID>0){$.ajax({type: "GET",url: "/xml_gets/4_addNieuws.asp?o=1",success: function(response) {$("#voegToeMain").hide();$("#voegToeMain").html(response);$("#voegToeContainer").fadeOut(500, function() { $("#voegToeMain").fadeIn(500, function() { $("#NNTitel").focus(); }); });}});return false;} else {alert("U moet ingelogd zijn om nieuws te kunnen plaatsen.");}};

function cNieuws() {$("#voegToeMain").fadeOut(500, function() { $("#voegToeContainer").fadeIn(500, function() { $("#NieuwsPrv").fadeOut(500, function() { $("#NieuwsItem").fadeIn(500, function() { }); }); }); });}

function cPreview() {var titel = $("#NNTitel").val();var url = $("#NNUrl").val();var tik = $("#nnTikveld").val();if (titel!=""&&url!=""&&tik!="") {if (isUrl(url)) {var form = $("#frmNieuws");$.ajax({type: "POST", data: form.serialize(),url: "/xml_gets/4_addNieuws.asp?p=1", success: function(response) {$("#NieuwsPrv").hide();$("#NieuwsPrv").html(response);$("#NieuwsItem").fadeOut(500, function() { $("#NieuwsPrv").fadeIn(500, function() { }); });}});} else {alert("Ongeldige url.");}} else {alert("Zowel Titel, url als samenvatting zijn nodig.");}}

function cSend() {var titel = $("#NNTitel").val();var url = $("#NNUrl").val();var edID = $("#edID").val();var tik = $("#nnTikveld").val();if (titel!=""&&url!=""&&tik!="") {if (isUrl(url)) {$("#bNieuws").html("Even geduld...");var form = $("#frmNieuws");$.ajax({type: "POST",data: form.serialize(),url: "/xml_gets/4_addNieuws.asp?a=1",success: function(response) {$("#NieuwsPrv").hide();$("#NieuwsPrv").html(response);$("#NieuwsPrv").show();$("#NieuwsItem").fadeOut(500, function() {});var r = $("#nResult").val();document.location = "/nieuws.asp?i=" + r;}});} else {alert("Ongeldige url.");}} else {alert("Zowel Titel, url als samenvatting zijn nodig.");}}function oEditN(n) {$.ajax({type: "GET",url: "/xml_gets/4_addNieuws.asp?o=1&nl="+escape(n),success: function(response) {$("#voegToeMain").hide();$("#voegToeMain").html(response);$("#voegToeContainer").fadeOut(500, function() { $("#voegToeMain").fadeIn(500, function() { $("#NNTitel").focus(); }); });}});return false;}
