function UBB(strContent) {
    var strValue;
    strValue = strContent;

    //网址加上连接
    strValue = strValue.replace(/([^(\]|,)http:]+)((http|ftp|mms|rtsp):\/\/[A-Za-z0-9\.\-_\\\/\?%&=;\'\"@#]+)/gi, "$1<a href=$2 target=_blank>$2</a>");
    strValue = strValue.replace(/([^http:\/\/]+)(www.[A-Za-z0-9\.\-_\\\/\?%&=;\'\"@#]+)/gi, "$1<a href=$2 target=_blank>$2</a>");
    strValue = strValue.replace(/href=(www.)/gi, "href=http://$1");

    //还原图片标识
    strValue = strValue.replace(/(\[Img\])([^\[]*)\[\/Img\]/gi, "<img src=$2>");

    //还原作者标识
    strValue = strValue.replace(/(\[Author\])([^\[]*)\[\/Author\]/gi, "<span class=Author>$2</span>");

    //还原引用标识
    strValue = strValue.replace(/(\[Quote\])([^\[]*)\[\/Quote\]/g, "<div class=Quote>$2</div>");
    strValue = strValue.replace(/(\[Quote\])/gi, "<div class=Quote>");
    strValue = strValue.replace(/(\[\/Quote\])/gi, "</div>");

    //还原图片标识
    strValue = strValue.replace(/(\[Wmv\])([^\[]*)\[\/Wmv\]/gi, "<object classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 align=middle class=OBJECT id=MediaPlayer width=600 height=450><param name=autoStart value=true><param name=ShowStatusBar value=true><param name=url value=$2><PARAM name=uiMode value=full><PARAM name=stretchToFit value=true><embed type=application/x-oleobject codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 flename=mp src=$2 width=600 height=450></embed></object>");

    //还原图片标识
    strValue = strValue.replace(/(\[Rpv\])([^\[]*)\[\/Rpv\]/gi, "<object classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA class=OBJECT id=RAOCX width=600 height=450><PARAM NAME=SRC VALUE=$2><PARAM NAME=AUTOSTART VALUE=true><PARAM NAME=CONSOLE VALUE=Clip1><PARAM NAME=CONTROLS VALUE=imagewindow></OBJECT><br><OBJECT classid=CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA height=32 id=video2 width=600><PARAM NAME=SRC VALUE=$2><PARAM NAME=AUTOSTART VALUE=true><PARAM NAME=CONTROLS VALUE=controlpanel><PARAM NAME=CONSOLE VALUE=Clip1></object>");

    //还原视频显示标识
    //alert(strValue);
    //strValue = strValue.replace(/\[Video=1,([0-9]*),([0-9]*),([^\[]*)\]([^\[]*)\[\/Video\]/gi, "<embed vType=\"1\" width=\"$1\" height=\"$2\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" allowscriptaccess=\"always\" quality=\"high\" name=\"vPlaybox\" id=\"vPlaybox\" picurl=\"$3\" src=\"http://img.ku6.com/common/supev/200809271532/player.swf?" + Math.random() + "&vid=$4&auto=0\" type=\"application/x-shockwave-flash\"/>");
    //strValue = strValue.replace(/\[Video=2,([0-9]*),([0-9]*),([^\[]*)\]([^\[]*)\[\/Video\]/gi, "<embed vType=\"2\" width=\"$1\" height=\"$2\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" allowscriptaccess=\"always\" quality=\"high\" name=\"vPlaybox\" id=\"vPlaybox\" picurl=\"$3\" src=\"$4\" type=\"application/x-shockwave-flash\"/>");
    strValue = strValue.replace(/\[Video=1,([0-9]*),([0-9]*),([^\[]*)\]([^\[]*)\[\/Video\]/gi, "<embed id=vPlaybox name=\"vPlaybox\" vType=\"1\" width=\"$1\" height=\"$2\" picurl=\"$3\" src=\"http://v.ku6vms.com/phpvms/player/html/vid/$4/style/bu3ff9JnseE./\" quality=\"high\" align=\"middle\" allowScriptAccess=\"always\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\"/>");
    strValue = strValue.replace(/\[Video=2,([0-9]*),([0-9]*),([^\[]*)\]([^\[]*)\[\/Video\]/gi, "<embed id=vPlaybox name=\"vPlaybox\" vType=\"2\" width=\"$1\" height=\"$2\" picurl=\"$3\" src=\"$4\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" allowscriptaccess=\"always\" quality=\"high\" type=\"application/x-shockwave-flash\"/>");
    return strValue;
}

function DecUBB(strContent) {
    var strValue;
    strValue = strContent;

    //还原UBB标识
    //var regx=/(\[img\])([^/]+)\[\/img\]/g;
    //strValue = strValue.replace(/(\[Img\])([ \S\t]*?)\[\/Img\]/g,"<img src=$2>");	//IE5.0支持正则,  但不支持非贪婪正则  *?  			
    //还原图片标识
    strValue = strValue.replace(/(<IMG src=")([^\[<>]*)(">)/gi, "[Img]$2[/Img]");

    //还原作者标识	
    strValue = strValue.replace(/(<span class=Author>)([^\[<>]*)(<\/span>)/gi, "[Author]$2[/Author]");

    //还原引用标识	
    //strValue = strValue.replace(/(<span class=Quote>)([^\[<>]*)(<\/span>)/gi,"[Quote]$2[/Quote]");
    strValue = strValue.replace(/(\<div class=Quote\>)/gi, "[Quote]");
    strValue = strValue.replace(/(\<\/div\>)/gi, "[/Quote]");

    //还原网址	
    strValue = strValue.replace(/(<a href="([^\[<>]*) target=_blank>)([^\[<>]*)(<\/a>)/gi, "$2");

    // 还原视频ubb标记
    // 还原图片标识
    strValue = strValue.replace(/<object[\s\S]+<\/object>/gi, "Movie");

    // 还原来ubb视频标识
    //var vEmbed = strValue.match(/<EMBED\sid=vPlaybox\s.*?>/gi);
    strValue = strValue.replace(/<EMBED\sid=vPlaybox\s.*?>/gi, "Movie");
//    if (vEmbed != null && vEmbed != "") {
//        alert("1:\r\n" + vEmbed);
//        var vEmbed_vtype, vEmbed_width, vEmbed_height, vEmbed_vid, vEmbed_pic, vEmbed_url;
//        var regExp = new RegExp();
//        // 类型
//        regExp = /vType="(1|2)"/gi;
//        regExp.exec(vEmbed);
//        vEmbed_vtype = RegExp.$1;
//        // 宽，高
//        regExp = /width=([0-9]+)\sheight=([0-9]+)/gi;
//        regExp.exec(vEmbed);
//        vEmbed_width = RegExp.$1;
//        vEmbed_height = RegExp.$2;
//        // 截图
//        regExp = /picurl="([^"]*)"/gi;
//        regExp.exec(vEmbed);
//        vEmbed_pic = RegExp.$1;

//        if (vEmbed_vtype == "1") {
//            // vid
//            regExp = /vid=([^&]*)&/gi;
//            regExp.exec(vEmbed);
//            vEmbed_vid = RegExp.$1;
//            alert("2:\r\n" + vEmbed + "\r\n" + vEmbed_width + "," + vEmbed_height + "," + vEmbed_vid + "," + vEmbed_pic);
//            if (vEmbed_width != "" && vEmbed_height != "" && vEmbed_vid != "" && vEmbed_pic != "")
//                strValue = strValue.replace(vEmbed, "[Video=1," + vEmbed_width + "," + vEmbed_height + "," + vEmbed_pic + "]" + vEmbed_vid + "[/Video]");
//        } else if (vEmbed_vtype == "2") {
//            // url
//            regExp = /src=([^\s]*)/gi;
//            regExp.exec(vEmbed);
//            vEmbed_url = RegExp.$1;
//            //alert(vEmbed + "\r\n" + vEmbed_width + "," + vEmbed_height + "," + vEmbed_url + "," + vEmbed_pic);
//            if (vEmbed_width != "" && vEmbed_height != "" && vEmbed_url != "")
//                strValue = strValue.replace(vEmbed, "[Video=2," + vEmbed_width + "," + vEmbed_height + "," + vEmbed_pic + "]" + vEmbed_url + "[/Video]");
//        } else {
//            alert("引用参数 vEmbed_vtype 错误");
//        }
//    }
    return strValue;
}
