var _PAGE="";
    _PAGE=""; /* Specify an actual page if you don't want to use the popup code. */

var _CONTENT=""; /* this holds the data to write if no external html file is used */

function openVideoWindow(slideshowSrc,slideshowName)
{

_CONTENT="";
_CONTENT+="<HTML>\n";
_CONTENT+="<TITLE>Video "+slideshowName+"</TITLE>\n";
_CONTENT+="<head>\n";
_CONTENT+="<"+"SCRIPT>\n";
_CONTENT+="function specialInit()\n";
_CONTENT+="{\n";
_CONTENT+="if (document.all || document.layers)\n";
_CONTENT+="}\n";
_CONTENT+="</"+"SCRIPT>\n";
_CONTENT+="<"+"script>\n";
_CONTENT+="function getRefToDivMod( divID, oDoc ) {\n";
_CONTENT+="if( !oDoc ) { oDoc = document; }\n";
_CONTENT+="if( document.layers ) {\n";
_CONTENT+="if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {\n";
_CONTENT+="for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {\n";
_CONTENT+="y = getRefToDivNest(divID,oDoc.layers[x].document); }\n";
_CONTENT+="return y; } }\n";
_CONTENT+="if( document.getElementById ) { return oDoc.getElementById(divID); }\n";
_CONTENT+="if( document.all ) { return oDoc.all[divID]; }\n";
_CONTENT+="return oDoc[divID];\n";
_CONTENT+="}\n";

_CONTENT+="function resizeWinTo( idOfDiv ) {\n";
_CONTENT+="var oH = getRefToDivMod( idOfDiv ); if( !oH ) { return false; }\n";
_CONTENT+="var x = window; x.resizeTo( screen.availWidth, screen.availWidth );\n";
_CONTENT+="var oW = oH.clip ? oH.clip.width : oH.offsetWidth;\n";
_CONTENT+="var oH = oH.clip ? oH.clip.height : oH.offsetHeight; if( !oH ) { return false; }\n";
_CONTENT+="x.resizeTo( oW + 200, oH + 200 );\n";
_CONTENT+="var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;\n";
_CONTENT+="if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }\n";
_CONTENT+="else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }\n";
_CONTENT+="else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }\n";
_CONTENT+="if( window.opera && !document.childNodes ) { myW += 16; }\n";
_CONTENT+="//second sample, as the table may have resized\n";
_CONTENT+="var oH2 = getRefToDivMod( idOfDiv );\n";
_CONTENT+="var oW2 = oH2.clip ? oH2.clip.width : oH2.offsetWidth;\n";
_CONTENT+="var oH2 = oH2.clip ? oH2.clip.height : oH2.offsetHeight;\n";
_CONTENT+="x.resizeTo( oW2 + ( ( oW + 200 ) - myW ), oH2 + ( (oH + 200 ) - myH ) );\n";
_CONTENT+="}\n";
_CONTENT+="</"+"script>\n";


_CONTENT+="</head>\n";
_CONTENT+="<BODY onLoad=resizeWinTo('mydiv');specialInit() style=padding:0;margin:0;>\n";
_CONTENT+="<"+"SCRIPT>\n";
_CONTENT+="document.write('<div style=position:absolute;left:0px;top:0px id=mydiv>');\n";
_CONTENT+="document.write('<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0 width=640 height=465>');\n";
_CONTENT+="document.write('<param name=allowScriptAccess value=sameDomain><param name=movie value=/properties/slide/index.swf><param name=quality value=high>');\n";
_CONTENT+="document.write('<param name=FlashVars value=xmlfile="+slideshowSrc+" />');\n";
_CONTENT+="document.write('<param name=base value=\".\"><embed FlashVars=xmlfile="+slideshowSrc+" base=\".\" src=/properties/slide/index.swf quality=high pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash allowScriptAccess=sameDomain type=application/x-shockwave-flash width=640 height=465></embed></object>');\n";
_CONTENT+="document.write('</div>');\n";
_CONTENT+="</"+"SCRIPT>\n";
_CONTENT+="</BODY>\n";
_CONTENT+="</HTML>\n";



  var _parms = 'directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no';
 var _windowName = "PicViewer";
  if(_PAGE)
  {
    fileName = 'popup.htm?' + escape(slideshowSrc) + '&amp;' + escape(slideshowName);
    myWindowHandle = window.open(fileName,_windowName,_parms);
  }
  else
  {
    myWindowHandle=window.open("",_windowName,_parms);
    myWindowHandle.document.open();
    myWindowHandle.document.write(_CONTENT);
    myWindowHandle.document.close();
  }
  myWindowHandle.focus();
}
