﻿function WoStyle(inputUserInfo,inputStyle,myCheckUser,myPresents,serverTime,myPropParsList)
{
    this.userInfo = inputUserInfo;
    this.userStyle = inputStyle;
    this.myCheckUser = myCheckUser;
    this.myPresents = myPresents;
    this.myPropParsList = myPropParsList;
    this.serverTime = serverTime;
    this.body = document.body;
    this.top = $("top");
    this.blockArr = [{"id":1,"divid":"customblock_1","title":"\u8D44\u6599","width":220,"height":280,"x":50,"y":210,"z":1,"dataurl":"block/info.aspx","morelink":"user/userinfo.aspx","actionbutton":"<input type=\"button\" class=\"linkBtn\" value=\"\u7F16\u8F91\" onclick=\"openurl('user/setinfo.aspx');\" />"},{"id":2,"divid":"customblock_2","title":"\u9B54\u6CD5\u82B1\u56ED","width":220,"height":150,"x":50,"y":840,"z":2,"dataurl":"block/garden.aspx","morelink":"garden/default.aspx","actionbutton":"<input type=\"button\" class=\"linkBtn\" value=\"\u7BA1\u7406\" onclick=\"openurl('garden/default.aspx');\" />"},{"id":3,"divid":"customblock_3","title":"\u72D7\u7A9D\u5730\u76D8","width":520,"height":300,"x":280,"y":545,"z":3,"dataurl":"block/map.aspx","morelink":"map/default.aspx","actionbutton":""},{"id":4,"divid":"customblock_4","title":"\u7559\u8A00","width":520,"height":150,"x":280,"y":880,"z":4,"dataurl":"block/leaveword.aspx","morelink":"leaveword/default.aspx","actionbutton":""},{"id":5,"divid":"customblock_5","title":"\u597D\u53CB\u5708","width":220,"height":280,"x":50,"y":1010,"z":5,"dataurl":"block/friend.aspx","morelink":"friend/default.aspx","actionbutton":"<input type=\"button\" class=\"linkBtn\" value=\"\u7BA1\u7406\" onclick=\"openurl('friends/default.aspx');\" />"},{"id":6,"divid":"customblock_6","title":"\u76F8\u518C","width":520,"height":300,"x":280,"y":210,"z":6,"dataurl":"block/album.aspx","morelink":"album/default.aspx","actionbutton":"<input type=\"button\" class=\"linkBtn\" value=\"\u4E0A\u4F20\" onclick=\"openurl('album/albumupload.aspx');\" />"},{"id":7,"divid":"customblock_7","title":"\u65E5\u5FD7","width":220,"height":280,"x":50,"y":525,"z":7,"dataurl":"block/blog.aspx","morelink":"blog/default.aspx","actionbutton":"<input type=\"button\" class=\"linkBtn\" value=\"\u53D1\u5E03\" onclick=\"openurl('blog/diaryedit.aspx');\" />"}];
    this.mainPages = [{"id":0,"title":"主页","url":""},
                     {"id":1,"title":"资料","url":"user/userinfo.aspx"},
                     {"id":2,"title":"魔法花园","url":"garden/default.aspx"},
                     {"id":3,"title":"狗窝地图","url":"map/default.aspx"},
                     {"id":4,"title":"留言","url":"leaveword/default.aspx"},
                     {"id":5,"title":"好友圈","url":"friends/default.aspx"},
                     {"id":6,"title":"相册","url":"Album/default.aspx"},
                     {"id":7,"title":"日记","url":"blog/default.aspx"}];
    this.myStyle = {};
    this.myMainIframe = null;
    this.picHost = "http://imgwo.gouwo.com/";
    this.blockContainer = null;
    this.myBlockMoveResize = new MoveResize("dragresize",{minWidth:100,minHeight:100,minTop:100,maxLeft:1000,minZIndex:1,maxZIndex:999});
    this.myPropMoveResize = new MoveResize("dragresize",{minWidth:100,minHeight:100,minTop:0,maxLeft:2000,minZIndex:1000,maxZIndex:2999});
    this.myTestMoveResize = new MoveResize("dragresize",{minWidth:100,minHeight:100,minTop:0,maxLeft:2000,minZIndex:10000,maxZIndex:10999});
    this.myFloatLayerClass = null;
    this.isOnMoveResize = false;//是否正在自定义
    //拖放暂存列表
    this.moveTempList = new Array();
    //购买试用道具
    this.buyTryList = new Array();
    
    var oThis = this;
    this.Init = function()
    {
        with(oThis)
        {
            oThis.blockContainer = $("blockContainer");
            //oThis.CreateMainIframe(); 
            oThis.ShowDefault();
        }
    }
    //EventUtil.addEvent(window,"load",this.Init);
}

WoStyle.prototype.Save = function()
{
    if(this.userStyle.myFlashMenu!=null)
    {
        this.userStyle.myFlashMenu.divid="flashmenu";
        this.userStyle.myFlashMenu = this.ChangeMoveResizeInfo(this.userStyle.myFlashMenu);
    }
    for(var i=0;i<this.userStyle.myAdornments.length;i++)
    {
        this.userStyle.myAdornments[i] = this.ChangeMoveResizeInfo(this.userStyle.myAdornments[i]);
    }
    for(var i=0;i<this.userStyle.myImageBlocks.length;i++)
    {
        this.userStyle.myImageBlocks[i] = this.ChangeMoveResizeInfo(this.userStyle.myImageBlocks[i]);
    }
    for(var i=0;i<this.userStyle.myFlashBlocks.length;i++)
    {
        this.userStyle.myFlashBlocks[i] = this.ChangeMoveResizeInfo(this.userStyle.myFlashBlocks[i]);
    }
    for(var i=0;i<this.userStyle.myVideoBlocks.length;i++)
    {
        this.userStyle.myVideoBlocks[i] = this.ChangeMoveResizeInfo(this.userStyle.myVideoBlocks[i]);
    }
    for(var i=0;i<this.userStyle.myDefaultBlocks.length;i++)
    {
        this.userStyle.myDefaultBlocks[i] = this.ChangeMoveResizeInfo(this.userStyle.myDefaultBlocks[i]);
    }
    for(var i=0;i<this.userStyle.myCustomProps.length;i++)
    {
        this.userStyle.myCustomProps[i] = this.ChangeMoveResizeInfo(this.userStyle.myCustomProps[i]);
    }
    var pars = "";
    pars = addPostParam(pars,"pars",JSON.stringify(this.userStyle));
    Http.post("/widget/userdress/save.aspx?date"+escape(Date()),pars,function(retext){
        var restate = JSON.parse(retext);
            if(restate.IsSuccess){
                kg.Info("哇，好厉害，狗窝自定义方案保存成功！",2000,200);
            }
            else
            {
                kg.Info(restate.Error,2000,200);
            }
    },function(e){
        kg.Info('狗窝自定义方案保存失败，请重新设置方案！',2000,200);
        });
    this.EndMoveResize();
}

WoStyle.prototype.ChangeMoveResizeInfo = function(widgetValue)
{
    var element = $(widgetValue.divid);
    if(element&&widgetValue)
    {
        if(isIE)
		{
			widgetValue.x=kg.Page.getRealLeft(element)+kg.Page.getWindowScrollLeft();
			widgetValue.y=kg.Page.getRealTop(element)+kg.Page.getWindowScrollTop();
		}
		else
		{
			widgetValue.x=kg.Page.getRealLeft(element);
			widgetValue.y=kg.Page.getRealTop(element);
		}
		if(element.style.width=="")
		{
		    widgetValue.width = kg.Page.getObjOffsetWidth(element);
		}
		else
		{
		    widgetValue.width = parseInt(element.style.width.toLowerCase().replace("px",""));
		}
		if(element.style.height=="")
		{
		    widgetValue.height = kg.Page.getObjOffsetHeight(element);
		}
		else
		{
		    widgetValue.height = parseInt(element.style.height.toLowerCase().replace("px",""));
		}
		if(element.style.zIndex!="")
		{
		    widgetValue.z = parseInt(element.style.zIndex);
		}
		if(element.style.display.toLowerCase()=="none")
		{
		    widgetValue.display = false;
		}
		else
		{
		    widgetValue.display = true;
		}
    }
    return widgetValue;
}

WoStyle.prototype.SaveSolvent = function()
{
    if(!this.userInfo.IsMyself)
    {
        alert("您无法直接装扮别人的狗窝，送他一些装扮道具吧！");
        return;
    }
    var mustBuyList = new Array();
    for(var i=0;i<this.buyTryList.length;i++)
    {
        if($("buyprop_"+this.buyTryList[i].PropID))
        {
            var has = false;
            for(var j=0;j<mustBuyList.length;j++)
            {
                if(mustBuyList[j] == this.buyTryList[i].PropID)
                {
                    has = true;
                    break;
                }
            }
            if(!has)
            {
                mustBuyList.push(this.buyTryList[i].PropID);
            }
        }
    }
    var pars = "";
    pars = addPostParam(pars,"buylist",JSON.stringify(mustBuyList));
    var oThis = this;
    Http.get("/widget/propdress/savesolvent.aspx?date="+escape(Date())+"&"+pars,
        function(retext){
            var restate = JSON.parse(retext);
            if(restate.IsSuccess){
                var needBuyCount = parseInt(restate.Error);
                if(needBuyCount>0)
                {
                    alert("还有"+needBuyCount+"个道具未购买！");
                    kg.TopClose();
                    window.setTimeout(function(e){OpenStoreUrl("/widget/cart.aspx")},100);
                }
                else
                {
                    alert("哇，好厉害，狗窝装扮方案保存成功！");
                }
            }
            else
            {
                alert("狗窝装扮方案保存失败，请您重新装扮！");
            }
        },
        function(){
            alert("狗窝装扮方案保存失败，请您重新装扮！");
        });
}
WoStyle.prototype.UnShowBlocks = function()
{
    this.blockContainer.style.display = "none";
}

