function ShowVideo(username,password,width,height,pic,id,showMsg,bkColor)
{
	var s="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0'";
   s+=" width='"+width+"' height='"+height+"' id=v"+id+">";
  s+="<param name='movie' value='NNClass.swf'>";
  s+="<param name='quality' value='high'>";
  if(bkColor)
	s+="<param name='bgColor' value='"+bkColor+"'>";
  s+="<param name='allowFullScreen' value='true'>";
  s+="<param name='FlashVars' value='UserName="+username+"&Pwd="+password+"&id="+id+"&showMsg="+showMsg+"&roomid="+v_roomid+"'>";
  s+="<embed src='NNClass.swf' allowfullscreen='true' flashvars='UserName="+username+"&Pwd="+password+"&id="+id+"&showMsg="+showMsg+"&roomid="+v_roomid+"'";
  s+="quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'"
  s+=" width='"+width+"' height='"+height+"' name='v"+id+"'></embed></object>";
  
  pic.innerHTML=s;
  
}



/////////ImgList//////////////

function ImgList(obj,callback)
{
	this.sel=-1;
	this.count=0;
	this.obj=obj;
	
	this.RemoveItem=RemoveItem;
	this.AddItem=AddItem;
	this.InsertItem=InsertItem;
	this.callback=callback;
	this.showImg=showImg;
	this.RemoveAll=RemoveAll;
	this.getItem=getItem;
}
function getItem(value)
{
	var list=this.obj;
	for(i=0;i<list.children.length;i++)
	{
		if(list.children[i].value==value)
		{
			return list.children[i];
		}
	}
	return null;
}
function showImg(value,bshow)
{
	var list=this.obj;
	for(i=0;i<list.children.length;i++)
	{
		if(list.children[i].value==value)
		{
			if(bshow)
			{
				if(bshow==2)
				{
					list.children[i].children[1].src="video2.gif";
				}
				else
					list.children[i].children[1].src="video.gif";
				list.children[i].children[1].style.visibility="visible";
				
			}
			else
				list.children[i].children[1].style.visibility="hidden";
			
			break;
		}
	}	
}
function  RemoveItem(value)
{
	var list=this.obj;
	for(i=0;i<list.children.length;i++)
	{
		if(list.children[i].value==value)
		{
			list.removeChild(list.children[i]);
			break;
		}
	}
}
function RemoveAll()
{
	this.obj.innerHTML="";
}
function AddItem(img,text,value)
{
	var s="<label class=nock onclick=\""+this.callback+"(this,0)\" ondblclick=\""+this.callback+"(this,1)\" oncontextmenu=\""+this.callback+"(this,2)\" value="+value+"><span style='width:90%'><img src="+img+" >"+text+"</span> <img src=video.gif style='visibility:hidden;'></label>";
	this.obj.innerHTML+=s;
	this.count++;
}
function InsertItem(img,text,value) //添加在前面
{
	var s="<label class=nock onclick=\""+this.callback+"(this,0)\" ondblclick=\""+this.callback+"(this,1)\" oncontextmenu=\""+this.callback+"(this,2)\" value="+value+"><span style='width:90%'><img src="+img+" >"+text+"</span> <img src=video.gif style='visibility:hidden;'></label>";
	this.obj.innerHTML=s+this.obj.innerHTML;
	this.count++;
}
function popMenu(menuDiv,width,rowControlString)

{
    //创建弹出菜单
    var pop=window.createPopup();
    //设置弹出菜单的内容
    pop.document.body.innerHTML=menuDiv.innerHTML;
    var rowObjs=pop.document.body.all[0].rows;
    //获得弹出菜单的行数
    var rowCount=rowObjs.length;
    //循环设置每行的属性
    for(var i=0;i<rowObjs.length;i++)
    {
        //如果设置该行不显示，则行数减一
        var hide=rowControlString.charAt(i)!='1';
        if(hide){
            rowCount--;
        }
        //设置是否显示该行
        rowObjs[i].style.display=(hide)?"none":"";
        //设置鼠标滑入该行时的效果
        rowObjs[i].cells[0].onmouseover=function()
        {
            this.style.background="#818181";
            this.style.color="white";
        }
        //设置鼠标滑出该行时的效果
        rowObjs[i].cells[0].onmouseout=function(){

            this.style.background="#cccccc";

            this.style.color="black";
        }
    }
    //屏蔽菜单的菜单
    pop.document.oncontextmenu=function()

    {
            return false;
    }
    //选择右键菜单的一项后，菜单隐藏
    pop.document.onclick=function()
    {
        pop.hide();
    }
    //显示菜单
    pop.show(event.clientX-1,event.clientY,width,rowCount*25,document.body);
    return true;

}
function    HtmlEncode(str)   
   {   
         var    s    =    "";   
         if    (str.length    ==    0)    return    "";   
         s    =    str.replace(/&/g,    "&gt;");   
         s    =    s.replace(/</g,        "&lt;");   
         s    =    s.replace(/>/g,        "&gt;");   
         s    =    s.replace(/    /g,        "&nbsp;");   
         s    =    s.replace(/\'/g,      "'");   
         s    =    s.replace(/\"/g,      "&quot;");   
         s    =    s.replace(/\n/g,      "<br>");   
         return    s;   
   }  