    var w=366;
    var h=224;
function BindVideo() {

    if (swfurl != "") {

        document.writeln("<div id='videoright' style='width:" + w + "px;height:" + h + "px;position: absolute;z-index:99999;left:0px;top:0px;background:url(/images/video_bg.jpg);overflow:hidden;'><div style='height:9px; overflow:hidden;margin-left:3px;margin-right:3px;margin-top:3px;margin-bottom:3px;text-align:right;font-size:12px;' ><div style='cursor:pointer;margin-right:3px; text-align:right;display:block;' onclick='closeDiv();' id='closediv' ><img src='/images/video_close2.gif' /></div></div><div style='margin-left:3px;margin-right:3px;margin-bottom:3px;' id='videobox'>");
        setMedia(swfurl, 360, 204);
        document.writeln("</div></div>");

        document.getElementById("videoright").style.top = document.documentElement.clientHeight - h + "px";
        document.getElementById("videoright").style.left = document.documentElement.clientWidth - w + "px";

        moveR();
    }
}

function moveR() {
    document.getElementById("videoright").style.top = document.documentElement.scrollTop + document.documentElement.clientHeight - h + "px";
    document.getElementById("videoright").style.left = document.documentElement.scrollLeft + document.documentElement.clientWidth - w + "px";
    setTimeout("moveR();", 80)
}

function closeDiv() {
    document.getElementById("videoright").style.visibility = 'hidden';
    document.getElementById("videobox").innerHTML = "";
}

function vcastrEvent(type, state, playHeadTime, loadPersent) {
    if (playHeadTime == swftime - 5) {
        //closediv.style.display = "block";
        document.getElementById("closediv").style.display = "block";
    }
}

function setMedia(sourcePath,width,height)
{
		var obj='';
		obj +='<object type="application/x-shockwave-flash" data="/flvplay/vcastr3.swf" width="' + width + '" height="' + height + '" id="vcastr3">';
		obj += '<param name="movie" value="/flvplay/vcastr3.swf"/> ';
		obj +='<param name="allowFullScreen" value="true" />';
		obj += '<param name="FlashVars" value="' + mediaXML(sourcePath) + '"/>';
		obj += '<param name="wmode" value="transparent">';
		obj += '<embed src="/flvplay/vcastr3.swf" FlashVars="' + mediaXML(sourcePath) + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>';
		obj +='</object>';
		document.write(obj);
}


function mediaXML(sourcePath)
{
    var str = '';
    str += 'xml=';
    str += '		<vcastr>';
    str += '			<channel>';
    str += '				<item>';
    str += '					<source>' + sourcePath + '</source>';
    str += '					<duration></duration>';
    str += '					<title>my title</title>';
    str += '				</item>';
    str += '			</channel>';
    str += '			<config>';
    str += '				<controlPanelMode>none</controlPanelMode>';
    str += '				<controlPanelBgColor>0x000000</controlPanelBgColor>';
    str += '				<isAutoPlay>true</isAutoPlay>';
    str += '				<isLoadBegin>true</isLoadBegin>';
    str += '				<scaleMode>showAll</scaleMode>';
    str += '			</config>';
    str += '			<plugIns>';
    str += '			  <javaScriptPlugIn>';
    str += '			    <url>/flvplay/javaScriptPlugIn.swf</url>';
    str += '			  </javaScriptPlugIn>';
    str += '				<logoPlugIn>';
    str += '					<url>/flvplay/logoPlugIn.swf</url>';
    //str+='					<logoText></logoText>';
    //	str+='					<logoTextAlpha>0.75</logoTextAlpha>';
    //	str+='					<logoTextFontSize>30</logoTextFontSize>';
    //	str+='					<logoTextLink>http://www.ruochigroup.com</logoTextLink>';
    //	str+='					<logoTextColor>0xffffff</logoTextColor>';
    //	str+='					<textMargin>20 20 auto auto</textMargin>';
    str += '				</logoPlugIn>';
    str += '			</plugIns>';
    str += '		</vcastr>';
	return str;	

}
