
function embedSWF(object){
  var element=arguments[1]||document.body;
  var flash=document.createElement("embed");
  if(object.style){flash.style.cssText=object.style;delete object['style']};
  for(var key in object){flash.setAttribute(key,object[key])};
  element.appendChild(flash);
};

function create(data){
  var element=arguments[1]||document.body;
  var object=document.createElement(data.tags);
  if(/^(script|img|link)$/i.test(data.tags)){
    var func=data.callback||function(){};
    object.onload=object.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){func();this.onload=this.onreadystatechange=null;this.removeAttribute('onload');if(this.tagName=="SCRIPT"){this.parentNode.removeChild(this)};}}
  };
  for(var key in data){
    if(/^(callback|tags|style)$/i.test(key)){
        if(key=='style'){object.style.cssText=data[key]};//delete data[key];
    }else if(object.attributes[key]){
        object.setAttribute(key,data[key])
    }else{
      object[key]=data[key]
    }
  };
  element.appendChild(object);
  return object;
};

  var RightBox = document.getElementById("zdyBox");
  RightBox.style.cssText="float:right;display:inline-block;margin:3px;padding;0px;width:300px;min-height:20px;border:2px solid Gray;border-Radius:3px;";
  //RightBox.innerHTML="";


function sidebar($){
  var Item = create({tags:"div",name:"ItemBox",style:"padding;0px;margin:0px;border-Radius:3px;"},RightBox);
  var z_bt = create({tags:"div",class:"ItemTxt",innerHTML:$.title,style:"height:20px;padding:4px 0px 0px 10px;background:transparent url('static/uhome/css/style02/dh.jpg') repeat-x scroll 0px center;color:white;"},Item)
  var z_bo = create({tags:"div",class:"ItemBox",innerHTML:"",style:"width:auto;min-height:20px;border:0px;background:silver url(http://chunge188.com/images/loading3.gif) no-repeat scroll center center;"},Item)
  embedSWF({src:$.player+'?skin='+$.skins+'&image='+$.images+'&file='+$.video+'&backcolor=0xffffff&frontcolor=0x000000&lightcolor=0x000000&stretching=fill&autostart='+$.autostart+'&repeat=none&volume=100',allowfullscreen:"true",allowscriptaccess:"always",wmode:"opaque",style:'width:'+$.width+'px;height'+$.height+'px;background-color:transparent;border:1px solid #333;border-Width:1px 0px;'},z_bo);
}

if (userconfig['wpzs_video_url']!='') {
sidebar({
  title:userconfig['wpzs_video_title'], width:230, height:180,
  player:"http://www.a8tg.com/flash/JwPlayer.swf",
  skins:"http://www.a8tg.com/flash/skin/beelden.zip",
  video:userconfig['wpzs_video_url'],
  images:userconfig['wpzs_video_img']+'?'+userconfig['indexbg_time']+'&imageMogr2/thumbnail/!230x180r/gravity/center/crop/230x180/interlace/1/quality/80',
  autostart:"false"
})
}

