<!--

///////////////////////
// OPEN VIDEO PANEL //
//////////////////////
function openVideo(v)
{
    var modalElem = document.getElementById('videopanel');
    if(modalElem != null) {
        centerElement(modalElem);
        modalElem.style.display = 'block';
        window.onresize = function() {
            centerElement(document.getElementById('divModalLayer'));
        }
    }
 var viewport = getViewportDimensions();
 document.getElementById('blackout').style.width = viewport.width+'px';
 document.getElementById('blackout').style.height = viewport.height+'px';
 document.getElementById('blackout').style.display = 'block';
 document.getElementById('videoiframe').src = v;
 if(getInternetExplorerVersion()=='6') { window.location = '#'; }
 return false;
}

///////////////////////
// OPEN VIDEO PANEL //
//////////////////////
function closeVideo()
{
 document.getElementById('blackout').style.display = 'none';
    var modalElem = document.getElementById('videopanel');
    if(modalElem != null) {
        modalElem.style.display = 'none';
        window.onresize = null;
    }
 document.getElementById('videoiframe').src = null;
 return false;
}

// GET VIEWABLE DIMENSIONS //
function getViewportDimensions()
{
    var intH = 0, intW = 0;
    
    if(self.innerHeight) {
       intH = window.innerHeight;
       intW = window.innerWidth;
    } 
    else {
        if(document.documentElement && document.documentElement.clientHeight) {
            intH = document.documentElement.clientHeight;
            intW = document.documentElement.clientWidth;
        }
        else {
            if(document.body) {
                intH = document.body.clientHeight;
                intW = document.body.clientWidth;
            }
        }
    }

    return {
        height: parseInt(intH, 10),
        width: parseInt(intW, 10)
    };
}


// CENTER ELEMENT ON SCREEN //
function centerElement(elem) {
    var viewport = getViewportDimensions();
    var left = (viewport.width == 0) ? 50 : parseInt((viewport.width - elem.offsetWidth) / 2, 10);
    var top = (viewport.height == 0) ? 50 : parseInt((viewport.height - elem.offsetHeight) / 2, 10);

    elem.style.left = (left - 337) + 'px';
    elem.style.top = (top - 214) + 'px';

    viewport = left = top = ele = null;    
}

function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}


-->
