function confirmDelete(locale){
	var msg = {fi_FI: "Haluatko varmasti poistaa kommentin?", en_GB: "Are you sure you want to delete the comment?"};
	if(typeof(msg[locale]) != 'undefined'){
		return confirm(msg[locale]);
	}
	else{
		return confirm("Confirm deletion?");
	}
}


var Comments = {
	hideTimer: null,
	createAlert: function(text, onComplete){
		var fragment = document.createDocumentFragment();
		
		var wrapper = document.createElement("div");
		$(wrapper).attr("id", "commentAlert_wrapper");
		
		var content = document.createElement("div");
		$(content).attr("id", "commentAlert_content");
		
		var textNode = document.createTextNode(text);
		
		content.appendChild(textNode);
		wrapper.appendChild(content);
		fragment.appendChild(wrapper);
		
		document.getElementsByTagName("body")[0].appendChild(fragment.cloneNode(true));
		
		onComplete(wrapper);
	},
	
	showAlert: function(alertWrapper){
		$("#commentAlert_wrapper").fadeIn("fast");
		$("#commentAlert_wrapper").click(function(event){$("#commentAlert_wrapper").fadeOut("fast");event.stopPropagation();});
		Comments.hideTimer = setTimeout(function(){$("#commentAlert_wrapper").fadeOut("fast");}, 15000);
	}
};