WoStyle.prototype.ShowBlocks = function()
{
    this.blockContainer.style.display = "block";
}

WoStyle.prototype.ShowDefault = function()
{
    var oThis = this;
    if(this.userStyle.myFlashMenu!=null)
    {
        this.ShowFlashMenu(this.userStyle.myFlashMenu,null);
    }
    if(this.userStyle.myBackground!=null)
    {
        this.ShowBackground(this.userStyle.myBackground);
    }
    if(this.userStyle.myCursor!=null)
    {
        setTimeout(function(){oThis.ShowCursor(oThis.userStyle.myCursor);},2000);
    }
    if(this.userStyle.myFloatLayer!=null)
    {
        this.ShowFloatLayer(this.userStyle.myFloatLayer);
    }
    if(this.userStyle.myCssColor)
    {
        this.ShowCssColor(this.userStyle.myCssColor);
    }
    for(var i=0;i<this.userStyle.myAdornments.length;i++)
    {
        if(!StringIsNull(this.userStyle.myAdornments[i].image))
        {
            this.userStyle.myAdornments[i].divid = "imageblock_"+i;
            this.ShowAdornment(this.userStyle.myAdornments[i]);
        }
    }
    for(var i=0;i<this.userStyle.myImageBlocks.length;i++)
    {
        if(!StringIsNull(this.userStyle.myImageBlocks[i].url))
        {
            this.userStyle.myImageBlocks[i].divid = "userblock_"+this.userStyle.myImageBlocks[i].autoid;
            this.ShowImageBlock(this.userStyle.myImageBlocks[i]);
        }
    }
    for(var i=0;i<this.userStyle.myFlashBlocks.length;i++)
    {
        if(!StringIsNull(this.userStyle.myFlashBlocks[i].url))
        {
            this.userStyle.myFlashBlocks[i].divid = "userblock_"+this.userStyle.myFlashBlocks[i].autoid;
            this.ShowFlashBlock(this.userStyle.myFlashBlocks[i]);
        }
    }
    for(var i=0;i<this.userStyle.myVideoBlocks.length;i++)
    {
        if(!StringIsNull(this.userStyle.myVideoBlocks[i].url))
        {
            this.userStyle.myVideoBlocks[i].divid = "userblock_"+this.userStyle.myVideoBlocks[i].autoid;
            this.ShowVideoBlock(this.userStyle.myVideoBlocks[i]);
        }
    }
    for(var i=0;i<this.userStyle.myCustomProps.length;i++)
    {
        this.TryProp(this.userStyle.myCustomProps[i].propid,false,this.userStyle.myCustomProps[i],true);
    }
    for(var i=0;i<this.userStyle.myDefaultBlocks.length;i++)
    {
        var blockInfo = this.GetBlockInfo(this.userStyle.myDefaultBlocks[i].blocktypeid);
        if(!$(blockInfo.divid))
        {
            this.CreateDefaultBlock(this.userStyle.myDefaultBlocks[i]);
        }
    }
    var showPresents = new Array();
    if(this.myPresents.length>0)
    {
        for(var i=0;i<this.myPresents.length;i++)
        {
            this.myPresents[i].z = 2001;
            if(this.myPresents[i].Priority==0)
            {
                if(showPresents.length<5)
                {
                    showPresents.push(this.myPresents[i]);
                    this.TryProp(this.myPresents[i].PropID,false,this.myPresents[i]);
                }
                else
                {
                    break;
                }
            }
            else
            {
                showPresents.push(this.myPresents[i]);
                this.TryProp(this.myPresents[i].PropID,false,this.myPresents[i]);
            }
        }
    }
}

WoStyle.prototype.GetPropPars = function(propID,getSuccess,getError)
{
    if(this.myPropParsList)
    {
        for(var i=0;i<this.myPropParsList.length;i++)
        {
        
            if(this.myPropParsList[i].PropID==propID)
            {
                if(getSuccess)
                {
                    getSuccess(this.myPropParsList[i]);
                }
                return;
            }
        }
    }
    Http.get("/widget/propdress/getproppars.aspx?propid="+propID+"&date="+escape(Date()),
        function(retext)
        {
            var restate = JSON.parse(retext);
            var myProp = JSON.parse(restate.Error);
            if(getSuccess)
            {
                getSuccess(myProp);
            }
        },
        getError);
}

WoStyle.prototype.CreateDefaultBlock = function(widgetValue)
{
    var blockInfo = this.GetBlockInfo(widgetValue.blocktypeid);
    widgetValue.divid=blockInfo.divid;
    if(blockInfo==null)
    {
        alert("没有这种版块！");return;
    }
    if($(blockInfo.divid))
    {
        $(blockInfo.divid).parentNode.removeChild($(blockInfo.divid));
    }
    this.CreateBlockStyle(blockInfo.divid,blockInfo.title,blockInfo.width,blockInfo.height,blockInfo.x,blockInfo.y,blockInfo.z);
    
    if($(blockInfo.divid))
    {
        $(blockInfo.divid).style.left = widgetValue.x+"px";
        $(blockInfo.divid).style.top = widgetValue.y+"px";
        $(blockInfo.divid).style.width = widgetValue.width+"px";
        $(blockInfo.divid).style.height = widgetValue.height+"px";
        $(blockInfo.divid).style.zIndex = widgetValue.z;
    }
    
    if($(blockInfo.divid+"_more")){
        
            setInnerHTML($(blockInfo.divid+"_more"),'<a href="javascript:myWoStyle.OpenUrl(\''+blockInfo.morelink+'?id='+this.userInfo.UserID+'\');" class="gray">更多</a>');
    }
    if($(blockInfo.divid+"_more")){
        if(this.userInfo.IsMyself&&!StringIsNull(blockInfo.actionbutton))
        {
            setInnerHTML($(blockInfo.divid+"_more"),blockInfo.actionbutton);
        }
    }
    setInnerHTML($(blockInfo.divid+"_content"),"正在下载中……");
    Http.get(blockInfo.dataurl+"?id="+this.userInfo.UserID+"&date="+escape(Date()),function(e){
        setInnerHTML($(blockInfo.divid+"_content"),'<div style="width:94%;padding:2%;text-align:center;">'+e+'</div>');
    },
    function(){
        setInnerHTML($(blockInfo.divid+"_content"),'<div style="width:94%;padding:2%;text-align:center;">'+"下载失败.."+'</div>');
    });
}

WoStyle.prototype.ShowProp = function()
{
    var oThis = this;
    Http.get("/widget/propdress/getproppars.aspx?propid="+propID+"&date="+escape(Date()),
    function(retext)
    {
        var restate = JSON.parse(retext);
        var myProp = JSON.parse(restate.Error);
        var widgetValue = JSON.parse(myProp.Pars);
        var propValue = new Object();
        propValue.autoid = autoID;
        propValue.propid = propID;
        propValue.height = 0;
        propValue.width = 0;
        propValue.x = 0;
        propValue.y = 0;
        propValue.z = 2000;
        oThis.ShowPropFirst(widgetValue,propValue);
    },
    function(){});
}

WoStyle.prototype.UsePropFromWidget = function(typeID,propID,autoID)
{
    if(typeID>=20000&&typeID<40000)
    {
        var oThis = this;
        this.GetPropPars(propID,
        function(myProp)
        {
            var widgetValue;
                    if(!StringIsNull(myProp.Pars))
                    {
                        widgetValue = JSON.parse(myProp.Pars);
                    }
            var propValue = new Object();
            propValue.autoid = autoID;
            propValue.propid = propID;
            propValue.height = 0;
            propValue.width = 0;
            propValue.x = 0;
            propValue.y = 0;
            propValue.z = 11000;
            oThis.ShowPropFirst(widgetValue,propValue,true);
        },
        function()
        {});
        kg.Login('/widget/propdress/usepresent.aspx?propID='+propID+'&autoid='+autoID+'&id='+this.userInfo.UserID,'使用道具',400,200,true);
    }
    else if(typeID>=10000 && typeID<20000)
    {
        if(!this.userInfo.IsMyself)
        {
            kg.Info('您无法直接装扮别人的狗窝，送他一些装扮道具吧！',2000,200);
            return;
        }
        this.UseDressFromWidget(typeID,propID,autoID);
    }
    else
    {
        kg.Info('此类道具无法在空间首页使用！',2000,200);
    }
}

WoStyle.prototype.UseDressFromWidget = function(typeID,propID,autoID)
{
    
        var oThis = this;
        Http.get("/widget/propdress/UsePropDress.aspx?autoID="+autoID+"&date="+escape(Date()),
            function(retext)
            {
                var restate = JSON.parse(retext);
                if(restate.IsSuccess){
                    oThis.TryProp(propID,false);
                }
                else
                {
                    alert(restate.Error);
                }
            },
            function()
            {
                alert("抱歉，道具使用失败，请重新使用。");
            }
        );
    
}

WoStyle.prototype.ShowSuit = function(propList)
{
    if(propList)
    {
        for(var i=0;i<propList.proplist.length;i++)
        {
            this.TryProp(propList.proplist[i],true);
        }
    }
}

