/*
	forum.js
	gameskimo.com 2006-2007
*/

function emoticonWindow() {
	var w = window.open('', 'emoticons','height=300,width=200,resizable=no,status=no,toolbar=no,menubar=no,directories=no,scrollbars=yes,modal=yes');
	w.document.open();
	w.document.write('<title>Emoticons</title><link rel="stylesheet" href="style.css" /><table style="margin-left: 5px;">');
	for (var i = 0; i < emoticonList.length; ++i) {
		var emoticon = emoticonList[i];
		var insertLink = 'opener.forum_editor.edit_box.value+=\'[' + emoticon + ']\';window.close()';
		w.document.write('<tr><td><img src="images/emoticons/' + emoticon + '.gif" onclick="' + insertLink + '" style="cursor: pointer;"/></td><td><span onclick="' + insertLink + '" style="cursor: pointer;">' + emoticon + '</span></td></tr>');
	}
	w.document.write('</table>');
	w.document.close();
}

function imageWindow() {
	var x = prompt('Please enter the URL to your image below:','http://example.com/image.jpg');
	if(x !== undefined) forum_editor.edit_box.value += '[img]' + x + '[/img]';
}

function linkWindow() {
	var x = prompt('Please enter the URL below:','http://example.com/index.htm');
	if (x !== undefined) { 
		var y = prompt('Enter a caption for your link below:', x);
		if (y !== undefined) {
			if (x == y) {
				forum_editor.edit_box.value += '[url]' + x + '[/url]';
			} else {
				forum_editor.edit_box.value += '[url=' + x + ']' + y + '[/url]';
			}
		}
	}
}