
mySettings = {
	previewParserPath:	'', // path to your BBCode parser
	markupSet: [
		{name:'Bold', key:'B', openWith:'[b]', closeWith:'[/b]'},
		{name:'Italic', key:'I', openWith:'[i]', closeWith:'[/i]'},
		{name:'Underline', key:'U', openWith:'[u]', closeWith:'[/u]'},
		{separator:'---------------' },
		{name:'Link', key:'L', openWith:'[url=[![Url]!]]', closeWith:'[/url]', placeHolder:'Your text to link here...'},
		{name:'Quotes', openWith:'[q]', closeWith:'[/q]'},
		{separator:'---------------' },
		{name:'Clean', className:"clean", replaceWith:function(markitup) { return markitup.selection.replace(/\[(.*?)\]/g, "") } },
		{name: 'Smile', className: "mSmilies", replaceWith: function(markitup) { showSmilies(markitup) } }
	]
}


function showSmilies(markitup) {
	var perRow = smileBox.perRow;
	if($('#smilies').length != 1) {
		var smileHtml = '<table class="cells" cellpadding="0" style="width:160px">';
		var code;
		for(var i = 0; i < smileSet.length; i++) {
			if(i % perRow == 0) {
				if(i != 0) smileHtml += '</tr>';
				smileHtml += '<tr>';
			}
			code = smileSet[i].code;
			code = code.replace(/</g, '&lt;');
			code = code.replace(/>/g, '&gt;');
			code = code.replace('/"/g', '&quot;');
			smileHtml += '<td><a href="#" name="'+code+'" title="'+smileSet[i].lang+'"><img src="/static/js/markitup/smile/'+smileSet[i].file+'" alt="'+code+'" /></a></td>';
		}
		if(i % perRow > 0) {
			for(var j = i % perRow; j < perRow; j++) {
				smileHtml += '<td>&nbsp;</td>';
			}
		}
		smileHtml += '</tr></table>';
		$('body').append('<div id="smilies">' + smileHtml + '</div>');
		$('#smilies').dialog({
			title: 'smiles',
			height: smileBox.height,
			width: smileBox.width
		});
		$('#smilies a').click(function() {
			emoticon = $(this).attr("name");
			$.markItUp( { replaceWith: ' ' + emoticon + ' ' } );
			return false;
		});
	}
	$('#smilies').dialog('open');
}