WoStyle.prototype.TryProp = function(propID,isbuy,propValue,isUse)
{
    
        var oThis = this;
        this.GetPropPars(propID,
            function(myProp)
            {
                    var widgetValue;
                    if(!StringIsNull(myProp.Pars))
                    {
                        widgetValue = JSON.parse(myProp.Pars);
                    }
                    if(!propValue)
                    {
                        propValue = new Object();
                        propValue.autoid = 0;
                        propValue.propid = propID;
                        propValue.height = 0;
                        propValue.width = 0;
                        propValue.x = 0;
                        propValue.y = 0;
                        propValue.z = 0;
                    }
                    var isShow = oThis.ShowTryProp(myProp.TypeID,myProp.PropID,widgetValue,propValue,isUse);
                    if(isbuy && isShow)
                    {
                        oThis.buyTryList.push({"PropID":propID,"WidgetValue":widgetValue});
                    }
            },
            function()
            {
            }
        );
}
WoStyle.prototype.ShowTryProp = function(type,propID,widgetValue,propValue,isUse)
{
    var divid = "";
    switch(type)
    {
        case 11000:
            if(!isUse)
            {
                divid = this.ShowFlashMenu(widgetValue,propValue);
            }
            break;
        case 12000:
            divid = this.ShowCustomBlock(widgetValue,propValue);
            break;
        case 13000:
            if(!isUse)
            {
                divid = this.ChangeCssColor(widgetValue);
            }
            break;
        case 14000:
            divid = this.ShowCustomProp(widgetValue,propValue);
            break;
        case 15000:
            if(!isUse)
            {
                divid = this.ShowBackground(widgetValue);
            }
            break;
        case 16000:
            divid = this.ShowSuit(widgetValue);
            break;
        case 21000:
            divid = this.ShowPropFirst(widgetValue,propValue,true);
            break;
        case 22000:
            divid = this.ShowPropFirst(widgetValue,propValue,true);
            break;
        case 23000:
            divid = this.ShowPropFirst(widgetValue,propValue,true);
            break;
        case 24000:
            break;
        case 30000:
            divid = this.ShowPropFirst(widgetValue,propValue,true);
            break;
        default:
            alert("此道具不能在空间首页使用！");
            return false;
            break;
    }
    propValue.divid=divid;
    if(type>=10000&&type<20000)
    {
        if($(divid))
        {
            var divBuyProp = document.createElement("DIV");
            divBuyProp.setAttribute("id","buyprop_"+propID);
            $(divid).appendChild(divBuyProp);
        }
    }
    return true;
}
//使用用户免费装扮道具
WoStyle.prototype.UseUserDress = function(type,autoID,widgetValue)
{
    if(!this.userInfo.IsMyself)
    {
        alert('您无法直接装扮别人的狗窝，请先回到你自己的狗窝，再使用装扮道具！');
        return;
    }
    switch(type)
    {
        case 51000:
            this.ChangeBackground(widgetValue);
            break;
        case 52000:
            this.ChangeCursor(widgetValue);
            break;
        case 53000:
            this.ChangeFloatLayer(widgetValue);
            break;
        case 54000:
            this.AddAdornment(widgetValue);
            break;
        default:
            return;
            break;
    }
    Http.get("/widget/userdress/useuserdress.aspx?autoid="+autoID+"&date="+escape(Date()),
        function(retext)
        {
            //alert("成功使用！");
            alert("哇，好厉害，装扮使用成功了！");
        },
        function()
        {
            alert("抱歉，装扮使用失败，请重新使用。");
        }
    );
}
//预览用户免费装扮道具
WoStyle.prototype.ViewUserDress = function(type,autoID,widgetValue)
{
    switch(type)
    {
        case 51000:
            this.ShowBackground(widgetValue);
            break;
        case 52000:
            this.ShowCursor(widgetValue);
            break;
        case 53000:
            this.ShowFloatLayer(widgetValue);
            break;
        case 54000:
            this.ViewShowAdornment(widgetValue);
            break;
        default:
            return;
            break;
    }
}

//显示死亡类道具
WoStyle.prototype.ShowDeathProp = function(widgetValue,presentValue,istmp)
{
    var divid = "";
    if(presentValue.ID)
    {
        divid = "present_"+presentValue.ID;
    }
    else
    {
        divid = "present_tmp";
    }
    if($(divid))
    {
        $(divid).parentNode.removeChild($(divid));
    }
    if(presentValue)
    {
        if(presentValue.InputPars)
        {
            var presentPars = JSON.parse(presentValue.InputPars);
            if(presentPars.VisiterList)
            {
                for(var i=0;i<presentPars.VisiterList.length;i++)
                {
                    if(presentPars.VisiterList[i].UserID == myCheckUser.UserID)
                    {
                        return divid;
                    }
                }
            }
        }
    }
    var newDiv = document.createElement("DIV");
    
    var divStr = '<div id="'+divid+'" style="position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:7000;"><div style="background-color:#000000;width:100%;height:2000px;filter:alpha(opacity=50);-moz-opacity:0.50;opacity:0.50;padding-top:20px;"><div id="'+divid+'_content" style="position:relative;overflow:hidden;width:'+widgetValue.width+'px;height:'+(widgetValue.height+200)+'px;margin:0px auto;"></div></div></div>';
    this.blockContainer.appendChild(newDiv);
    setInnerHTML(newDiv,divStr);
    //setInnerHTML($(divid),this.GetRoadBlockPropMoveHtml(divid,widgetValue,presentValue,istmp)+$(divid).innerHTML);
    setInnerHTML($(divid+"_content"),$(divid+"_content").innerHTML+'<div style="width:100%;padding:10px 0px;font-size:18px;font-weight:bold;color:red;text-align:center;">此窝已死</div>');
    if(!StringIsNull(widgetValue.url))
    {
        var flashInPars = "";
        //flashInPars = addPostParam(flashInPars,"checkuser",JSON.stringify(this.checkUser));
        flashInPars = addPostParam(flashInPars,"userinfo",JSON.stringify(this.userInfo));
        flashInPars = addPostParam(flashInPars,"presentinfo",JSON.stringify(presentValue));
        var flashStr = this.GetFlashHtml(widgetValue.url,widgetValue.width,widgetValue.height,true,true,true,flashInPars);
        //$(divid+"_content").innerHTML = flashStr;
        setInnerHTML($(divid+"_content"),$(divid+"_content").innerHTML+flashStr);
    }
    if(!StringIsNull(widgetValue.html)&&presentValue.ID)
    {
        setInnerHTML($(divid+"_content"),$(divid+"_content").innerHTML+widgetValue.html);
    }
    var deathStr = '<div style="width:100%;padding:10px 0px;text-align:center;">';
    if(!StringIsNull(widgetValue.recovery)&&widgetValue.recovery!=0)
    {
        deathStr += '<input type="button" value="帮TA复活" onclick="myWoStyle.UseRecovery('+presentValue.ID+','+presentValue.PropID+','+widgetValue.recovery+');" style="width:60px; height:19px; background: url(\'images/vipbtn.gif\'); background-repeat: no-repeat;  border:none;color:#ffffff;"/>';
    }
    else
    {
        deathStr += '<input type="button" value="帮TA复活" onclick="myWoStyle.UseNoneRecovery('+presentValue.ID+');" style="width:60px; height:19px; background: url(\'images/vipbtn.gif\'); background-repeat: no-repeat;  border:none;color:#ffffff;"/>';
    }
    deathStr+= '<br/><span class="orange bold font14">此窝受到<a href="/wo/?id='+presentValue.Sender+'" target="_blank" class="orange2">'+presentValue.SenderName+'</a>的攻击，已经死亡！</br>复活时间：'+presentValue.EndTime+'</span></div>';
    setInnerHTML($(divid+"_content"),$(divid+"_content").innerHTML+deathStr);
    return divid;
}
WoStyle.prototype.ShowCustomProp = function(widgetValue)
{
    if($(widgetValue.divid))
    {
        $(widgetValue.divid).parentNode.removeChild($(widgetValue.divid));
    }
    var newDiv = document.createElement("DIV");
    newDiv.setAttribute("id",widgetValue.divid);
    return widgetValue.divid;
}
WoStyle.prototype.UnShowPresentTmp = function()
{
    var divid = "present_tmp";
    if($(divid))
    {
        $(divid).parentNode.removeChild($(divid));
    }
}
WoStyle.prototype.ShowPropFirst = function(widgetValue,presentValue,istmp)
{
    var divid = "";
    if(presentValue.ID)
    {
        divid = "present_"+presentValue.ID;
        if(presentValue.Priority==2)
        {
            return this.ShowRoadBlockProp(widgetValue,presentValue,istmp);
        }
        else if(presentValue.Priority==1)
        {
            return this.ShowDeathProp(widgetValue,presentValue,istmp);
        }
    }
    else
    {
        divid = "present_tmp";
    }
    if($(divid))
    {
        $(divid).parentNode.removeChild($(divid));
    }
    if(!$(divid+"_content"))
    {
        this.CreatePropStyle(divid,widgetValue.width,widgetValue.height,widgetValue.x,widgetValue.y,widgetValue.z,null);
    }
    setInnerHTML($(divid),this.GetPropMoveHtml(divid,widgetValue,presentValue,istmp)+$(divid).innerHTML);
    if(presentValue)
    {
        if(presentValue.z)
        {
            $(divid).style.zIndex = presentValue.z;
        }
        if(presentValue.InputPars)
        {
            var presentPars = JSON.parse(presentValue.InputPars);
            $(divid).style.left = presentPars.x+"px";
            $(divid).style.top = presentPars.y+"px";
        }
    }
    if(!StringIsNull(widgetValue.url))
    {
        var flashInPars = "";
        //flashInPars = addPostParam(flashInPars,"checkuser",JSON.stringify(this.checkUser));
        flashInPars = addPostParam(flashInPars,"userinfo",JSON.stringify(this.userInfo));
        flashInPars = addPostParam(flashInPars,"presentinfo",JSON.stringify(presentValue));
        
        var flashStr = this.GetFlashHtml(widgetValue.url,widgetValue.width,widgetValue.height,true,true,true,flashInPars);
        $(divid+"_content").innerHTML = flashStr;
    }
    if(!StringIsNull(widgetValue.html))
    {
        setInnerHTML($(divid+"_content"),$(divid+"_content").innerHTML+widgetValue.html);
    }
    if(istmp)
    {
        this.myTestMoveResize.AddObject({canMove:true,canResize:false,element:$(divid),handle:$(divid+"_handle"),move:$(divid+"_move")});
    }
    else
    {
        this.myPropMoveResize.AddObject({canMove:true,canResize:false,element:$(divid),handle:$(divid+"_handle"),move:$(divid+"_move")});
    }
    return divid;
}
//显示路障型道具
WoStyle.prototype.ShowRoadBlockProp = function(widgetValue,presentValue,istmp)
{
    var divid = "";
    if(presentValue.ID)
    {
        divid = "present_"+presentValue.ID;
    }
    else
    {
        divid = "present_tmp";
    }
    if($(divid))
    {
        $(divid).parentNode.removeChild($(divid));
    }
    if(presentValue)
    {
        if(presentValue.Sender==this.myCheckUser.UserID&&this.myCheckUser.UserID==this.userInfo.UserID)
        {
            return divid;
        }
        if(presentValue.InputPars)
        {
            var presentPars = JSON.parse(presentValue.InputPars);
            if(presentPars.VisiterList)
            {
                for(var i=0;i<presentPars.VisiterList.length;i++)
                {
                    if(presentPars.VisiterList[i].UserID == myCheckUser.UserID)
                    {
                        return divid;
                    }
                }
            }
        }
    }
    var newDiv = document.createElement("DIV");
    
    var divStr = '<div id="'+divid+'" style="position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:6000;"><div style="background-color:#000000;width:100%;height:2000px;filter:alpha(opacity=50);-moz-opacity:0.50;opacity:0.50;padding-top:20px;"><div id="'+divid+'_content" style="position:relative;overflow:hidden;width:'+widgetValue.width+'px;height:'+(widgetValue.height+100)+'px;margin:0px auto;"></div></div></div>';
    this.blockContainer.appendChild(newDiv);
    setInnerHTML(newDiv,divStr);
    setInnerHTML($(divid),this.GetRoadBlockPropMoveHtml(divid,widgetValue,presentValue,istmp)+$(divid).innerHTML);
    if(!StringIsNull(widgetValue.url))
    {
        var flashInPars = "";
        //flashInPars = addPostParam(flashInPars,"checkuser",JSON.stringify(this.checkUser));
        flashInPars = addPostParam(flashInPars,"userinfo",JSON.stringify(this.userInfo));
        flashInPars = addPostParam(flashInPars,"presentinfo",JSON.stringify(presentValue));
        var flashStr = this.GetFlashHtml(widgetValue.url,widgetValue.width,widgetValue.height,true,true,true,flashInPars);
        //$(divid+"_content").innerHTML = flashStr;
        setInnerHTML($(divid+"_content"),$(divid+"_content").innerHTML+flashStr);
    }
    if(!StringIsNull(widgetValue.html)&&presentValue.ID)
    {
        var varStr = '<script type="text/javascript">var myRoadBlockPresent = '+JSON.stringify(presentValue)+'</script>';
        setInnerHTML($(divid+"_content"),$(divid+"_content").innerHTML+varStr);
        setInnerHTML($(divid+"_content"),$(divid+"_content").innerHTML+widgetValue.html);
    }
    return divid;
}

