
<!-- 

function ClosePopupFrame()
{
    var pPopupFrame = document.getElementById("VideoPopupFrame");
    if (pPopupFrame)
    {
        document.body.removeChild(pPopupFrame);
        document.body.removeChild(document.getElementById('PopupBG'));
    }
}

function ShowVideoPopup(strVideoSrc, strTitle)     
{    
    ClosePopupFrame();
    
    document.getElementById('speaker').stop();
    
    pPopupBG = document.createElement('div');      
    pPopupBG.id = 'PopupBG';  
    pPopupBG.className = 'popupbg';                          
    pPopupBG.style.width = getDocWidth() + 'px';
    pPopupBG.style.height = getDocHeight() + 'px';
    setOpacity(pPopupBG, 5);
    pPopupBG.onclick = ClosePopupFrame;
    
    pPopupBG.innerHTML = '&nbsp'; 
                                
    document.body.appendChild(pPopupBG);

    pPopupFrame = document.createElement('DIV');    
    pPopupFrame.id = 'VideoPopupFrame';
    pPopupFrame.className = 'gallerypopup';       

    videoHTML = '<div style="width:640px;"><div style="float:left; text-align:left; padding:5px; color:#009900; font-weight:bold; width:500px;">'+strTitle+'</div><div style="float:right;"><img src="'+strRootPath+'images/close_over.gif" onclick="ClosePopupFrame();" style="padding:2px; cursor:pointer;" ></div><div class="clearboth"></div></div>';
    videoHTML += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="VideoPlayer" width="640" height="480">';
    videoHTML += '<param name="allowScriptAccess" value="sameDomain" />';
    videoHTML += '<param name="movie" value="'+strRootPath+'flash/player.swf" />';
    videoHTML += '<param name="flashvars" value="file='+strRootPath+'video/'+strVideoSrc+'&amp;id=VideoPlayer&amp;autostart=true&amp;enablejs=true&amp;javascriptid=VideoPlayer" />';
    videoHTML += '<param name="quality" value="high" />';

    videoHTML += '<param name="bgcolor" value="#000000" />';
    videoHTML += '<param name="wmode" value="transparent" />';
    videoHTML += '<param name="allowfullscreen" value="true" />';
    videoHTML += '<embed src="'+strRootPath+'flash/player.swf" flashvars="file='+strRootPath+'video/'+strVideoSrc+'&amp;id=VideoPlayer&amp;autostart=true&amp;enablejs=true&amp;javascriptid=VideoPlayer" wmode="transparent" quality="high" allowfullscreen="true" bgcolor="#000000" name="VideoPlayer" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="640" height="480" />';
    videoHTML += '</object>';

    pPopupFrame.innerHTML = videoHTML;         
     
    document.body.appendChild(pPopupFrame); 
    
    var x = (getFrameWidth() / 2) - (640 / 2) + getScrollX();
    var y = (getFrameHeight() / 2) - (480 / 2) + getScrollY(); 
    
    if(y < 50) y = 50;  
              
    pPopupFrame.style.top = y + 'px';
    pPopupFrame.style.left = x + 'px';  
}

function getDocWidth() 
{
    return Math.max(
        Math.max(document.body.scrollWidth, document.documentElement.scrollWidth),
        Math.max(document.body.offsetWidth, document.documentElement.offsetWidth),
        Math.max(document.body.clientWidth, document.documentElement.clientWidth)
    );
}

function getDocHeight() 
{
    return Math.max(
        Math.max(document.body.scrollHeight, document.documentElement.scrollHeight),
        Math.max(document.body.offsetHeight, document.documentElement.offsetHeight),
        Math.max(document.body.clientHeight, document.documentElement.clientHeight)
    );
}

function setOpacity(pObject, nValue) 
{
    pObject.style.opacity = nValue/10;
    pObject.style.filter = 'alpha(opacity=' + nValue*10 + ')';
}


function getFrameWidth()
{
    var frameWidth = 0;
    if (self.innerWidth)
    {
        frameWidth = self.innerWidth;
    }
    else if (document.documentElement && document.documentElement.clientWidth)
    {
        frameWidth = document.documentElement.clientWidth;
    }
    else if (document.body)
    {
        frameWidth = document.body.clientWidth;
    }
    return frameWidth;
}

function getFrameHeight()
{
    var frameHeight = 0;
    if (self.innerHeight)
    {
        frameHeight = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight)
    {
        frameHeight = document.documentElement.clientHeight;
    }
    else if (document.body)
    {
        frameHeight = document.body.clientHeight;
    }
    return frameHeight;
}

function getScrollY() 
{
    var scrOfY = 0;
    if( typeof( window.pageYOffset ) == 'number' ) 
    {
        // Netscape compliant
        scrOfY = window.pageYOffset;
    } 
    else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 
    {
        // DOM compliant
        scrOfY = document.body.scrollTop;
    } 
    else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 
    {
        // IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
    }
    return scrOfY;
}

function getScrollX() 
{
    var scrOfX = 0;
    if( typeof( window.pageYOffset ) == 'number' ) 
    {
        // Netscape compliant
        scrOfX = window.pageXOffset;
    } 
    else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 
    {
        // DOM compliant
        scrOfX = document.body.scrollLeft;
    } 
    else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 
    {
        // IE6 standards compliant mode
        scrOfX = document.documentElement.scrollLeft;
    }
    return scrOfX;
}

   
// -->
