function getElem(elemID) {
  if (document.getElementById) {return document.getElementById(elemID);}
  else if (document.all) {return document.all[elemID];}
  else if (document.layers) {return document.layers[elemID];}
  else {alert('Browser Doesn\'t Support DOM')}
 }

html = ''
+'<div id="popup" style="display:none;visibility:visible;">'
+'<div id="popupbgnd" onclick="cancelpopup();"></div>'
+'<table><tr><td>'
//+'<p id="popupclose" style="color:#EEEEEE;padding:2px 4px 4px 4px;background-color:#cc0000;position:absolute;top:10px;right:10px;cursor:hand;cursor:pointer;" onclick="cancelpopup();">close this popup</p>'
+'<div id="popupmsg" style="width:388px;position:relative;z-index:999;"></div>'
+'</td></tr></table>'
+'</div>';

document.write(html);

function openpopup(injectcode){
 getElem('popupmsg').innerHTML = '';
 getElem('popup').style.display = 'block';
 getElem('popupmsg').innerHTML = injectcode;
 }
function cancelpopup() {
 getElem('popup').style.display = 'none';
 setTimeout("getElem('popupmsg').innerHTML = ''",40);
 }

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="outslugs-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=0x006600&barColor=0x006600&barShadowColor=0xFFFFFF&subbarColor=0xffffff";

 var so = new SWFObject(flashurl, "flvPlayer", w, h, "9", "#000000");
 so.addParam("allowFullScreen", "true");
 so.write("popupmsg");

/*
 var flashvars = {};
 flashvars.videoPath = src;
 flashvars.imagePath = "../Images/Video/cc0000.gif";
 flashvars.autoStart = "true";
 flashvars.volAudio = "100";
 flashvars.newWidth = w;
 flashvars.newHeight = h;
 flashvars.disableMiddleButton = "true";
 flashvars.playSounds = "false";
 flashvars.soundBarColor = "0x006600";
 flashvars.barColor = "0x006600";
 flashvars.barShadowColor = "0xAAAAAA";
 flashvars.subbarColor = "0xFFFFFF";

 var params = {};
 params.wmode = "transparent";
 params.allowFullScreen = "true";
 params.allowScriptAccess = "sameDomain";
 
 var attributes = {};

 swfobject.embedSWF("flvPlayer.swf", "flashvideocontainer", w, h, "9.0.0", "", flashvars, params, attributes);
*/
}

//var fxpopupmsg = new Fx.Morph('popupmsg', {duration: 100, link:'cancel', transition:Fx.Transitions.Quad.easeInOut });
function setpopupposition(){
$('popup').style.top = document.body.scrollTop +'px';
//fx2.start({top:[scrpos]});
 }