WoStyle.prototype.UnShowRoadBlockProp = function(presentValue)
{
    if($('present_'+presentValue.ID))
    {
        $('present_'+presentValue.ID).style.display='none';
    }
}
WoStyle.prototype.SetPropVisit = function(autoid,message,successfun)
{
    var pars = "";
    pars = addPostParam(pars,"autoid",autoid);
    pars = addPostParam(pars,"message",message);
    Http.post('/widget/propdress/presentvisit.aspx?date='+escape(Date()),pars,
    function(retext){
        var restate = JSON.parse(retext);
        if(restate.IsSuccess){
            if(successfun)
            {
                successfun();
            }
        }else{
            alert(restate.Error);
        }
    },
    function(){
        alert("操作失败，请重试！");
    });
}

WoStyle.prototype.ShowCustomBlock = function(widgetValue,propValue)
{
    var blockInfo = this.GetBlockInfo(widgetValue.blocktypeid);
    if(blockInfo==null)
    {
        alert("没有这种版块！");return;
    }
    if($(blockInfo.divid))
    {
        $(blockInfo.divid).parentNode.removeChild($(blockInfo.divid));
    }
    var newDiv = document.createElement("DIV");
    this.blockContainer.appendChild(newDiv);
    setInnerHTML(newDiv,widgetValue.html);
    //$(blockInfo.divid).style.left = widgetValue.x+"px";
    //$(blockInfo.divid).style.top = widgetValue.y+"px";
    //$(blockInfo.divid).style.zIndex = widgetValue.z;
    if(propValue&&propValue.z>0)
    {
        $(blockInfo.divid).style.left = propValue.x+"px";
        $(blockInfo.divid).style.top = propValue.y+"px";
        $(blockInfo.divid).style.zIndex = propValue.z;
    }
    setInnerHTML($(blockInfo.divid),this.GetMoveHtml(blockInfo.divid)+$(blockInfo.divid).innerHTML);
    if($(blockInfo.divid+"_more")){
        
            setInnerHTML($(blockInfo.divid+"_more"),'<a href="javascript:myWoStyle.OpenUrl(\''+blockInfo.morelink+'?id='+this.userInfo.UserID+'\');" class="gray">更多</a>');
    }
    if($(blockInfo.divid+"_button")){
        if(this.userInfo.IsMyself&&!StringIsNull(blockInfo.actionbutton))
        {
            setInnerHTML($(blockInfo.divid+"_button"),blockInfo.actionbutton);
        }
    }
    setInnerHTML($(blockInfo.divid+"_content"),"正在下载中……");
    Http.get(blockInfo.dataurl+"?id="+this.userInfo.UserID+"&date="+escape(Date()),function(e){
        setInnerHTML($(blockInfo.divid+"_content"),e);
    },
    function(){
        setInnerHTML($(blockInfo.divid+"_content"),'<div style="width:94%;padding:2%;text-align:center;">'+"下载失败.."+'</div>');
    });
    this.AddToTempList({canMove:true,canResize:false,element:$(blockInfo.divid),handle:$(blockInfo.divid+"_handle"),move:$(blockInfo.divid+"_move")});
    return blockInfo.divid;
}

WoStyle.prototype.RefreshDefaultBlock = function(blocktypeid)
{
    var blockInfo = this.GetBlockInfo(blocktypeid);
    if(blockInfo==null)
    {
        alert("没有这种版块！");return;
    }
    if($(blockInfo.divid+"_content"))
    {
        setInnerHTML($(blockInfo.divid+"_content"),"正在下载中……");
        Http.get(blockInfo.dataurl+"?id="+this.userInfo.UserID+"&date="+escape(Date()),function(e){
            setInnerHTML($(blockInfo.divid+"_content"),e);
        },
        function(){
            setInnerHTML($(blockInfo.divid+"_content"),'<div style="width:94%;padding:2%;text-align:center;">'+"下载失败.."+'</div>');
        });
    }
}

WoStyle.prototype.GetBlockInfo = function(blocktypeid)
{
    for(var i=0;i<this.blockArr.length;i++)
    {
        if(this.blockArr[i].id == blocktypeid)
        {
            return this.blockArr[i];
        }
    }
    return null;
}

WoStyle.prototype.ChangeDefaultBlock = function(isShow,blocktypeid)
{
    if($("customblock_"+blocktypeid))
    {
        if(isShow)
        {
            $("customblock_"+blocktypeid).style.display = "block";
        }
        else
        {
            $("customblock_"+blocktypeid).style.display = "none";
        }
    }
    else
    {
        var myDefaultBlock = new Object();
        myDefaultBlock.blocktypeid = blocktypeid;
        myDefaultBlock.width = 0;
        myDefaultBlock.height = 0;
        myDefaultBlock.x = 0;
        myDefaultBlock.y = 0;
        myDefaultBlock.z = 0;
        this.CreateDefaultBlock(myDefaultBlock);
    }
}

WoStyle.prototype.SetDefaultBlock = function(widgetValue)
{
    for (var i = 0; i < this.userStyle.myDefaultBlocks.length; i++)
    {
        if (this.userStyle.myDefaultBlocks[i].blocktypeid == widgetValue.blocktypeid)
        {
            return this.userStyle.myDefaultBlocks[i];
        }
    }
    this.userStyle.myCustomBlocks.push(widgetValue);
    return this.userStyle.myDefaultBlocks[this.userStyle.myDefaultBlocks.length-1];
}

WoStyle.prototype.SetCustomProp = function(widgetValue)
{
    for (var i = 0; i < this.userStyle.myCustomProps.length; i++)
    {
        if (this.userStyle.myCustomProps[i].autoid == widgetValue.autoid)
        {
            return this.userStyle.myCustomProps[i];
        }
    }
    this.userStyle.myCustomProps.push(widgetValue);
    return this.userStyle.myCustomProps[this.userStyle.myCustomProps.length-1];
}

