﻿	function encode_utf8( s )
	{
		return s ;
	}
	
	function hyvaksyID(id) {
		var r=confirm(encode_utf8("Haluatko varmasti hyväksyä osoitteen postituslistalle?"));
		if (r==true){
			$.ajax({
				type: "GET",
				url: "/omat_ohjelmat/baunssiposti/?sivu=hallinta&act=hyvaksy&id=" + id,
				success: poistaListaltaHyvaksy(id)
			});
		}
		else{
		}
	}
	
	function poistaListaltaHyvaksy(id) {
	document.getElementById(id + "A").innerHTML=encode_utf8("<strong>Sähköpostiosoite on hyväksytty!</strong></td>");
	document.getElementById(id + "B").innerHTML="";
	document.getElementById(id + "C").innerHTML="";
	document.getElementById(id + "D").innerHTML="";
	}
	
	function hylkaaID(id) {
		var r=confirm(encode_utf8("Haluatko varmasti hylätä osoitteen postituslistalta?"));
		if (r==true){
			$.ajax({
				type: "GET",
				url: "/omat_ohjelmat/baunssiposti/?sivu=hallinta&act=hylkaa&id=" + id,
				success: poistaListaltaHylkaa(id)
			});
		}
		else{
		}
	}
	
	function poistaListaltaHylkaa(id) {
	document.getElementById(id + "A").innerHTML=encode_utf8("<strong>Sähköpostiosoite on hylätty!</strong></td>");
	document.getElementById(id + "B").innerHTML="";
	document.getElementById(id + "C").innerHTML="";
	document.getElementById(id + "D").innerHTML="";
	}
	
	function convertText(type, content) {
switch (type) {
// Gets executed before the built in logic performes it's cleanups
case "before":
var re= /<\S[^><]*>/gi;
content = content.replace ("<span>&nbsp;</span>", "\n");
content = content.replace ("<span>", "<p>");
content = content.replace ("</span>", "</p>");
break;

// Gets executed after the built in logic performes it's cleanups
case "after":
break;
}
return content;
}