﻿        function ConfirmDelete(msg, action, forum, group) {
			if(confirm(msg)) {
				location.href = 'MBHome.aspx?do=' + action + '&forum=' + URLEncode(forum) + '&group=' + URLEncode(group);
			}
		}

	    
	    function ConfirmDeleteForum(msg, action, forum, group) {
			if(confirm(msg)) {
				location.href = 'Forum.aspx?do=' + action + '&forum=' + URLEncode(forum) + '&group=' + URLEncode(group);
			}
		}

	    
	    function ConfirmPostDelete(msg, action, forum, group, post, fname, gname, p) {
			if(confirm(msg)) {
				location.href = 'Forum.aspx?do=' + action + '&forum=' + URLEncode(forum) + '&group=' + URLEncode(group) + '&post=' + URLEncode(post) + '&fname=' + URLEncode(fname) + '&gname=' + URLEncode(gname) + '&p=' + URLEncode(p);
			}
		}

	    
	    function ConfirmPostDeleteTopic(msg, action, forum, group, fname, gname, topic, title, delid) {
			if(confirm(msg)) {
				location.href = 'Topic.aspx?do=' + action + '&forum=' + URLEncode(forum) + '&group=' + URLEncode(group) + '&topic=' + URLEncode(topic) + '&fname=' + URLEncode(fname) + '&gname=' + URLEncode(gname) + '&title=' + URLEncode(title) + '&delid=' + URLEncode(delid);
			}
		}

	    
	    function URLEncode(url) {
			var SAFECHARS = "0123456789" +					// Numeric
							"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetic
							"abcdefghijklmnopqrstuvwxyz" +
							"-_.!~*'()";			// RFC2396 Mark characters
			var HEX = "0123456789ABCDEF";

			var plaintext = url;
			var encoded = "";
			for (var i = 0; i < plaintext.length; i++ ) {
				var ch = plaintext.charAt(i);
			    if (ch == " ") {
				    encoded += "+";				// x-www-urlencoded, rather than %20
				} else if (SAFECHARS.indexOf(ch) != -1) {
				    encoded += ch;
				} else {
				    var charCode = ch.charCodeAt(0);
					if (charCode > 255) {
					    alert( "Unicode Character '" 
		                        + ch 
                		        + "' cannot be encoded using standard URL encoding.\n" +
						          "(URL encoding only supports 8-bit characters.)\n" +
								  "A space (+) will be substituted." );
						encoded += "+";
					} else {
						encoded += "%";
						encoded += HEX.charAt((charCode >> 4) & 0xF);
						encoded += HEX.charAt(charCode & 0xF);
					}
				}
			} // for
            return encoded;
		};
			
			
			function AddData(data) {
			var topicForm = document.forms['aspnetForm'];
            if (!topicForm) {
            topicForm = document.aspnetForm;
            }
            topicForm.ctl00_ContentPlaceHolder1_textMessage.value = topicForm.ctl00_ContentPlaceHolder1_textMessage.value + data;
            }
	