WoStyle.prototype.ChangeBackground = function(widgetValue)
{
    this.userStyle.myBackground = widgetValue;
    this.ShowBackground(widgetValue);
}

WoStyle.prototype.ShowBackground = function(widgetValue)
{
    var revalue = this.GetUserDressPic(widgetValue.image,2);
    if(!StringIsNull(revalue))
    {
        document.body.style.backgroundImage = "url("+revalue+")";
    }
    if(!StringIsNull(widgetValue.color))
    {
        document.body.style.backgroundColor = widgetValue.color;
    }
    if(!StringIsNull(widgetValue.repeat))
    {
        document.body.style.backgroundRepeat = widgetValue.repeat;
    }
    if(!StringIsNull(widgetValue.attachment))
    {
        document.body.style.backgroundAttachment = widgetValue.attachment;
    }
    else
    {
        document.body.style.backgroundAttachment = "fixed";
    }
    if(!StringIsNull(widgetValue.position))
    {
        document.body.style.backgroundPosition = widgetValue.position;
    }
    var divid = "backgroundbuy";
    if($(divid))
    {
        $(divid).parentNode.removeChild($(divid));
    }
    var newDiv = document.createElement("DIV");
    newDiv.setAttribute("id",divid);
    this.blockContainer.appendChild(newDiv);
    return divid;
}

WoStyle.prototype.newThis = this;
//改变CSS颜色
WoStyle.prototype.ChangeCssColor = function(widgetValue)
{
    this.userStyle.myCssColor = widgetValue;
    this.ShowCssColor(widgetValue);
}

WoStyle.prototype.ShowCssColor = function(widgetValue)
{
    var divid = "csscolor";
    if($(divid))
    {
        $(divid).parentNode.removeChild($(divid));
    }
    this.AppendCssColor(document,widgetValue);
    var newDiv = document.createElement("DIV");
    newDiv.setAttribute("id",divid);
    this.blockContainer.appendChild(newDiv);
    return divid;
}
//供Iframe内页调用
WoStyle.prototype.GetCssColorPath = function()
{
    if(!StringIsNull(this.userStyle.myCssColor.csspath))
    {
        return this.userStyle.myCssColor.csspath;
    }
    else
    {
        return null;
    }
}
//改变光标指针
WoStyle.prototype.ChangeCursor = function(widgetValue)
{
    this.userStyle.myCursor = widgetValue;
    this.ShowCursor(widgetValue);
}

WoStyle.prototype.ShowCursor = function(widgetValue)
{
    var revalue = this.GetUserDressFile(widgetValue.image);
    if(!StringIsNull(revalue))
    {
        document.body.style.cursor = "url("+revalue+"),auto";
    }
}
//改变浮层
WoStyle.prototype.ChangeFloatLayer = function(widgetValue)
{
    this.userStyle.myFloatLayer = widgetValue;
    this.ShowFloatLayer(widgetValue);
}

WoStyle.prototype.DeleteFloatLayer = function()
{
    this.userStyle.myFloatLayer = null;
    this.myFloatLayerClass.Clear();
}

WoStyle.prototype.ShowFloatLayer = function(widgetValue)
{
    var imagesArr = new Array();
    if(StringIsNull(widgetValue)||StringIsNull(widgetValue.image1))
    {
        return;
    }
    imagesArr[0] = this.GetUserDressFile(widgetValue.image1);
    imagesArr[1] = this.GetUserDressFile(widgetValue.image2);
    imagesArr[2] = this.GetUserDressFile(widgetValue.image3);
    if(this.myFloatLayerClass==null)
    {
        this.myFloatLayerClass = new FloatLayerClass();
        this.myFloatLayerClass.Init(imagesArr);
        this.myFloatLayerClass.moverain();
    }
    else
    {
        this.myFloatLayerClass.Init(imagesArr);
    }
}


WoStyle.prototype.AddAdornment = function(widgetValue)
{
    widgetValue.divid = "adornment_"+(this.userStyle.myAdornments.length);
    this.userStyle.myAdornments.push(widgetValue);
    this.ShowAdornment(widgetValue);
}
//预览
WoStyle.prototype.ViewShowAdornment = function(widgetValue)
{
    widgetValue.divid = "adornment_tmp";
    this.ShowAdornment(widgetValue);
}

WoStyle.prototype.ShowAdornment = function(widgetValue)
{
    var revalue = this.GetUserDressPic(widgetValue.image);
    this.CreateBlockStyle(widgetValue.divid,widgetValue.title,widgetValue.width,widgetValue.height,widgetValue.x,widgetValue.y,widgetValue.z,null,true);
    var imageStr = '<img src="'+revalue+'" style="width:"'+widgetValue.width+'px;height:'+widgetValue.height+'px;">';
    $(widgetValue.divid+"_content").innerHTML = imageStr;
}

WoStyle.prototype.ChangeUserBlock = function(typeid,autoid,widgetValue,isshow)
{
    if(isshow=="1")
    {
        switch(typeid)
        {
            case 61000:
                this.AddImageBlock(widgetValue);
                break;
            case 62000:
                this.AddFlashBlock(widgetValue);
                break;
            case 63000:
                this.AddVideoBlock(widgetValue);
                break;
            default:
                break;
        }
    }
    else
    {
        this.DeleteUserBlockData(widgetValue.autoid);
        if($('userblock_'+widgetValue.autoid))
        {
            $('userblock_'+widgetValue.autoid).parentNode.removeChild($('userblock_'+widgetValue.autoid));
        }
    }
}

WoStyle.prototype.DeleteUserBlockData = function(autoid)
{
    for(var i=0;i<this.userStyle.myImageBlocks.length;i++)
    {
        if(this.userStyle.myImageBlocks[i].autoid==autoid)
        {
            this.userStyle.myImageBlocks.splice(i,1);
        }
    }
    for(var i=0;i<this.userStyle.myFlashBlocks.length;i++)
    {
        if(this.userStyle.myFlashBlocks[i].autoid==autoid)
        {
            this.userStyle.myFlashBlocks.splice(i,1);
        }
    }
    for(var i=0;i<this.userStyle.myVideoBlocks.length;i++)
    {
        if(this.userStyle.myVideoBlocks[i].autoid==autoid)
        {
            this.userStyle.myVideoBlocks.splice(i,1);
        }
    }
}

WoStyle.prototype.AddImageBlock = function(widgetValue)
{
    this.userStyle.myImageBlocks.push(widgetValue);
    widgetValue.divid = "userblock_"+widgetValue.autoid;
    this.ShowImageBlock(widgetValue);
}

WoStyle.prototype.ShowImageBlock = function(widgetValue)
{
    if($(widgetValue.divid))
    {
        $(widgetValue.divid).parentNode.removeChild($(widgetValue.divid));
    }
    this.CreateBlockStyle(widgetValue.divid,widgetValue.title,widgetValue.width,widgetValue.height,widgetValue.x,widgetValue.y,widgetValue.z,null,widgetValue.blockborder==1?false:true);
    var imageStr = "";
    if(!StringIsNull(widgetValue.link))
    {
        imageStr += '<a href="'+widgetValue.link+'"';
        if(widgetValue.openmethod==1)
        {
            imageStr += ' target="_blank" ';
        }
        else
        {
            imageStr += ' target="_self" ';
        }
        imageStr += '>';
    }
    imageStr += '<img src="'+widgetValue.url+'" width="100%" height="100%">';
    if(StringIsNull(widgetValue.link))
    {
        imageStr += '</a>';
    }
    $(widgetValue.divid+"_content").innerHTML = imageStr;
}

WoStyle.prototype.AddFlashBlock = function(widgetValue)
{
    this.userStyle.myFlashBlocks.push(widgetValue);
    widgetValue.divid = "userblock_"+widgetValue.autoid;
    this.ShowFlashBlock(widgetValue);
}

WoStyle.prototype.ShowFlashBlock = function(widgetValue)
{
    if($(widgetValue.divid))
    {
        $(widgetValue.divid).parentNode.removeChild($(widgetValue.divid));
    }
    this.CreateBlockStyle(widgetValue.divid,widgetValue.title,widgetValue.width,widgetValue.height,widgetValue.x,widgetValue.y,widgetValue.z,null,widgetValue.blockborder==1?false:true);
    var flashStr = this.GetFlashHtml(widgetValue.url,"100%","100%",widgetValue.transparent,widgetValue.autoplay,widgetValue.circle);
    $(widgetValue.divid+"_content").innerHTML = flashStr;
}

WoStyle.prototype.AddVideoBlock = function(widgetValue)
{
    this.userStyle.myVideoBlocks.push(widgetValue);
    widgetValue.divid = "userblock_"+widgetValue.autoid;
    this.ShowVideoBlock(widgetValue);
}

WoStyle.prototype.ShowVideoBlock = function(widgetValue)
{
    if($(widgetValue.divid))
    {
        $(widgetValue.divid).parentNode.removeChild($(widgetValue.divid));
    }
    this.CreateBlockStyle(widgetValue.divid,widgetValue.title,widgetValue.width,widgetValue.height,widgetValue.x,widgetValue.y,widgetValue.z,null,widgetValue.blockborder==1?false:true);
    var flashStr = this.GetVideoHtml(widgetValue);
    $(widgetValue.divid+"_content").innerHTML = flashStr;
}

WoStyle.prototype.ChangeFlashMenu = function(widgetValue)
{
    this.ShowFlashMenu(widgetValue,null);
}


