html = ''
+'<div id="popup" style="visibility:visible;display:none;top:0px;">'
+'<div id="popupbgnd" onclick="cancelpopup();"></div>'
+'<table><tr><td>'
+'<div id="popupmsg"></div>'
+'</td></tr></table>'
+'</div>';
document.write(html);

function openpopup(injectcode){
 getElem('popup').style.display = 'block';
 //setStyle('popup','opacity',1);
 if(typeof injectcode != 'undefined'){
  getElem('popupmsg').innerHTML = '';
  getElem('popupmsg').innerHTML = injectcode;
  }
 }
function openpopuptimer(injectcode){
 //openpopup(injectcode);
 //setTimeout("fadeout('popup')",1000);
 setTimeout("closepopup()",500);
 }
function cancelpopup() {
 getElem('popup').style.display = 'none';
 getElem('popupmsg').innerHTML = '';
 }
closepopup =  cancelpopup;

function hideselectboxes() {
 var dropdowns = $$('select');
 dropdowns.each(function(el,i){
  el.style.visibility = 'hidden';
  });
 }
function showselectboxes() {
 var dropdowns = $$('select');
 dropdowns.each(function(el,i){
  el.style.visibility = 'visible';
  });
 }
function getscrollY(){
 var ScrollTop = document.body.scrollTop;
 if (ScrollTop == 0){
  if (window.pageYOffset)
   ScrollTop = window.pageYOffset;
  else
   ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
  }
 return ScrollTop;
 }
function setpopupposition(){
 document.getElementById('popup').style.top = getscrollY();
 /*Requires MooTools 1.2
 $('popup').setStyles({'top':[getScrollTop()]});
 */
 }
function openvideo(src,w,h){

 openpopup('<div id="flashvideocontainer" style="text-align:center;"><a href="http://www.adobe.com/products/flashplayer/" target="_new" id="noflashbanner"><img src="../Images/Video/118tvads-noflash.png" style="margin:40px 0px;" /></a></div>');
 getElem("popupmsg").style.width = w+'px';

/*
 flashurl = "../flvPlayer.swf?videoPath="+src+"&autoStart=true&volAudio=100&newWidth="+w+"&newHeight="+h+"&disableMiddleButton=false&playSounds=false&soundBarColor=0xCC0000&barColor=0xCC0000&barShadowColor=0xFFFFFF&subbarColor=0xffffff";

 var so = new SWFObject(flashurl, "118flvPlayer", w, h, "9", "#000000");
 so.addParam("allowFullScreen", "true");
 so.write("popupmsg");
*/
 
 embedflv("flashvideocontainer",src,w,h);
 
 }
function embedflv(dest,src,w,h){

 var flashvars = {};
 flashvars.videoPath = src;
 flashvars.imagePath = "../gfx/cc0000.gif";
 flashvars.autoStart = "true";
 flashvars.volAudio = "100";
 flashvars.newWidth = w;
 flashvars.newHeight = h;
 flashvars.disableMiddleButton = "true";
 flashvars.playSounds = "false";
 flashvars.soundBarColor = "0x666666";
 flashvars.barColor = "0x666666";
 flashvars.barShadowColor = "0xAAAAAA";
 flashvars.subbarColor = "0xFFFFFF";

 var params = {};
 params.wmode = "transparent";
 params.allowFullScreen = "true";
 params.allowScriptAccess = "sameDomain";
 
 var attributes = {};

 swfobject.embedSWF("../flvPlayer.swf", dest, w, h, "9.0.0", "", flashvars, params, attributes);
 
 }
function embedswf(dest,src,w,h){

 var flashvars = {};

 var params = {};
 params.wmode = "transparent";
 params.allowScriptAccess = "sameDomain";
 
 var attributes = {};

 swfobject.embedSWF(src, dest, w, h, "9.0.0", "", flashvars, params, attributes);
 
 }
/*#########################################################################*/
/*
<div id="popup" style="visibility:visible;display:none;top:0px;">
<div id="popupbgnd" onclick="cancelpopup();"></div>
<table><tr><td>
<div id="popupmsg">$embeddedvideos<div id="popupmsghtml"></div></div>
</td></tr></table>
</div>
*/
function cancelpopupvid() {
 getElem('popup').style.display = 'none';

 var arrayElem = getElem('popupmsg').childNodes;
 for(var i=0; i<arrayElem.length;i++) {
  if(arrayElem[i].className=='popupvideo') {
   arrayElem[i].style.display='none';
   var arrayElem2 = arrayElem[i].childNodes;
   for(var j=0; j<arrayElem2.length;j++) {
    if(arrayElem2[j].className=='video') {
     var arrayElem3 = arrayElem[j].childNodes;
     for(var k=0; k<arrayElem3.length;k++) {
      //arrayElem3[k].Stop();
      var qtvid = arrayElem3[k].id;
      document.getElementById(qtvid).Stop();//document.embeds[qtvid].Stop();
     }
    }
   }
   //document.movie1.Stop();document.embeds['movie1'].Stop();
  }
 }
 //showselectboxes();
 }
function insertMov(movpath, movwidth, movheight, uniplayer){
  var theMov = QT_GenerateOBJECTText_XHTML(movpath, movwidth, movheight, '','scale','tofit');
  var masterPlayer = document.getElementById(uniplayer);
  masterPlayer.removeChild(masterPlayer.firstChild);
  masterPlayer.innerHTML=theMov;
 }
