﻿ParserMan = function() {
var colors = [{ n: 'LightPink', c: '0xFFB6C1' }, { n: 'Pink', c: '0xFFC0CB' }, { n: 'Crimson', c: '0xDC143C' }, { n: 'LavenderBlush', c: '0xFFF0F5' }, { n: 'PaleVioletRed', c: '0xDB7093' }, { n: 'HotPink', c: '0xFF69B4' }, { n: 'DeepPink', c: '0xFF1493' }, { n: 'MediumVioletRed', c: '0xC71585' }, { n: 'Orchid', c: '0xDA70D6' }, { n: 'Thistle', c: '0xD8BFD8' }, { n: 'Plum', c: '0xDDA0DD' }, { n: 'Violet', c: '0xEE82EE' }, { n: 'Magenta', c: '0xFF00FF' }, { n: 'Fuchsia', c: '0xFF00FF' }, { n: 'DarkMagenta', c: '0x8B008B' }, { n: 'Purple', c: '0x800080' }, { n: 'MediumOrchid', c: '0xBA55D3' }, { n: 'DarkViolet', c: '0x9400D3' }, { n: 'DarkOrchid', c: '0x9932CC' }, { n: 'Indigo', c: '0x4B0082' }, { n: 'BlueViolet', c: '0x8A2BE2' }, { n: 'MediumPurple', c: '0x9370DB' }, { n: 'MediumSlateBlue', c: '0x7B68EE' }, { n: 'SlateBlue', c: '0x6A5ACD' }, { n: 'DarkSlateBlue', c: '0x483D8B' }, { n: 'Lavender', c: '0xE6E6FA' }, { n: 'GhostWhite', c: '0xF8F8FF' }, { n: 'Blue', c: '0x0000FF' }, { n: 'MediumBlue', c: '0x0000CD' }, { n: 'MidnightBlue', c: '0x191970' }, { n: 'DarkBlue', c: '0x00008B' }, { n: 'Navy', c: '0x000080' }, { n: 'RoyalBlue', c: '0x4169E1' }, { n: 'CornflowerBlue', c: '0x6495ED' }, { n: 'LightSteelBlue', c: '0xB0C4DE' }, { n: 'LightSlateGray', c: '0x778899' }, { n: 'SlateGray', c: '0x708090' }, { n: 'DodgerBlue', c: '0x1E90FF' }, { n: 'AliceBlue', c: '0xF0F8FF' }, { n: 'SteelBlue', c: '0x4682B4' }, { n: 'LightSkyBlue', c: '0x87CEFA' }, { n: 'SkyBlue', c: '0x87CEEB' }, { n: 'DeepSkyBlue', c: '0x00BFFF' }, { n: 'LightBlue', c: '0xADD8E6' }, { n: 'PowderBlue', c: '0xB0E0E6' }, { n: 'CadetBlue', c: '0x5F9EA0' }, { n: 'Azure', c: '0xF0FFFF' }, { n: 'LightCyan', c: '0xE0FFFF' }, { n: 'PaleTurquoise', c: '0xAFEEEE' }, { n: 'Cyan', c: '0x00FFFF' }, { n: 'Aqua', c: '0x00FFFF' }, { n: 'DarkTurquoise', c: '0x00CED1' }, { n: 'DarkSlateGray', c: '0x2F4F4F' }, { n: 'DarkCyan', c: '0x008B8B' }, { n: 'Teal', c: '0x008080' }, { n: 'MediumTurquoise', c: '0x48D1CC' }, { n: 'LightSeaGreen', c: '0x20B2AA' }, { n: 'Turquoise', c: '0x40E0D0' }, { n: 'Aquamarine', c: '0x7FFFD4' }, { n: 'MediumAquamarine', c: '0x66CDAA' }, { n: 'MediumSpringGreen', c: '0x00FA9A' }, { n: 'MintCream', c: '0xF5FFFA' }, { n: 'SpringGreen', c: '0x00FF7F' }, { n: 'MediumSeaGreen', c: '0x3CB371' }, { n: 'SeaGreen', c: '0x2E8B57' }, { n: 'Honeydew', c: '0xF0FFF0' }, { n: 'LightGreen', c: '0x90EE90' }, { n: 'PaleGreen', c: '0x98FB98' }, { n: 'DarkSeaGreen', c: '0x8FBC8F' }, { n: 'LimeGreen', c: '0x32CD32' }, { n: 'Lime', c: '0x00FF00' }, { n: 'ForestGreen', c: '0x228B22' }, { n: 'Green', c: '0x008000' }, { n: 'DarkGreen', c: '0x006400' }, { n: 'Chartreuse', c: '0x7FFF00' }, { n: 'LawnGreen', c: '0x7CFC00' }, { n: 'GreenYellow', c: '0xADFF2F' }, { n: 'DarkOliveGreen', c: '0x556B2F' }, { n: 'YellowGreen', c: '0x9ACD32' }, { n: 'OliveDrab', c: '0x6B8E23' }, { n: 'Beige', c: '0xF5F5DC' }, { n: 'LightGoldenrodYellow', c: '0xFAFAD2' }, { n: 'Ivory', c: '0xFFFFF0' }, { n: 'LightYellow', c: '0xFFFFE0' }, { n: 'Yellow', c: '0xFFFF00' }, { n: 'Olive', c: '0x808000' }, { n: 'DarkKhaki', c: '0xBDB76B' }, { n: 'LemonChiffon', c: '0xFFFACD' }, { n: 'PaleGoldenrod', c: '0xEEE8AA' }, { n: 'Khaki', c: '0xF0E68C' }, { n: 'Gold', c: '0xFFD700' }, { n: 'Cornsilk', c: '0xFFF8DC' }, { n: 'Goldenrod', c: '0xDAA520' }, { n: 'DarkGoldenrod', c: '0xB8860B' }, { n: 'FloralWhite', c: '0xFFFAF0' }, { n: 'OldLace', c: '0xFDF5E6' }, { n: 'Wheat', c: '0xF5DEB3' }, { n: 'Moccasin', c: '0xFFE4B5' }, { n: 'Orange', c: '0xFFA500' }, { n: 'PapayaWhip', c: '0xFFEFD5' }, { n: 'BlanchedAlmond', c: '0xFFEBCD' }, { n: 'NavajoWhite', c: '0xFFDEAD' }, { n: 'AntiqueWhite', c: '0xFAEBD7' }, { n: 'Tan', c: '0xD2B48C' }, { n: 'BurlyWood', c: '0xDEB887' }, { n: 'Bisque', c: '0xFFE4C4' }, { n: 'DarkOrange', c: '0xFF8C00' }, { n: 'Linen', c: '0xFAF0E6' }, { n: 'Peru', c: '0xCD853F' }, { n: 'PeachPuff', c: '0xFFDAB9' }, { n: 'SandyBrown', c: '0xF4A460' }, { n: 'Chocolate', c: '0xD2691E' }, { n: 'SaddleBrown', c: '0x8B4513' }, { n: 'Seashell', c: '0xFFF5EE' }, { n: 'Sienna', c: '0xA0522D' }, { n: 'LightSalmon', c: '0xFFA07A' }, { n: 'Coral', c: '0xFF7F50' }, { n: 'OrangeRed', c: '0xFF4500' }, { n: 'DarkSalmon', c: '0xE9967A' }, { n: 'Tomato', c: '0xFF6347' }, { n: 'MistyRose', c: '0xFFE4E1' }, { n: 'Salmon', c: '0xFA8072' }, { n: 'Snow', c: '0xFFFAFA' }, { n: 'LightCoral', c: '0xF08080' }, { n: 'RosyBrown', c: '0xBC8F8F' }, { n: 'IndianRed', c: '0xCD5C5C' }, { n: 'Red', c: '0xFF0000' }, { n: 'Brown', c: '0xA52A2A' }, { n: 'FireBrick', c: '0xB22222' }, { n: 'DarkRed', c: '0x8B0000' }, { n: 'Maroon', c: '0x800000' }, { n: 'White', c: '0xFFFFFF' }, { n: 'WhiteSmoke', c: '0xF5F5F5' }, { n: 'Gainsboro', c: '0xDCDCDC' }, { n: 'LightGrey', c: '0xD3D3D3' }, { n: 'Silver', c: '0xC0C0C0' }, { n: 'DarkGray', c: '0xA9A9A9' }, { n: 'Gray', c: '0x808080' }, { n: 'DimGray', c: '0x696969' }, { n: 'Black', c: '0x000000'}];var smileys =
[
{ t: 'Smile', u: ':(-)?\\)', c: ':)', d: 0 },
{ t: 'LOL', u: ':(-)?d', c: ':d', d: 0 },
{t: 'Tongue', u: ':(-)?p', c: ':p', d: 0 },
{ t: 'Wink', u: ';(-)?\\)', c: ';)', d: 0 },
{ t: 'Sad', u: ':(-)?\\(', c: ':(', d: 0 },
{ t: 'Confused', u: ':(-)?s', c: ':s', d: 0 },
{ t: 'What', u: ':(-)?\\|', c: ':|', d: 0 },
{ t: 'Cry', u: ":'\\(", c: ":\'(", d: 0 },
{ t: 'Blush', u: ':(-)?\\$', c: ':$', d: 0 },
{ t: 'Hot', u: '\\(h\\)', c: '(h)', d: 0 },
{ t: 'Angry', u: ':(-)?@', c: ':@', d: 0 },
{ t: 'Devil', u: '\\(6\\)', c: '(6)', d: 0 },
{ t: 'Zip', u: ':(-)?#', c: ':#', d: 0 },
{ t: 'Gossip', u: ':(-)?\\*', c: ':*', d: 0 },
{ t: 'Teeth', u: '8o\\|', c: '8o|', d: 0 },
{ t: 'Nerd', u: '8(-)?\\|', c: '8|', d: 0 },
{ t: 'Sarcastic', u: '\\^(o)?\\)', c: '^)', d: 0 },
{t: 'Clueless', u: ':\\^\\)', c: ':^)', d: 0 },
{ t: 'Thinking', u: '\\*(-)?\\)', c: '*)', d: 0 },
{ t: 'Cool', u: '8(-)?\\)', c: '8)', d: 0 },
{ t: 'Sleepy', u: '\\|(-)?\\)', c: '|)', d: 0 },
{ t: 'Kiss', u: '\\(k\\)', c: '(k)', d: 0 },
{ t: 'Yes', u: '\\(yes\\)', c: '(yes)', d: 0 },
{ t: 'No', u: '\\(no\\)', c: '(no)', d: 0 },
{ t: 'Up', u: '\\(y\\)', c: '(y)', d: 0 },
{ t: 'Down', u: '\\(n\\)', c: '(n)', d: 0 },
{t: 'Afro', u: '\\(af\\)', c: '(af)', d: 1 },
{ t: 'Party', u: ':o\\)', c: ':o)', d: 1 },
{ t: 'Eye-roll', u: '8-\\)', c: '8-)', d: 1 },
{ t: 'Sneaky', u: '\\(sn\\)', c: '(sn)', d: 1 },
{ t: 'Devilish', u: '\\(dv\\)', c: '(dv)', d: 1 },
{ t: 'Wall', u: '\\|:\\(', c: '|:(', d: 1 },
{ t: 'Shooting', u: '\\(gn\\)', c: '(gn)', d: 1 },
{ t: 'Knife', u: '\\(kn\\)', c: '(kn)', d: 1 },
{ t: 'Police', u: '\\(pe\\)', c: '(pe)', d: 1 },
{ t: 'Sunny', u: '\\(su\\)', c: '(su)', d: 1 },
{ t: 'Stars', u: '\\(\\*\\)', c: '(*)', d: 1 },
{ t: 'Sweating', u: '\\(sw\\)', c: '(sw)', d: 1 },
{ t: 'Lightbulb', u: '\\(i\\)', c: '(i)', d: 1 },
{ t: 'Smash', u: '\\(sm\\)', c: '(sm)', d: 1 },
{ t: 'Sick', u: '\\(si\\)', c: '(si)', d: 1 },
{ t: 'Argue', u: '\\(ar\\)', c: '(ar)', d: 1 },
{ t: 'Bomb', u: '\\(bm\\)', c: '(bm)', d: 1 },
{ t: 'Greedy', u: '\\(gr\\)', c: '(gr)', d: 1 },
{ t: 'Mask', u: '\\(mk\\)', c: '(mk)', d: 1 },
{ t: 'Gorgeous', u: '\\(go\\)', c: '(go)', d: 1 },
{ t: 'Boy', u: '\\(z\\)', c: '(z)', d: 1 },
{ t: 'Girl', u: '\\(x\\)', c: '(x)', d: 1 },
{ t: 'Heart', u: '\\(\\l\\)', c: '(l)', d: 1 },
{ t: 'I-Love-You', u: '\\(ilu\\)', c: '(ilu)', d: 1 },
{ t: 'Sweetheart', u: '\\(sh\\)', c: '(sh)', d: 1 },
{ t: 'InLove', u: '\\(il\\)', c: '(il)', d: 1 },
{ t: 'Love', u: '\\(lv\\)', c: '(lv)', d: 1 },
{ t: 'Whip', u: '\\(wi\\)', c: '(wi)', d: 1 },
{ t: 'Toilet', u: '\\(tl\\)', c: '(tl)', d: 1 },
{ t: 'Speechless', u: '\\(sc\\)', c: '(sc)', d: 1 },
{ t: 'Pimp', u: '\\(pm\\)', c: '(pm)', d: 1 },
{ t: 'Bandana', u: '\\(bd\\)', c: '(bd)', d: 1 },
{ t: 'Mr-T', u: '\\(mt\\)', c: '(mt)', d: 1 },
{ t: 'XMas', u: '\\(xm\\)', c: '(xm)', d: 1 },
{ t: 'Sombrero', u: '\\(so\\)', c: '(so)', d: 1 },
{ t: 'Sultan', u: '\\(sl\\)', c: '(sl)', d: 1 },
{ t: 'Chinese', u: '\\(ch\\)', c: '(ch)', d: 1 },
{ t: 'Cowboy', u: '\\(cb\\)', c: '(cb)', d: 1 },
{ t: 'Army', u: '\\(am\\)', c: '(am)', d: 1 },
{ t: 'Clown', u: ':(-)?\\+', c: ':+', d: 1 },
{ t: 'Batman', u: ':(-)?\\[', c: ':[', d: 1 },
{ t: 'Vampire', u: '\\(vp\\)', c: '(vp)', d: 1 },
{ t: 'Alien', u: '\\(al\\)', c: '(al)', d: 1 },
{ t: 'Skull', u: '\\(sk\\)', c: '(sk)', d: 1 },
{ t: 'Smoking', u: '\\(sg\\)', c: '(sg)', d: 1 },
{ t: 'Student', u: '\\(se\\)', c: '(se)', d: 1 },
{ t: 'Chef', u: '\\(ck\\)', c: '(ck)', d: 1 },
{ t: 'Karate', u: '\\(kt\\)', c: '(kt)', d: 1 },
{ t: 'Kid', u: '\\(kd\\)', c: '(kd)', d: 1 },
{ t: 'Baby', u: '\\(by\\)', c: '(by)', d: 1 },
{ t: 'Deluxe', u: '\\(dlx\\)', c: '(dlx)', d: 1 },
{ t: 'Juggle', u: '\\(jg\\)', c: '(jg)', d: 1 },
{ t: 'Reading', u: '\\(rd\\)', c: '(rd)', d: 1 },
{ t: 'Singer', u: '\\(sr\\)', c: '(sr)', d: 1 },
{ t: 'Guitarist', u: '\\(gt\\)', c: '(gt)', d: 1 },
{ t: 'Drummer', u: '\\(dr\\)', c: '(dr)', d: 1 },
{ t: 'Angel', u: '\\(a\\)', c: '(a)', d: 1 },
{ t: 'Wings', u: '\\(wg\\)', c: '(wg)', d: 1 },
{ t: 'Idea', u: '\\(id\\)', c: '(id)', d: 1 },
{ t: 'Daisy', u: '\\(ds\\)', c: '(ds)', d: 1 },
{ t: 'Deal', u: '\\(dl\\)', c: '(dl)', d: 1 },
{ t: 'Computer', u: '\\(co\\)', c: '(co)', d: 1 },
{ t: 'PP2GRocks', u: '\\(pr\\)', c: '(pr)', d: 1 },
{ t: 'DusDat', u: '\\(dd\\)', c: '(dd)', d: 1 },
{ t: 'NietHaten', u: '\\(nh\\)', c: '(nh)', d: 1 },
{ t: 'Stop', u: '\\(sp\\)', c: '(sp)', d: 1 },
{ t: 'Oops', u: '\\(op\\)', c: '(op)', d: 1 },
{ t: 'Help', u: '\\(\\?\\)', c: '(?)', d: 1 },
{ t: 'Stupid', u: '\\(sd\\)', c: '(sd)', d: 1 },
{ t: 'Hanged', u: '\\(hg\\)', c: '(hg)', d: 1 },
{ t: 'Behead', u: '\\(bh\\)', c: '(bh)', d: 1 }
];var cmds =
[
{ c: 'cut', t: 'Cut' }, { c: 'copy', t: 'Copy' }, { c: 'paste', t: 'Paste' }, 
{c: 'b', t: 'Bold' }, { c: 'i', t: 'Italic' }, { c: 'u', t: 'Underline' }, { c: 's', t: 'Strikethrough' }, { c: 'sup', t: 'Superscript' }, { c: 'sub', t: 'Subscript' }, 
{c: 'left', t: 'Justify left' }, { c: 'center', t: 'Justify center' }, { c: 'right', t: 'Justify right' }, { c: 'justify', t: 'Justify full' }, 
{c: 'list', t: 'Bulleted list' }, { c: 'list=1', t: 'Numbered list' }, 
{c: 'url', t: 'Insert link' }, { c: 'img', t: 'Insert image' }, 
{c: 'table', t: 'Insert table' }, { c: 'row', t: 'Insert tablerow' }, { c: 'col', t: 'Insert tablecolumn' }
];var fonts =
[
{ c: 'font=arial', t: 'Arial', s: 'arial' },
{ c: 'font=courier', t: 'Courier', s: 'courier' },
{ c: 'font=andale', t: 'Andale', s: 'andale mono' },
{ c: 'font=verdana', t: 'Verdana', s: 'verdana' },
{ c: 'font=times', t: 'Times', s: 'times' },
{ c: 'font=comic', t: 'Comic', s: 'comic sans ms' },
{ c: 'font=franklin', t: 'Franklin', s: 'franklin gothic' },
{ c: 'font=georgia', t: 'Georgia', s: 'georgia' },
{ c: 'font=impact', t: 'Impact', s: 'impact' },
{ c: 'font=monotype', t: 'Monotype', s: 'monotype' },
{ c: 'font=tahoma', t: 'Tahoma', s: 'tahoma' },
{ c: 'font=palatino', t: 'Palatino', s: 'palatino' },
{ c: 'font=trebuchet', t: 'Trebuchet', s: 'trebuchet ms' },
{ c: 'font=lucida', t: 'Lucida', s: 'lucida console' },
{ c: 'font=consolas', t: 'Consolas', s: 'consolas' },
{ c: 'font=candara', t: 'Candara', s: 'candara' },
{ c: 'font=webdings', t: 'Webdings', s: 'webdings' },
{ c: 'font=script', t: 'Script', s: 'script' },
{ c: 'font=wingdings', t: 'Wingdings', s: 'wingdings' },
{ c: 'font=symbol', t: 'Symbol', s: 'symbol' }
];var headings =
[
{ c: 'h1', t: 'Heading 1', s: '60' },
{ c: 'h2', t: 'Heading 2', s: '50' },
{ c: 'h3', t: 'Heading 3', s: '40' },
{ c: 'h4', t: 'Heading 4', s: '30' },
{ c: 'h5', t: 'Heading 5', s: '20' },
{ c: 'h6', t: 'Heading 6', s: '10' }
];var specialCmds =
[
{ c: 'selectImageEditor', t: 'My Images' },
{ c: 'tagVideoEditor', t: 'PP2G.TV Videos' },
{ c: 'section', t: 'Background' },
{ c: 'code', t: 'Code' },
{ c: 'quote', t: 'Quote' },
{ c: 'user', t: 'PP2G User' },
{ c: 'party', t: 'Event' },
{ c: 'partypic', t: 'Picture of Event' }
];var deluxeCmds =
[
{ c: 'glitterEditor', t: 'Glitter Text' },
{ c: 'rotatorEditor', t: 'Image Rotator' },
{ c: 'wmvmovie', t: 'Movie' }
];this.get_colors = function() { return colors;}
this.get_smileys = function() { return smileys;}
this.get_cmds = function() { return cmds;}
this.get_fonts = function() { return fonts;}
this.get_headings = function() { return headings;}
this.get_specialCmds = function() { return specialCmds;}
this.get_deluxeCmds = function() { return deluxeCmds;}
this.DoUbb = function() {
if (document.ubbarray) {
for (var i = 0;i < document.ubbarray.length;i++) {
var item = document.ubbarray[i];var c = $get(item.i);if (c != null)
c.innerHTML = this.ParseUBB(item.u, item.h, item.d, item.os, item.f);}
}
};this.ParseUBB = function(html, allowHtml, allowDX, onlySmileys, allowFlash) {
return parse(html, allowHtml, allowDX, onlySmileys, allowFlash);};function parse(html, allowHtmlTags, allowDX, onlySmileys, allowFlash) {
if (onlySmileys) {
return replaceUBBSmileys(html, allowDX);}
if (!allowHtmlTags) {
html = replaceHTML(html);html = html.replace(/\r\n/g, '<br />');html = html.replace(/\r/g, '<br />');html = html.replace(/\n/g, '<br />');}
html = replaceUBBFormating(html);html = replaceUBBQuote(html);html = replaceUBBUser(html);html = replaceUBBColors(html);html = replaceUBBSmileys(html, allowDX);html = replaceUBBImage(html);html = replaceSection(html);html = replaceMarquee(html);if (allowDX) {
html = replaceWMV(html);html = replaceGlitter(html);html = replaceRotator(html);}
html = replaceMoodmeter(html);if (allowFlash)
html = replaceFlash(html);html = replaceYT(html);html = replacePP2GTVVideo(html);html = replaceUBBLink(html);return html;}
function replaceHTML(html) {
html = html.replace(/</g, '&lt;');html = html.replace(/>/g, '&gt;');return html;}
function replaceUBBSingleTag(html, ubbCode, tag) {
var reg = new RegExp('\\[(' + ubbCode + ')\\]', 'ig');html = html.replace(reg, '<' + tag + '>');delete reg;return html;}
function replaceUBB(html, ubbCode, tag) {
var reg = new RegExp('\\[(' + ubbCode + ')\\](.+?)(\\[\\/\\1\\])', 'ig');html = html.replace(reg, '<' + tag + '>$2</' + tag + '>');delete reg;return html;}
function replaceUBBTag(html, ubbCode, tag, attr, attrValue) {
var reg = new RegExp('\\[(' + ubbCode + ')\\](.+?)(\\[\\/\\1\\])', 'ig');html = html.replace(reg, '<' + tag + ' ' + attr + '="' + attrValue + '">$2</' + tag + '>');delete reg;return html;}
function replaceUBBStyle(html, ubbCode, style) {
var reg = new RegExp('\\[(' + ubbCode + ')\\](.+?)(\\[\\/\\1\\])', 'ig');html = html.replace(reg, '<span style="' + style + ': $1">$2</span>');delete reg;return html;}
function replaceUBBAlign(html, ubbCode, style) {
var reg = new RegExp('\\[(' + ubbCode + ')\\](.+?)(\\[\\/\\1\\])', 'ig');html = html.replace(reg, '<div style="' + style + ': $1">$2</div>');delete reg;return html;}
function replaceUBBFormating(html) {
html = replaceUBB(html, 'table', 'table');html = replaceUBB(html, 'row', 'tr');html = replaceUBB(html, 'col', 'td');html = replaceUBBTag(html, 'col=top', 'td', 'valign', 'top');html = replaceUBBTag(html, 'col=bottom', 'td', 'valign', 'bottom');html = replaceUBBTag(html, 'col=middle', 'td', 'valign', 'middle');html = replaceUBB(html, 'b', 'b');html = replaceUBB(html, 's', 's');html = replaceUBB(html, 'strike', 's');html = replaceUBB(html, 'u', 'u');html = replaceUBB(html, 'i', 'i');html = replaceUBB(html, 'code', 'pre');html = replaceUBB(html, 'sub', 'sub');html = replaceUBB(html, 'sup', 'sup');html = replaceUBBAlign(html, 'center', 'text-align');html = replaceUBBAlign(html, 'left', 'text-align');html = replaceUBBAlign(html, 'right', 'text-align');html = replaceUBBAlign(html, 'justify', 'text-align');html = replaceUBB(html, 'h1', 'h1');html = replaceUBB(html, 'h2', 'h2');html = replaceUBB(html, 'h3', 'h3');html = replaceUBB(html, 'h4', 'h4');html = replaceUBB(html, 'h5', 'h5');html = replaceUBB(html, 'h6', 'h6');html = replaceUBB(html, 'list', 'ul');html = replaceUBB(html, '\\*', 'li');html = replaceUBBSingleTag(html, '\\*', 'li');html = replaceUBBSingleTag(html, 'br', 'br');html = replaceUBBTag(html, 'list=1', 'ol', 'type', '1');html = replaceUBBTag(html, 'list=a', 'ol', 'type', 'a');html = replaceUBBTag(html, 'size=-3', 'span', 'style', 'font-size:7px;');html = replaceUBBTag(html, 'size=-2', 'span', 'style', 'font-size:8px;');html = replaceUBBTag(html, 'size=-1', 'span', 'style', 'font-size:9px;');html = replaceUBBTag(html, 'size=1', 'span', 'style', 'font-size:10px;');html = replaceUBBTag(html, 'size=1.1', 'span', 'style', 'font-size:11px;');html = replaceUBBTag(html, 'size=1.2', 'span', 'style', 'font-size:12px;');html = replaceUBBTag(html, 'size=1.3', 'span', 'style', 'font-size:13px;');html = replaceUBBTag(html, 'size=2', 'span', 'style', 'font-size:14px;');html = replaceUBBTag(html, 'size=3', 'span', 'style', 'font-size:18px;');html = replaceUBBTag(html, 'size=4', 'span', 'style', 'font-size:24px;');html = replaceUBBTag(html, 'size=5', 'span', 'style', 'font-size:36px;');html = replaceUBBTag(html, 'size=6', 'span', 'style', 'font-size:48px;');for (var i = 0;i < fonts.length;i++) {
var f = fonts[i];html = replaceUBBTag(html, f.c, 'span', 'style', 'font-family: ' + f.s);}
html = replaceHighLights(html);return html;}
function replaceUBBColor(html, color) {
return replaceUBBStyle(html, color, 'color');}
function replaceUBBColors(html) {
for (var i = 0;i < colors.length;i++)
html = replaceUBBColor(html, colors[i].n);return html;}
function replaceUBBSmiley(html, code, img) {
var reg = new RegExp('(' + code + ')', 'ig');html = html.replace(reg, '<img src="' + document.imageRoot + 'smileys/1/' + img + '.gif" border="0" /> ');delete reg;return html;}
function replaceUBBSmileys(html, allowDX) {
for (var i = smileys.length - 1;i >= 0;i--) {
if (!smileys[i].d || allowDX)
html = replaceUBBSmiley(html, smileys[i].u, smileys[i].t);}
return html;}
function matchMail() { return '(?:mailto:)?([a-zA-Z0-9%;\\-_\\.]+@(?:\\w|-)+(?:\\.(?:\\w|-)+)+)';}
function matchUrlNaked() { return '(?:(?:(?:(?:\\w|-){1,}(?:\\.(?:\\w|-){1,})+)|(?:\\d+\\.\\d+\\.\\d+\\.\\d+))(?::\\d+)?)(?:\\/(?:[a-zA-Z0-9%;\\?\\/:@#&=~$\\\\\\|\\-_\\.\\+\\!\\*,\\(\\) ])*)?';}
function matchUrlNoProtocol() { return '(?:(?:http):\\/\\/)?' + matchUrlNaked();}
function matchUrl() { return '(?:(?:http(?:s)?|ftp|mms):\\/\\/)' + matchUrlNaked();}
function replaceUBBImage(html) {
var reg = new RegExp('\\[(img|image)\\](' + matchUrl() + ')(\\[\\/\\1\\])', 'ig');html = html.replace(reg, '<img src="$2" border="0" OnLoad="if(this.width > 640){this.width=640;}" />');delete reg;var reg = new RegExp('\\[(img|image)=(left)\\](' + matchUrl() + ')(\\[\\/\\1=\\2\\])', 'ig');html = html.replace(reg, '<img src="$3" border="0" align="$2" style="margin-right: 3px; margin-bottom:3px;" OnLoad="if(this.width > 640){this.width=640;}" />');delete reg;var reg = new RegExp('\\[(img|image)=(right)\\](' + matchUrl() + ')(\\[\\/\\1=\\2\\])', 'ig');html = html.replace(reg, '<img src="$3" border="0" align="$2" style="margin-left: 3px; margin-bottom:3px;" OnLoad="if(this.width > 640){this.width=640;}" />');delete reg;var reg2 = new RegExp('\\[img=(\\d+),(\\d+)\\](' + matchUrl() + ')(\\[\\/img\\])', 'ig');html = html.replace(reg2, '<img src="$3" border="0" width="$1px" height="$2px"/>');delete reg2;return html;}
function replaceYT(html) {
var reg = new RegExp('\\[(url)\\](http:\\/\\/www\\.youtube.+?v=(.+?)(&.*?)?(#.*?)?)(\\[\\/\\1\\])', 'ig');html = html.replace(reg, '[pp2gyt]$3[/pp2gyt]<br/><a href="$2" target="_blank_">$2</a>');delete reg;var reg3 = new RegExp('\\[url=("|\')?(http:\\/\\/www\\.youtube.+?v=(.+?)(&.*?)?(#.*?)?)("|\')?\\](.+?)(\\[\\/url\\])', 'ig');html = html.replace(reg3, '[pp2gyt]$3[/pp2gyt]<br/><a href="$2" target="_blank_">$7</a>');delete reg3;var reg3a = new RegExp('\\[url=("|\')?(http:\\/\\/www\\.youtube.+?v=(.+?)(&.*?)?(#.*?)?)("|\')?\\]', 'ig');html = html.replace(reg3a, '[pp2gyt]$3[/pp2gyt]<br/><a href="$2" target="_blank_">$2</a>');delete reg3a;return html;}
function replaceUBBLink(html) {
var reg = new RegExp('\\[(url)\\](' + matchUrl() + ')(\\[\\/\\1\\])', 'ig');html = html.replace(reg, '<a href="$2" target="_blank_">$2</a>');delete reg;var reg3 = new RegExp('\\[url=("|\')?(' + matchUrl() + ')("|\')?\\](.+?)(\\[\\/url\\])', 'ig');html = html.replace(reg3, '<a href="$2" target="_blank_">$4</a>');delete reg3;var reg3a = new RegExp('\\[url=("|\')?(' + matchUrl() + ')("|\')?\\]', 'ig');html = html.replace(reg3a, '<a href="$2" target="_blank_">$2</a>');delete reg3a;var reg4 = new RegExp(' ' + matchMail(), 'ig');html = html.replace(reg4, ' <a href="mailto:$1">$1</a>');delete reg4;var reg5 = new RegExp('\\[email=' + matchMail() + '\\](.+?)(\\[\\/email\\])', 'ig');html = html.replace(reg5, '<a href="mailto:$1">$2</a>');delete reg5;return html;}
function replaceUBBQuote(html) {
var reg1 = new RegExp('\\[(quote|q)\\](.+?)(\\[\\/\\1\\])', 'ig');var reg2 = new RegExp('\\[(quote|q)=(.+?)\\](.+?)(\\[\\/\\1\\])', 'ig');var replaced = false;while (html.match(reg1) || html.match(reg2)) {
html = html.replace(reg1, '<blockquoteQ><table><tr><td><i>$2</i></td></tr></table></blockquoteQ>');html = html.replace(reg2, '<blockquoteQ><table><tr><td><b>[user=$2] wrote:</b><hr/><i>$3</i></td></tr></table></blockquoteQ>');replaced = true;}
delete reg1;delete reg2;if (replaced) {
var reg3 = new RegExp('</?blockquoteQ>');var nested = 0;var m = html.match(reg3);while (m) {
if (m[0] == '<blockquoteQ>') {
nested++;if (nested == 3) {
html = html.replace(reg3, '<div class="quoteHidden" onclick="document.parserMan.tQ(this);">Quotes</div><hr /><blockquote style="display:none;">');}
else { html = html.replace(reg3, '<blockquote>');}
}
else {
html = html.replace(reg3, '</blockquote>');nested--;}
m = html.match(reg3);}
delete reg3;}
return html;}
this.tQ = function(node) {
if (node.tQ == 1) {
toggleCssClass(node, 'quoteShow', 'quoteHidden');node.nextSibling.nextSibling.style.display = 'none';node.tQ = 0;}
else {
toggleCssClass(node, 'quoteHidden', 'quoteShow');node.nextSibling.nextSibling.style.display = 'block';node.tQ = 1;}
}
function replaceSection(html) {
var reg = new RegExp('\\[(section)(?: +)?(?:w=(\\d+))?(?: +)?(?:h=(\\d+))?(?: +)?(?:bgcolor=((?:#|\\w|\\d)+))?(?: +)?(?:bgimage=(' + matchUrl() + '))?(?: +)?\\](.+?)(\\[\\/\\1\\])', 'ig');while (html.match(reg)) {
html = html.replace(reg, '<div style="float:left;width:$2px;height:$3px;background-color:$4;background-image:url($5);overflow:auto;">$6</div>');}
delete reg;return html;}
function replaceMarquee(html) {
var reg = new RegExp('\\[(m)(?: +)?(?:w=(\\d+))?(?: +)?(?:h=(\\d+))?(?: +)?(?:b=(scroll|slide|alternate))?(?: +)?(?:d=(left|right|up|down))?(?: +)?(?:s=(\\d+))?(?: +)?(?:d=(\\d+))?(?: +)?\\](.+?)(\\[\\/\\1\\])', 'ig');var matched = false;while (html.match(reg)) {
html = html.replace(reg, '<marquee width="$2" height="$3" behavior="$4" direction="$5" scrollamount="$6" scrolldelay="$7">$8</marquee>');matched = true;}
if (matched) {
var reg2 = new RegExp('<marquee(.+?)(width=""|height=""|behavior=""|direction=""|scrollamount=""|scrolldelay="")(.+?)?>(.+?)</marquee>', 'g');while (html.match(reg2)) {
html = html.replace(reg2, '<marquee$1$3>$4</marquee>');}
delete reg2;}
delete reg;return html;}
function replaceUBBUser(html) {
var reg = new RegExp('\\[userid\\]', 'ig');html = html.replace(reg, document.pp2g_userid ? document.pp2g_userid : '[PP2G ID]');delete reg;var reg = new RegExp('\\[username\\]', 'ig');html = html.replace(reg, document.pp2g_username ? document.pp2g_username : 'PP2G');delete reg;var reg = new RegExp('\\[user=(.+?)\\]', 'ig');html = html.replace(reg, '<a href="http://www.partypeeps2000.com/members/$1.aspx"><strong>$1</strong></a>');delete reg;var reg = new RegExp('\\[user name=(.+?)\\]', 'ig');html = html.replace(reg, '<a href="http://www.partypeeps2000.com/members/$1.aspx"><strong>$1</strong></a>');delete reg;return html;}
function replaceFlash(html) {
var reg = new RegExp('\\[flash(?: +)?w=(\\d+)(?: +)?h=(\\d+)(?: +)?src=(' + matchUrl() + ')(?: +)?flashvars=(?:\'|")(.+?)(?:\'|")(?: +)?]', 'ig');html = html.replace(reg, "<object width='$1' height='$2'><param name='movie' value='$3'></param><param name='allowFullScreen' value='false'></param><param name='allowscriptaccess' value='false'></param><param name='flashvars' value='$4'></param><embed src='$3' type='application/x-shockwave-flash' allowscriptaccess='false' flashvars='$4' allowfullscreen='false' width='$1' height='$2'></embed></object>");delete reg;return html;}
function replaceWMV(html) {
var reg = new RegExp('\\[(windowsmediamovie|wmvmovie) w=(\\d+) h=(\\d+) play=(0|1|true|false)\\](.+?)(\\[\\/\\1\\])', 'ig');html = html.replace(reg, "<OBJECT ID='MediaPlayer' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' CODEBASE='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902' width='$2' height='$3' standby='Loading Microsoft Windows Media Player components...' ><PARAM NAME='FileName'  VALUE='$5'><PARAM NAME='AutoStart' Value='0'><PARAM NAME='ShowControls' Value='true'><PARAM NAME='ShowStatusbar' Value='false'><embed type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' src='$5' Name='MediaPlayer' Width='$2' Height='$3' AutoStart='0' ShowControls='1' ShowStatusbar='0'</embed></OBJECT>");delete reg;var reg = new RegExp('\\[(windowsmediamovie|wmvmovie)\\](.+?)(\\[\\/\\1\\])', 'ig');html = html.replace(reg, "<OBJECT ID='MediaPlayer' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' CODEBASE='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902' width='352' height='288' standby='Loading Microsoft Windows Media Player components...' ><PARAM NAME='FileName'  VALUE='$2'><PARAM NAME='AutoStart' Value='0'><PARAM NAME='ShowControls' Value='true'><PARAM NAME='ShowStatusbar' Value='false'><embed type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' src='$2' Name='MediaPlayer' Width='352' Height='288' AutoStart='0' ShowControls='1' ShowStatusbar='0'</embed></OBJECT>");delete reg;return html;}
var doAds = true;function replacePP2GTVVideo(html) {
if (doAds && document.aid == 1) {
var reg = new RegExp('\\[(pp2gtv|tv) w=(\\d+) h=(\\d+)\\](.+?)(\\[\\/\\1\\])', 'i');if (html.match(reg) != null) {
html = html.replace(reg, "<iframe src='/vs$4-$2-$3.aspx' width='$2' height='$3' align='center' frameborder='no' border='0' scrolling='no' marginwidth='0' marginheight='0'></iframe>");doAds = false;}
delete reg;}
var extraParams = "." + document.aid + '.' + (document.uid != undefined ? document.uid : "0");var reg = new RegExp('\\[(pp2gtv|tv) w=(\\d+) h=(\\d+)\\](.+?)(\\[\\/\\1\\])', 'ig');html = html.replace(reg, "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width='$2' height='$3'><param name='movie' value='http://www.pp2g.tv/p$4" + extraParams + ".aspx'></param><param name='wmode' value='transparent'></param><param name='allowFullscreen' value='true'></param><embed src='http://www.pp2g.tv/p$4" + extraParams + ".aspx' type='application/x-shockwave-flash' wmode='transparent' allowFullScreen='true' width='$2' height='$3'></embed></object>");delete reg;reg = new RegExp('\\[(pp2gtv|tv) fc=([0-9a-f]+) lc=([0-9a-f]+)\\](.+?)(\\[\\/\\1\\])', 'ig');html = html.replace(reg, "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width='320' height='273'><param name='movie' value='http://www.pp2g.tv/p$2" + extraParams + ".$3.$4.aspx'></param><param name='wmode' value='transparent'></param><param name='allowFullscreen' value='true'></param><embed src='http://www.pp2g.tv/p$2" + extraParams + "|$3|$4.aspx' type='application/x-shockwave-flash' wmode='transparent' allowFullScreen='true' width='320' height='273'></embed></object>");delete reg;reg = new RegExp('\\[(vpp2gtv)](.+?)(\\[\\/\\1\\])', 'ig');html = html.replace(reg, "<iframe src='/vs$2.aspx' width='320' height='272' align='center' frameborder='no' border='0' scrolling='no' marginwidth='0' marginheight='0'></iframe>");delete reg;if (doAds && document.aid == 1) {
reg = new RegExp('\\[(pp2gtv|tv)\\](.+?)(\\[\\/\\1\\])', 'i');if (html.match(reg) != null) {
html = html.replace(reg, "<iframe src='/vs$2.aspx' width='320' height='272' align='center' frameborder='no' border='0' scrolling='no' marginwidth='0' marginheight='0'></iframe>");doAds = false;}
delete reg;}
if (doAds && document.aid == 1) {
reg = new RegExp('\\[(pp2gyt)\\](.+?)(\\[\\/\\1\\])', 'i');if (html.match(reg) != null) {
html = html.replace(reg, "<iframe src='/ytvs$2.aspx' width='320' height='272' align='center' frameborder='no' border='0' scrolling='no' marginwidth='0' marginheight='0'></iframe>");doAds = false;}
delete reg;}
reg = new RegExp('\\[(pp2gyt)\\](.+?)(\\[\\/\\1\\])', 'ig');html = html.replace(reg, "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width='320' height='273'><param name='movie' value='http://www.pp2g.tv/yt$2.aspx'></param><param name='wmode' value='transparent'></param><param name='allowFullscreen' value='true'></param><param name='flashvars' value='width=320&height=273&usefullscreen=true'></param><embed src='http://www.pp2g.tv/yt$2.aspx' type='application/x-shockwave-flash' wmode='transparent' width='320' height='273' allowFullScreen='true' flashvars='width=320&height=273&usefullscreen=true'></embed></object>");delete reg;reg = new RegExp('\\[(pp2gtv|tv)\\](.+?)(\\[\\/\\1\\])', 'ig');html = html.replace(reg, "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width='320' height='273'><param name='movie' value='http://www.pp2g.tv/p$2" + extraParams + ".aspx'></param><param name='wmode' value='transparent'></param><param name='allowFullscreen' value='true'></param><param name='flashvars' value='width=320&height=273&usefullscreen=true'></param><embed src='http://www.pp2g.tv/p$2" + extraParams + ".aspx' type='application/x-shockwave-flash' wmode='transparent' width='320' height='273' allowFullScreen='true' flashvars='width=320&height=273&usefullscreen=true'></embed></object>");delete reg;reg = new RegExp('\\[(pp2gtvpl)\\](.+?)(\\[\\/\\1\\])', 'ig');var w = document.aid == 1 ? 470 : 520;html = html.replace(reg, "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width='" + w + "' height='273'><param name='movie' value='http://www.pp2g.tv/lp$2" + extraParams + ".aspx'></param><param name='wmode' value='transparent'></param><param name='allowFullscreen' value='true'></param><param name='flashvars' value='width=" + w + "&height=273&usefullscreen=true'></param><embed src='http://www.pp2g.tv/lp$2" + extraParams + ".aspx' type='application/x-shockwave-flash' wmode='transparent' allowFullScreen='true' width='" + w + "' height='273' flashvars='width=" + w + "&height=273&usefullscreen=true'></embed></object>");delete reg;reg = new RegExp('\\[(pp2gtvpl) w=(\\d+) h=(\\d+)\\](.+?)(\\[\\/\\1\\])', 'ig');html = html.replace(reg, "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width='$2' height='$3'><param name='movie' value='http://www.pp2g.tv/lp$4" + extraParams + ".aspx'></param><param name='wmode' value='transparent'></param><param name='allowFullscreen' value='true'></param><param name='flashvars' value='width=$2&height=$3&usefullscreen=true'></param><embed src='http://www.pp2g.tv/lp$4" + extraParams + ".aspx' type='application/x-shockwave-flash' wmode='transparent' allowFullScreen='true' width='$2' height='$3' flashvars='width=$2&height=$3&usefullscreen=true'></embed></object>");delete reg;reg = new RegExp('\\[(pp2gtvpl) w=(\\d+) h=(\\d+) fc=([0-9a-f]+) lc=([0-9a-f]+) p=(.+?)\\](.+?)(\\[\\/\\1\\])', 'ig');html = html.replace(reg, "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width='$2' height='$3'><param name='movie' value='http://www.pp2g.tv/lp$7" + extraParams + ".$4.$5.aspx'></param><param name='wmode' value='transparent'></param><param name='allowFullscreen' value='true'></param><param name='flashvars' value='width=$2&height=$3&usefullscreen=true&$6'></param><embed src='http://www.pp2g.tv/lp$7" + extraParams + ".$4.$5.aspx' type='application/x-shockwave-flash' wmode='transparent' allowFullScreen='true' width='$2' height='$3' flashvars='width=$2&height=$3&usefullscreen=true&$6'></embed></object>");delete reg;return html;}
function replaceGlitter(html) {
var reg = new RegExp('\\[(glitter)](.+?(?:swfHeight=(\\d+)).+?(?:swfWidth=(\\d+)).+?)(\\[\\/\\1\\])', 'ig');html = html.replace(reg, '<embed src="' + document.flashEditorRoot + 'glitter3/show7.swf" base="' + document.flashEditorRoot + 'glitter3/" FLASHVARS="$2" quality="best" wmode="transparent" width="$4" height="$3" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" ></embed>');delete reg;return html;}
function replaceRotator(html) {
var reg = new RegExp('\\[(rotator)](.*?(?:w=(\\d+)).+?(?:h=(\\d+)).+?)(\\[\\/\\1\\])', 'ig');html = html.replace(reg, '<embed src="' + document.flashEditorRoot + 'rotator/imagerotator11.swf" base="' + document.flashEditorRoot + 'rotator/" FLASHVARS="$2" quality="best" wmode="transparent" width="$3" height="$4" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" ></embed>');delete reg;return html;}
function replaceMoodmeter(html) {
var reg = new RegExp('\\[(moodmeter)](.+?)(\\[\\/\\1\\])', 'ig');html = html.replace(reg, '<embed src="http://www.alwaysmoodmeter.nl/getflash.php?username=$2" quality="high" wmode="transparent" width="335" height="425" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" ></embed>');delete reg;return html;}
function replaceHighLights(html) {
html = replaceUBBTag(html, 'hl0', 'span', 'class', 'hl0');html = replaceUBBTag(html, 'hl1', 'span', 'class', 'hl1');html = replaceUBBTag(html, 'hl2', 'span', 'class', 'hl2');html = replaceUBBTag(html, 'hl3', 'span', 'class', 'hl3');html = replaceUBBTag(html, 'hl4', 'span', 'class', 'hl4');html = replaceUBBTag(html, 'hl5', 'span', 'class', 'hl5');html = replaceUBBTag(html, 'hl6', 'span', 'class', 'hl6');html = replaceUBBTag(html, 'hl7', 'span', 'class', 'hl7');html = replaceUBBTag(html, 'hl8', 'span', 'class', 'hl8');html = replaceUBBTag(html, 'hl9', 'span', 'class', 'hl9');return html;}
}
document.parserMan = new ParserMan();
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();