WoStyle.prototype.ShowFlashMenu = function(widgetValue,propValue)
{
    var divid = "flashmenu";
    if($(divid))
    {
        $(divid).parentNode.removeChild($(divid));
    }
    if(!$(divid+"_content"))
    {
        this.CreateBlockStyle(divid,"",widgetValue.width,widgetValue.height,widgetValue.x,widgetValue.y,widgetValue.z,document.body,true);
    }
    if(propValue&&propValue.z>0)
    {
        $(divid).style.left = propValue.x+"px";
        $(divid).style.top = propValue.y+"px";
        $(divid).style.zIndex = propValue.z;
    }
    var flashStr = this.GetFlashHtml(widgetValue.url,widgetValue.width,widgetValue.height,true,true,true);
    $(divid+"_content").innerHTML = flashStr;
    return divid;
}


WoStyle.prototype.GetFlashHtml = function(url,width,height,transparent,autoplay,circle,flashvars) {
	var flashStr = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="'+width+'" height="'+height+'">';
	flashStr +='<param name="movie" value="'+url+'">';
	flashStr +='<param name="quality" value="high">';
	flashStr +='<param name="menu" value="false">';
	if(!StringIsNull(flashvars))
	{
	    flashStr +='<param name="FlashVars" value="'+flashvars+'">';
	}
	if(transparent) 
	{
	    flashStr +='<param name="wmode" value="transparent">';
	}
	else
	{
	    flashStr +='<param name="wmode" value="opaque">';
	}
	flashStr +='<embed src="'+url+'" width="'+width+'" height="'+height+'"';
	if(autoplay) 
	{
	    flashStr +=' autostart="true" ';
	}
	if(circle) 
	{
	    flashStr +=' loop="true" ';
	}
	flashStr +=' quality="high" ';
	if(transparent) 
	{
	    flashStr +=' wmode="transparent" ';
	}
	else
	{
	    flashStr +=' wmode="opaque" ';
	} 
	if(!StringIsNull(flashvars))
	{
	    flashStr += ' FlashVars="'+flashvars+'"';
	}
	flashStr += ' pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>';
	flashStr +='</object>';
	return flashStr;
}

WoStyle.prototype.GetVideoHtml = function(widgetValue)
{
    var videoStr = '<OBJECT id="MediaPlayer1" height="100%" width="100%" classid=clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95>';
    videoStr +='<PARAM NAME="AutoSize" VALUE="1"><PARAM NAME="EnableContextMenu" VALUE="1"><PARAM NAME="EnableFullScreenControls" VALUE="1"><PARAM NAME="Filename" VALUE="'+widgetValue.url+'"><PARAM NAME="DisplayMode" VALUE="0"><PARAM NAME="ShowPositionControls" VALUE="1"><PARAM NAME="ShowStatusBar" VALUE="1">';
    if(widgetValue.autoplay) 
	{
	    videoStr +='<PARAM NAME="autostart" VALUE="true">';
	}
	if(widgetValue.circle) 
	{
	    videoStr +='<PARAM NAME="loop" VALUE="true">';
	}
	videoStr += '</OBJECT>';
	return videoStr;
}
WoStyle.prototype.GetMoveHtml = function(id)
{
    return '<div id="'+id+'_move" style="min-height:100%;width:100%;height:100%;_height:200px;top:0px;left:0px;position:absolute;display:none;z-index:1;"><div id="'+id+'_handle" style="width:100%;height:100%;background-color:#ffffff;filter:alpha(opacity=0);-moz-opacity:0.50;opacity:0.50;cursor:move;" onmouseover="$(\''+id+'_control\').style.display=\'block\';" onmouseout="$(\''+id+'_control\').style.display=\'none\';"><div id="'+id+'_control" style="position:absolute;width:100%;height:16px;padding:2px 0px;text-align:center;clear:both;background-color:#dddddd;margin-top:24px;display:none;cursor:default;"><a href="#" onclick="$(\''+id+'\').style.display=\'none\';return false;" class="black">隐藏</a></div></div></div>';
}
WoStyle.prototype.GetRoadBlockPropMoveHtml = function(id,widgetValue,presentValue,istmp)
{
    var reStr = '<div id="'+id+'_move" style="width:100%;height:30px;top:0px;left:0px;position:absolute;z-index:1;"><div id="'+id+'_handle" style="width:100%;height:100%;background-color:#ffffff;filter:alpha(opacity=0);-moz-opacity:0.10;opacity:0.10;"><div id="'+id+'_control" style="position:absolute;width:`200px;height:16px;padding:2px 0px;text-align:center;clear:both;right:0px;top:0px;display:block;" class="white">';
        if(!StringIsNull(presentValue.Sender))
        {
            reStr += '使用者：<a href="/wo/?id='+presentValue.Sender+'" target="_blank" class="white">'+presentValue.SenderName+'</a>&nbsp;&nbsp;';
        }
        if(!StringIsNull(widgetValue.recovery)&&widgetValue.recovery!=0)
        {
            reStr += '<a href="#" onclick="myWoStyle.UseRecovery('+presentValue.ID+','+presentValue.PropID+','+widgetValue.recovery+');"  class="white">清除</a>&nbsp;&nbsp;';
        }
        else
        {
            reStr += '<a href="#" onclick="myWoStyle.UseNoneRecovery('+presentValue.ID+');" class="white">清除</a>&nbsp;&nbsp;';
        }
    reStr += '</div></div></div>';
    return reStr;
}
WoStyle.prototype.GetPropMoveHtml = function(id,widgetValue,presentValue,istmp)
{
    var reStr = '<div id="'+id+'_move" style="width:100%;height:100%;top:0px;left:0px;position:absolute;z-index:1;"><div id="'+id+'_handle" style="width:100%;height:100%;background-color:#ffffff;filter:alpha(opacity=0);-moz-opacity:0.10;opacity:0.10;cursor:move;"><div id="'+id+'_control" style="position:absolute;width:`200px;height:16px;padding:2px 0px;text-align:center;clear:both;right:0px;top:0px;display:block;">';
        if(!StringIsNull(presentValue.Sender))
        {
            reStr += '使用者：<a href="/wo/?id='+presentValue.Sender+'" target="_blank">'+presentValue.SenderName+'</a>';
        }
        reStr += ' <a href="#" onclick="$(\''+id+'\').style.display=\'none\';return false;" >隐藏</a> ';
        if(!StringIsNull(widgetValue.recovery)&&widgetValue.recovery!=0)
        {
            reStr += '<a href="#" onclick="myWoStyle.UseRecovery('+presentValue.ID+','+presentValue.PropID+','+widgetValue.recovery+');" >清除</a>';
        }
        else
        {
            reStr += '<a href="#" onclick="myWoStyle.UseNoneRecovery('+presentValue.ID+');" >清除</a>';
        }
    reStr += '</div></div></div>';
    return reStr;
}
//清除不用防御道具的攻击
WoStyle.prototype.UseNoneRecovery = function(presentid)
{
    var urlStr = "/widget/propdress/userecovery.aspx?presentid="+presentid+"&usepropid="+0+"&";
    var oThis = this;
    Http.get(urlStr,function(retext){
        var restate = JSON.parse(retext);
        if(restate.IsSuccess)
        {
            oThis.UseRecoverySuccess(presentid);
        }
        else
        {
            kg.Alert(restate.Error,'',null,0,'确定','错误提示',true);
        }
    },function(){
        kg.Alert('清除道具失败！','',null,0,'确定','错误提示',true);
    });
}
//清除要防御道具的攻击
WoStyle.prototype.UseRecovery = function(presentid,propid,buyPropid)
{
    var urlStr = "/widget/propdress/userecovery.aspx?presentid="+presentid+"&usepropid="+buyPropid+"&";
    var oThis = this;
    var myUsePropCard = new UsePropCard(urlStr,buyPropid,1,function(){oThis.UseRecoverySuccess(presentid);});
    myUsePropCard.CheckPropCard();
}
//清除成功回调 
WoStyle.prototype.UseRecoverySuccess = function(presentid)
{
    $("present_"+presentid).style.display = "none";
}
WoStyle.prototype.CreateBlockStyle = function(id,title,width,height,x,y,z,container,hasNotLine)
{
    var newDiv = document.createElement("DIV");
    var divStr;
    if(!hasNotLine)
    {
        divStr = '<div id="'+id+'" class="Wobody" style="width:'+width+'px;height:'+(height+23)+'px;top:'+y+'px;left:'+x+'px;z-index:'+z+';position:absolute;text-align:left;"><div style="width:100%;height:100%;overflow:hidden;"><div id="'+id+'_top" class="top"><div style="width:50%;float:left;"><span class="white font14 bold sizscolor">&nbsp;&nbsp;'+title+'</span></div><div  id="'+id+'_more" style="width:60px;float:right;"></div></div><div id="'+id+'_content" class="content" style="width:100%;text-align:center;"></div></div></div>';
    }
    else
    {
        divStr = '<div id="'+id+'" style="width:'+width+'px;height:'+height+'px;top:'+y+'px;left:'+x+'px;z-index:'+z+';position:absolute;text-align:left;"><div id="'+id+'_content" style="overflow:hidden;width:100%;height:100%;"></div></div>';
    }
    
    if(container)
    {
        container.appendChild(newDiv);
    }else
    {
        this.blockContainer.appendChild(newDiv);
    }
    setInnerHTML(newDiv,divStr);
    setInnerHTML($(id),this.GetMoveHtml(id)+$(id).innerHTML);
    this.AddToTempList({canMove:true,canResize:true,element:$(id),handle:$(id+"_handle"),move:$(id+"_move")});
    return newDiv;
}
WoStyle.prototype.CreatePropStyle = function(id,width,height,x,y,z,container)
{
    var newDiv = document.createElement("DIV");
    var divStr = '<div id="'+id+'" style="width:'+width+'px;height:'+height+'px;top:'+y+'px;left:'+x+'px;z-index:'+z+';position:absolute;text-align:left;"><div id="'+id+'_content" style="overflow:hidden;width:100%;height:100%;"></div></div>';
    if(container)
    {
        container.appendChild(newDiv);
    }else
    {
        this.blockContainer.appendChild(newDiv);
    }
    setInnerHTML(newDiv,divStr);
    return newDiv;
}
WoStyle.prototype.AddToTempList = function(moveData)
{
    this.moveTempList.push(moveData);
    if(this.isOnMoveResize)
    {
        this.myBlockMoveResize.AddObject(moveData);
        if(moveData.move)
        {
            moveData.move.style.display = "block";
        }
    }
}
//开始自定义
WoStyle.prototype.StartMoveResize = function()
{
    this.OpenPage(0);
    if(!$('index_custom_menu'))
    {
        this.CreateCustomHtml();
    }
    for(var i=0;i<this.moveTempList.length;i++)
    {
        this.myBlockMoveResize.AddObject(this.moveTempList[i]);
        if(this.moveTempList[i].move)
        {
            this.moveTempList[i].move.style.display = "block";
        }
    }
    this.isOnMoveResize= true;
    $('index_custom_menu').style.display='block';
}
//开始自定义
WoStyle.prototype.EndMoveResize = function()
{
    this.myBlockMoveResize.deselect(true);
    this.myBlockMoveResize.ClearObjectList();
    for(var i=0;i<this.moveTempList.length;i++)
    {
        if(this.moveTempList[i].move)
        {
            this.moveTempList[i].move.style.display = "none";
        }
    }
    this.isOnMoveResize = false;
    $('index_custom_menu').style.display='none';
}

