ordFlash=Math.random()*10000000000000000;
var ShockMode = 0;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if (plugin&& parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 7)
{
ShockMode = 1;
}
else if ((navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0)&& (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0))
{
document.write('<SCR' + 'IPT LANGUAGE=VBScript> \n');
document.write('on error resume next \n');
document.write('ShockMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7")))\n');
document.write('<\/SCR' + 'IPT>\n');
}

//get ad tag
_vAds = 'playad=yes';
if (typeof commercialNode == 'undefined') {
	if (typeof thisNode == 'undefined') {
	_vAd = 'video';
	}
	else _vAd = thisNode.split("/")[0];
}
else _vAd = commercialNode.split("/")[0];

closeVideo = function(openDir) {
videoObj = document.getElementById("inlineVideo");
spawnObj = document.getElementById("inlineVideoSpawner");
//hide video layer
videoObj.style.visibility = 'hidden';
videoObj.innerHTML = '';
//show video spawner
spawnObj.style.visibility = 'visible';
}
openVideo = function(openDir) {
videoObj = document.getElementById("inlineVideo");
spawnObj = document.getElementById("inlineVideoSpawner");

videoObj.style.visibility = 'visible';
videoObj.innerHTML = _vi;

spawnObj.style.visibility = 'hidden';
}

function openVideoFromPlaylist(openDir,_vDir,_vVideo,_vXml,startAt) {
_vs = 'whichMode=pop&justify=center&'+_vAds+'&mediatype=stream&postdir='+_vDir+'&postvideo='+_vVideo+'&cuesfile=none&autoplay=yes&starttime=0&endtime=0&largerver=none&image=racetorichmond&playlistxml='+_vXml+'&startFrom='+startAt+'&ordFlash='+ordFlash+'';

_vi = '<div style="position:absolute;left:'+passedDir+';background-color:#EFEFEF;width:454px;"><div style="border:1px solid #B3B3B3;padding:5px 14px 5px 13px;border-top:2px solid #08315A;"><div><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE= ID=banner WIDTH="427" HEIGHT="300"><PARAM NAME="movie" VALUE="http://media.washingtonpost.com/wp-srv/mmedia/player/player2.swf?'+_vs+'"><PARAM NAME="wmode" VALUE="opaque"><PARAM NAME="Autostart" VALUE="true"><PARAM NAME="Quality" VALUE="high"><EMBED SRC="http://media.washingtonpost.com/wp-srv/mmedia/player/player2.swf?'+_vs+'" swLiveConnect=TRUE WIDTH="427" HEIGHT="300" TYPE="application/x-shockwave-flash" PLUGINSPAGE="' + document.protocol + '//www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" QUALITY="high"></EMBED></OBJECT></div><div id="cpUnit" style="margin:7px 0 7px 0;"><div style="float:left;width:11px;padding:25px 0 0 100px;"><img src="http://media.washingtonpost.com/wp-srv/hp/img/ad_labelgrey.gif" border="0" width="11" height="17"></div><div style="float:left;width:234px;"><iframe src="http://ad.doubleclick.net/adi/wpni.video/'+_vAd+';ad=cp;sz=234x60;ptile=2;ord='+ordFlash+'?" width="234" height="60" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling=no borderCOLOR="#000000"></iframe></div></div><div style="clear:both;"></div></div></div>'

openVideo();

}

function createVideo(openDir,_vDir,_vVideo,_vXml,_vImage,_vTitle,_vAds,_vVIURL,_vCredit,cDist) {
if (ShockMode) {
dir = openDir;
if (typeof cDist == 'undefined') var cDist = 0;
if (dir == 'left') passedDir = -227 + 'px';
else if (dir == 'right') passedDir = 0 + 'px';
else if (dir == 'custom') passedDir = cDist + 'px';
else passedDir = -113 + 'px';

if(_vAds == 'playad=no') {
_vAds = 'playad=no'
document.write('<style>#cpUnit {display:none;}</style>');
}
else _vAds = 'playad=yes';


_vp = 'http://www.washingtonpost.com/wp-srv/mmedia/player/js/';
_vs = 'whichMode=pop&justify=center&'+_vAds+'&mediatype=stream&postdir='+_vDir+'&postvideo='+_vVideo+'&cuesfile=none&autoplay=yes&starttime=0&endtime=0&largerver=none&image='+_vImage+'&playlistxml='+_vXml+'&vidtitle='+_vTitle+'&fulllink='+_vVIURL+'&credit='+_vCredit+'&ordFlash='+ordFlash+'';

_vi = '<div style="position:absolute;left:'+passedDir+';background-color:#EFEFEF;width:454px;"><div style="border:1px solid #B3B3B3;padding:5px 14px 5px 13px;border-top:2px solid #08315A;"><div><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE= ID=banner WIDTH="427" HEIGHT="300"><PARAM NAME="movie" VALUE="http://media.washingtonpost.com/wp-srv/mmedia/player/player2.swf?'+_vs+'"><PARAM NAME="wmode" VALUE="opaque"><PARAM NAME="Autostart" VALUE="true"><PARAM NAME="Quality" VALUE="high"><EMBED SRC="http://media.washingtonpost.com/wp-srv/mmedia/player/player2.swf?'+_vs+'" swLiveConnect=TRUE WIDTH="427" HEIGHT="300" TYPE="application/x-shockwave-flash" PLUGINSPAGE="' + document.protocol + '//www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" QUALITY="high"></EMBED></OBJECT></div><div id="cpUnit" style="margin:7px 0 7px 0;"><div style="float:left;width:11px;padding:25px 0 0 100px;"><img src="http://media.washingtonpost.com/wp-srv/hp/img/ad_labelgrey.gif" border="0" width="11" height="17"></div><div style="float:left;width:234px;"><iframe src="http://ad.doubleclick.net/adi/wpni.video/'+_vAd+';ad=cp;sz=234x60;ptile=2;ord='+ordFlash+'?" width="234" height="60" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling=no borderCOLOR="#000000"></iframe></div></div><div style="clear:both;"></div></div></div>'

document.write('<div id="inlineVideo" style="position:absolute;z-index:100;"></div>');

document.write('<div id="inlineVideoSpawner"><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE= ID=banner WIDTH="228" HEIGHT="148"><PARAM NAME="movie" VALUE="'+_vp+'228spawner_v3.swf?'+_vs+'"><PARAM NAME="wmode" VALUE="opaque"><PARAM NAME="Autostart" VALUE="true"><PARAM NAME="Quality" VALUE="high"><EMBED SRC="'+_vp+'228spawner_v3.swf?'+_vs+'" swLiveConnect=TRUE WIDTH="228" HEIGHT="148" TYPE="application/x-shockwave-flash" PLUGINSPAGE="' + document.protocol + '//www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" QUALITY="high"></EMBED></OBJECT></div>');
}
}