
   function WriteFlash(w,h,path)
{
   var txt;
   txt="<object classid='clsid:D27CDB6E-AE6D-11CF-96B8-444553540000' id='obj1' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'";
   txt+="border='0' width='" + w + "' height='" + h + "' VIEWASTEXT>";
   txt+="<param name='movie' value='" + path + "'>";
   txt+="<param name='quality' value='High'>";
   txt+="<embed src='" + path + "' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' name='obj1' width='" + w + "' height='" + h + "'></object>";
   document.write(txt);
}

function WriteFlash2(w,h,path)
{
   var txt;
   txt="<object classid='clsid:D27CDB6E-AE6D-11CF-96B8-444553540000' id='obj1' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'";
   txt+="border='0' width='" + w + "' height='" + h + "' VIEWASTEXT>";
   txt+="<param name='movie' value='" + path + "'>";
   txt+="<param name='quality' value='High'>";
   txt+="<PARAM NAME='wmode' VALUE='transparent'>";
   txt+="<embed src='" + path + "' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' name='obj1' width='" + w + "' height='" + h + "'></object>";
   document.write(txt);
} 
function WriteFlash3()
{
var txt='';
txt+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="Fobj1" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"'; 
txt+='width="'+ focus_width +'" height="'+ swf_height +'">';
txt+='<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="swf/focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#FFFFFF">';
txt+='<param name="menu" value="false"><param name=wmode value="opaque">';
txt+='<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">';
txt+='<embed src="swf/focus.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#FFFFFF" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
txt+='</object>';
return txt;
}
   function WriteVideo(w,h,path)
{
   var txt="";
   txt+="<OBJECT ID=\"MPlayer\" width=\"" + w + "\" height=\"" + h + "\" type=\"application/x-oleobject\"";
   txt+="CODEBASR=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701\"";
   txt+="STANDBY=\"Loading Media Player components...\" align=\"middle\"";
   txt+="CLASSID=\"CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95\">";
   txt+="<PARAM NAME=\"FileName\" VALUE=\"" + path + "\">";
   txt+="<PARAM NAME=\"AutoStart\" VALUE=\"true\">";
   txt+="<PARAM NAME=\"AnimationAtStart\" VALUE=\"true\">";
   txt+="<PARAM NAME=\"ShowControls\" VALUE=\"true\">";
   txt+="<PARAM NAME=\"ClickToPlay\" VALUE=\"true\">";
   txt+="<PARAM NAME=\"EnableContextMenu\" VALUE=\"true\">";
   txt+="</OBJECT>";
   document.write(txt);
}

function getPosition(el) {
    for (var lx = 0, ly = 0; el != null; lx += el.offsetLeft, ly += el.offsetTop, el = el.offsetParent);
    return { x: lx, y: ly }
}