WoStyle.prototype.AddImage = function(widgetValue)
{
    document.body.style.cursor = "url("+widgetValue.image+")";
}


WoStyle.prototype.CreateNewBlock = function()
{
    
}

WoStyle.prototype.CreateBlog = function()
{
    
}
//创建主要内容Iframe
WoStyle.prototype.CreateMainIframe = function()
{
    this.myMainIframe = document.createElement("iframe");
    //this.myMainIframe.setAttribute("src","/user/login.aspx");
    this.myMainIframe.setAttribute("frameBorder","0");
    this.myMainIframe.setAttribute("scrolling","no");
    this.myMainIframe.setAttribute("allowTransparency","allowTransparency");
    this.myMainIframe.style.position = "absolute";
    this.myMainIframe.style.backgroundColor = "transparent";
    this.myMainIframe.style.top = "210px";
    this.myMainIframe.style.left = "50px";
    this.myMainIframe.style.width = "750px";
    this.myMainIframe.style.height = "800px";
    this.myMainIframe.style.border = "none";
    document.body.appendChild(this.myMainIframe);
    var oThis = this;
    window.setInterval(function(){oThis.CheckIframeHeight(oThis);},1000);
}

WoStyle.prototype.CheckIframeHeight = function(oThis)
{
    try
    {
        var iframeDocument = oThis.myMainIframe.contentWindow.document||oThis.myMainIframe.contentDocument;
        //alert(iframeDocument.documentElement.scrollHeight+" "+iframeDocument.body.scrollHeight+" "+iframeDocument.documentElement.clientHeight);
        var height = iframeDocument.documentElement.scrollHeight || iframeDocument.body.scrollHeight;
        if(StringIsNull(oThis.myMainIframe.style.height)||oThis.myMainIframe.style.height!=height + "px")
        {
            oThis.myMainIframe.style.height = (height+50) + "px";
        }
    }catch(e){}
}

WoStyle.prototype.SetMainIframeHeight = function()
{
    var iframeDocument = this.myMainIframe.contentWindow.document||this.myMainIframe.contentDocument;
    var height = iframeDocument.documentElement.scrollHeight || iframeDocument.body.scrollHeight;
    this.myMainIframe.style.height = height+ 50 + "px";
}

//添加CSS样式
WoStyle.prototype.AppendCssColor = function(inputDocument,widgetValue)
{
    var linkTag = inputDocument.createElement("link");
	linkTag.setAttribute("href",widgetValue.csspath);
	linkTag.setAttribute("rel","Stylesheet");
	linkTag.setAttribute("type","text/css");
    inputDocument.body.appendChild(linkTag);
}

WoStyle.prototype.OpenPage = function(pageid)
{
    var menuValue = null;
    for(var i=0;i<this.mainPages.length;i++)
    {
        if(this.mainPages[i].id==pageid)
        {
            menuValue = this.mainPages[i];
        }
    }
    if(menuValue==null)alert("没有这个栏目！");
    if(pageid==0)
    {
        this.ShowBlocks();
        if(this.myMainIframe)
        {
            this.myMainIframe.style.display = "none";
        }
        for(var i=0;i<this.blockArr.length;i++)
        {
            this.RefreshDefaultBlock(this.blockArr[i].id);
        }
        return;
    }
    this.OpenUrl(menuValue.url+"?id="+this.userInfo.UserID);
}

WoStyle.prototype.OpenUrl = function(url)
{
    if(this.myMainIframe==null){this.CreateMainIframe()};
    if(url.indexOf('?')!=-1)
        {
            url += "&";
        }
        else
        {
            url += "?";
        }
        this.UnShowBlocks();
        this.myMainIframe.setAttribute("src",url+"date="+escape(Date()));
        this.myMainIframe.style.display = "block";
}

// 获得道具图片
WoStyle.prototype.GetUserDressPic = function(fileName, type)
{
    if (StringIsNull(fileName))
    {
        return "";
    }
    else if(fileName.indexOf('200')==0)
    {
        var dateDir = this.GetDateDir(fileName);
        if (type == 1)
        {
            return this.picHost + "UserDressPic/" + "Small/" + dateDir;
        }
        else
        {
            return this.picHost + "UserDressPic/" + "Formerly/" + dateDir;
        }
    }
    return fileName;
}

// 获得道具文件
WoStyle.prototype.GetUserDressFile = function(fileName)
{
    if (StringIsNull(fileName))
    {
        return "";
    }
    else if(fileName.indexOf('200')==0)
    {
        var dateDir = this.GetDateDir(fileName);
        return this.picHost + "UserDressFile/" + "File/" + dateDir;
    }
    return fileName;
}

WoStyle.prototype.GetDateDir = function(fileName)
{
    fileName = fileName.trim();
    var year = fileName.substr(0, 4);
    var month = fileName.substr(4, 2);
    var day = fileName.substr(6, 2);
    var hour = fileName.substr(8, 2);
    var minite = fileName.substr(10, 2);
    return year + "/" + month + "/" + day + "/" + hour + "/" + minite + "/" + fileName;
}

//隐藏道具箱
WoStyle.prototype.UnShowWidget = function()
{
    $("widget_box_div").style.display = "none";
    $("widget_box_div_small").style.display = "block";
}

//显示道具箱
WoStyle.prototype.ShowWidget = function()
{
    if($('GouwoPropBtnStatistic')!=null)
{
    $('GouwoPropBtnStatistic').src='';$('GouwoPropBtnStatistic').src='http://sdn.kugoo.com/link_1265.html?url=http://www.gouwo.com/wo/images/Statistic/StatisticPropBtn.gif';
}
    if(!$("widget_box_div"))
    {
        this.CreateWidgetHtml();
        GetWidgetData('block/widget.aspx?typeid=10000');
    }
    $("widget_box_div").style.display = "block";
    $("widget_box_div_small").style.display = "none";
}

//在主要的Iframe里打开栏目页面
function openpage(pageid)
{
    if(typeof myWoStyle == "undefined")
    {
        alert("空间主对象未创建！");
    }
    else
    {
        myWoStyle.OpenPage(pageid);
    }
}
//FLASH里调用打开栏目页面
function custom_menu_swf(pageid)
{
    openpage(pageid);
}
//在主要的Iframe里打开一个URL
function openurl(url)
{
    if(typeof myWoStyle == "undefined")
    {
        alert("空间主对象未创建！");
    }
    else
    {
        myWoStyle.OpenUrl(url);
    }
}
//打开道具城首页
function OpenStore()
{

    kg.Login('/widget/default.aspx','狗窝道具城',550,527,true);
}

//打开道具城URL
function OpenStoreUrl(url)
{
    //openpage(0);
    kg.Login(url,'狗窝道具城',550,527,true);
}
//在其它狗窝打开自己狗窝的页面
function OpenMyWoPage(url)
{
    if(!this.myCheckUser.isLogin)
    {
        alert("你好,你的登录已过期,请先登录！");
        return;
    }
    var realUrl = "/wo/?id="+this.myCheckUser.UserID+"&iframeurl="+escape(url);
    if(top)
    {
        top.location.href= realUrl;
    }
    else
    {
        location.href= realUrl;
    }
}

