var browserWinSize = new Array(2);
browserWinSize = browserWindowSize();
 
function showMVframe(frame, container, fheight, fwidth, url)
{
 browserWinSize = browserWindowSize();
 
 //vscroll = (document.all ? document.documentElement.scrollTop : window.pageYOffset);
 //hscroll = (document.all ? document.documentElement.scrollLeft : window.pageXOffset);
 vscroll = (document.all ? document.body.scrollTop : window.pageYOffset);
 hscroll = (document.all ? document.body.scrollLeft : window.pageXOffset);
 
 document.getElementById(frame).src = url;
 document.getElementById(frame).style.height = fheight + "px";
 document.getElementById(frame).style.width = fwidth + "px";
 document.getElementById(container).style.top = Math.ceil((browserWinSize[1]/2) - fheight/2 + vscroll) + "px";
 document.getElementById(container).style.left = Math.ceil((browserWinSize[0]/2) - fwidth/2 + hscroll) + "px";
 grayOut(true);
 document.getElementById(container).style.display='block';
}
 
function hideMVframe(frame, container)
{
 grayOut(false);
 document.getElementById(frame).src = '';
 document.getElementById(container).style.display='none';
}
 
function browserWindowSize()
{
 var myWidth = 0, myHeight = 0;
 if( typeof( window.innerWidth ) == 'number' )
 {
  //Non-IE
  myWidth = window.innerWidth;
  myHeight = window.innerHeight;
 }
 else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
 {
  //IE 6+ in 'standards compliant mode'
  myWidth = document.documentElement.clientWidth;
  myHeight = document.documentElement.clientHeight;
 }
 else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
 {
  //IE 4 compatible
  myWidth = document.body.clientWidth;
  myHeight = document.body.clientHeight;
 }
 
 var windowsDimensions = new Array(2);
 windowsDimensions[0] = myWidth;
 windowsDimensions[1] = myHeight;
 
 return windowsDimensions;
}
 
function grayOut(vis, options)
{
 var options = options || {};
 var zindex = options.zindex || 5000;
 var opacity = options.opacity || 75;
 var opaque = (opacity / 100);
 var bgcolor = options.bgcolor || '#000000';
 var dark=document.getElementById('darkenScreenObject');
 if (!dark)
 {
  var tbody = document.getElementsByTagName("body")[0];
  var tnode = document.createElement('div');
  tnode.style.position='absolute';
  tnode.style.top='0px';
  tnode.style.left='0px';
  tnode.style.overflow='hidden';
  tnode.style.display='none';
  tnode.id='darkenScreenObject';
  tnode.setAttribute('onclick', "hideMVframe('mv_frame', 'multimedia_view')");
  tbody.appendChild(tnode);
  dark=document.getElementById('darkenScreenObject');
 }
 if (vis)
 {
  if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) )
  {
   var pageWidth = document.body.scrollWidth+'px';
   var pageHeight = document.body.scrollHeight+'px';
  }
  else if( document.body.offsetWidth )
  {
   var pageWidth = document.body.offsetWidth+'px';
   var pageHeight = document.body.offsetHeight+'px';
  }
  else
  {
   var pageWidth='100%';
   var pageHeight='100%';
  }
  dark.style.opacity=opaque;
  dark.style.MozOpacity=opaque;
  dark.style.filter='alpha(opacity='+opacity+')';
  dark.style.zIndex=zindex;
  dark.style.backgroundColor=bgcolor;
  dark.style.width= pageWidth;
  dark.style.height= pageHeight;
  dark.style.display='block';
 }
 else
 {
  dark.style.display='none';
 }
}