function FloatLayerClass()
{
	this.drop = new Array(); 
	this.xx = new Array(); 
	this.yy = new Array(); 
	this.mv = new Array();
	this.imgs = null;
	this.snow = true;    // false-雨;   true-雪
	this.howmany = 10;     //雨滴多少/雪片?
	this.speed = 10;
	this.angle = 10;
	this.drops = this.howmany;
	this.isplay = true;
	var movex = -this.speed/this.angle; 
	var movey = this.speed; 
	var count = 0;
	var oThis = this;
	this.moverain = function(){
		with(oThis)
		{
			for(var move = 0; move < oThis.drops; move++){
				oThis.xx[move]+=movex;  
				oThis.yy[move]+=oThis.mv[move];
				hmm = Math.round(Math.random()*1);
				if(oThis.xx[move] < 0){
					oThis.xx[move] = oThis.maxx+10;
				}
				if(oThis.yy[move] > oThis.maxy){
					oThis.yy[move] = 10;
				}
				if(document.body)
				{
				    oThis.drop[move].style.left = oThis.xx[move]+document.body.scrollLeft;
				    oThis.drop[move].style.top = oThis.yy[move]+document.body.scrollTop;
				}
			}
		}
		if(oThis.isplay)
		{
			setTimeout(oThis.moverain,100);
		}
	};
    this.Init = function(imgs)
    {
        this.imgs = imgs;
		this.ArrayClear(this.drop);
		this.ArrayClear(this.xx);
		this.ArrayClear(this.yy);
		this.ArrayClear(this.mv);
		if($('floatLayerDiv'))
		{
		    $('floatLayerDiv').parentNode.removeChild($('floatLayerDiv'));
		}
	    var floatDiv = document.createElement("DIV");
	    floatDiv.setAttribute("id","floatLayerDiv");
	    document.body.appendChild(floatDiv);
	    for(var make = 0; make < this.drops; make++){
		    var imgDiv = document.createElement("DIV");
		    imgDiv.className = "FloatLayerItem";
		    imgDiv.innerHTML = '<img src="'+this.imgs[make%3]+'"\/>';
		    floatDiv.appendChild(imgDiv);
		    this.drop[make] = imgDiv;
		    this.maxx = document.body.clientWidth-100;
		    this.maxy = document.body.clientHeight-100;
		    this.xx[make] = Math.random()*this.maxx;
		    this.yy[make] = -10-Math.random()*this.maxy;
		    this.drop[make].style.left = this.xx[make];
		    this.drop[make].style.top = this.yy[make];
		    this.mv[make] = (Math.random()*1)+this.speed/20;
	    }
	};
	this.ArrayClear = function (arr)
	{
		while(arr.length>0)
		{
			arr.shift();
		}
	}
	this.Clear = function()
	{
	    if($('floatLayerDiv'))
		{
		    $('floatLayerDiv').parentNode.removeChild($('floatLayerDiv'));
		}
	}
}

function GetWidgetData(url)
{
    $("widget_list").innerHTML = "正在下载中……";
    Http.get(url + "&date=" + escape(Date()),
    function(e){
        $("widget_list").innerHTML = e;
    },
    function()
    {
        $("widget_list").innerHTML = "下载失败！";
    });
}

WoStyle.prototype.ShowPropMessage = function()
{
    if($('GouwoSpeakerBtnStatistic')!=null)
{
    $('GouwoSpeakerBtnStatistic').src='';$('GouwoSpeakerBtnStatistic').src='http://sdn.kugoo.com/link_1266.html?url=http://www.gouwo.com/wo/images/Statistic/StatisticSpeakerBtn.gif';
}
    if(!$("prop_message"))
    {
        this.CreatePropMessage();
    }
    $("prop_message_small").style.display = "none";
    $("prop_message").style.display = "block";
    $("prop_message_content").innerHTML = "正在下载中……";
    Http.get("block/propmessage.aspx?id"+myWoStyle.userInfo.UserID + "&date=" + escape(Date()),
    function(e){
        $("prop_message_content").innerHTML = e;
    },
    function()
    {
        $("prop_message_content").innerHTML = "下载失败！";
    });
}
WoStyle.prototype.UnShowPropMessage = function()
{
    $("prop_message_small").style.display = "block";
    $("prop_message").style.display = "none";
}

WoStyle.prototype.CreateCustomHtml = function()
{
    var customStr = '    <div id="index_custom_menu" style="width:100px;height:98px;background-color:#E59328;border:2px #D9D9D9 solid;padding:1px;position:absolute;top:400px;right:110px;display:none;z-index:3100;">\
    	<div style="position:absolute;top:47px; left:100px;border:2px #EAEAEA solid;width:100px;height:150px; background:#D7D5D5;padding:1px;">\
    		<div id="costom_more_menu">\
    			<div style="background: url(\'../Widget/images/jt_3.gif\'); position:absolute; left:-7px;top:6px; width:8px; height:9px;"></div>\
    			<a href="javascript:kg.Login(\'/widget/userdress/color.aspx\',\'换颜色\',420,370,true);">换颜色</a>\
    			<a href="javascript:kg.Login(\'/widget/userdress/background.aspx\',\'换背景\',420,142,true);">换背景</a>\
    			<a href="javascript:kg.Login(\'/widget/userdress/adornment.aspx\',\'添加装饰挂件\',420,140,true);">添加装饰挂件</a>\
    			<a href="javascript:kg.Login(\'/widget/userdress/cursor.aspx\',\'添加鼠标效果\',420,140,true);">添加鼠标效果</a>\
    			<a href="javascript:kg.Login(\'/widget/userdress/floatlayer.aspx\',\'添加飘浮效果\',420,200,true);">换飘浮效果</a>\
    			<a href="javascript:kg.Login(\'/widget/free.aspx\',\'更多装扮\',550,550,true);">更多装扮</a>\
    		</div>\
    	</div>\
    	<div style="position:absolute;top:-50px; left:100px;border:2px #EAEAEA solid;width:100px;height:88px; background:#D7D5D5;padding:1px;">\
    		<div id="costom_more_menu" style="height: 88px">\
    			<div style="background: url(\'../Widget/images/jt_3.gif\'); position:absolute; left:-7px;top:71px; width:8px; height:9px;"></div>\
    			<a href="javascript:kg.Login(\'/widget/userdress/imageblock.aspx\',\'添加图片版块\',420,300,true);">添加图片版块</a>\
    			<a href="javascript:kg.Login(\'/widget/userdress/flashblock.aspx\',\'添加Flash版块\',420,300,true);">添加Flash版块</a>\
    			<a href="javascript:kg.Login(\'/widget/userdress/videoblock.aspx\',\'添加视频版块\',420,300,true);">添加视频版块</a>\
    			<a href="javascript:kg.Login(\'/widget/userdress/musicblock.aspx\',\'添加音乐版块\',420,300,true);">添加音乐版块</a>\
    		</div>\
    	</div>\
    	<div id="index_custom_menu_move" style="background: url(\'../Widget/images/custom_bg_1.gif\') repeat-x; height:20px; width:100%; border:1px #E59328 solid; border-width:0px 0px 1px 0px;cursor:move;color:#663300;line-height:20px;text-align:center;">个性化狗窝</div>\
    	<ul id="costom_main_menu">\
    		<a href="javascript:kg.Login(\'/widget/userdress/blockmanage.aspx\',\'版块管理\',420,300,true);" style="border:1px #D9D9D9 solid; border-width:0px 0px 1px 0px;" class="black"><img src="../Widget/images/jt_2.gif" width="4" height="7" style="border:none;" /> 版块管理</a>\
    		<a href="#" class="black"><img src="../Widget/images/jt_2.gif" width="4" height="7" style="border:none;" /> 装扮狗窝</a>\
    	</ul>\
    	<div style="background-color:#ffffff;float:left;height:34px;width:100%;text-align:center;"><input type="button" value="保存自定义" onclick="myWoStyle.Save();" style="width:90px; height:29px; background: url(\'images/button_green.gif\'); background-repeat: no-repeat;  border:none; color:#336600;font-size:14px;font-weight:bold;"/></div>\
    </div>';
    var newDiv = document.createElement("DIV");
    document.body.appendChild(newDiv);
    setInnerHTML(newDiv,customStr);
}

WoStyle.prototype.CreateWidgetHtml = function()
{
    var widgetStr = '	<div id="widget_box_div">\
    <div id="widget_box_div_bg"></div>\
    <div style="position:absolute;width:16px;height:15px;top:14px; left:150px;"><img src="/images/window_bg_close.gif" width="16" height="15" onclick="myWoStyle.UnShowWidget();" style="cursor:pointer;" /></div>\
    <div id="widget_content">\
    <div id="widget_menu" style="position: relative;">\
    	<a href="javascript:GetWidgetData(\'block/widget.aspx?typeid=10000\');" style="width: 32px;">装扮</a>\
    	<a href="javascript:GetWidgetData(\'block/widget.aspx?typeid=20000\');">武器</a>\
    	<a href="javascript:GetWidgetData(\'block/widget.aspx?typeid=30000\');">礼品</a>\
    	<a href="javascript:GetWidgetData(\'block/widget.aspx?typeid=40000\');">其它</a>\
    </div>\
    <div id="widget_list">\
    </div>\
    </div>\
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="200" height="350">\
<param name="movie" value="/wo/template/widgetbox/bg.swf"/>\
<param name="quality" value="high"/>\
<param name="menu" value="false"/>\
<param name="wmode" value="transparent"/>\
<embed src="/wo/template/widgetbox/bg.swf" width="200" height="350" autostart="true" loop="true" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>\
</object>\
    </div>';
    var newDiv = document.createElement("DIV");
    document.body.appendChild(newDiv);
    setInnerHTML(newDiv,widgetStr);
}

WoStyle.prototype.CreatePropMessage = function()
{
    var propStr = '<div id="prop_message">\
    	<div style="position:absolute;width:16px;height:15px;top:42px; left:208px;"><img src="/images/window_bg_close.gif" width="16" height="15" onclick="myWoStyle.UnShowPropMessage();" style="cursor:pointer;" /></div>\
    	<div class="top_bg"></div>\
    	<div class="content_bg">\
    		<div id="prop_message_content"></div>\
    	</div>\
    	<div class="bottom_bg"></div>\
</div>';
    var newDiv = document.createElement("DIV");
    document.body.appendChild(newDiv);
    setInnerHTML(newDiv,propStr);
}