//colors: cream: #ffcc66;  green: #666600;  blue: #006666
var vcpcCREAM = "#ffcc66", vcpcGREEN = "#666600", vcpcBLUE = "#006666";

var shiftX = 0;
var droppedleftitem = 0;
var ROOT = "";
var THEMES = "4";	//number corresponding to themes in leftmenu; re-used in bottom menu
//var bottomwidths;	//filled in doinit
//var bottomwidths = new Array();

function CSGetImage(n) {if(document.images) {return ((!IsIE()&&CSBVers<5)?CSFindElement(n,0):document.images[n]);} else {return null;}}
//
CSAg = window.navigator.userAgent; CSBVers = parseInt(CSAg.charAt(CSAg.indexOf("/")+1),10);
CSIsW3CDOM = ((document.getElementById) && !(IsIE()&&CSBVers<6)) ? true : false;
function IsIE() { return CSAg.indexOf("MSIE") > 0;}
function CSIEStyl(s) { return document.all.tags("div")[s].style; }
function CSNSStyl(s) { if (CSIsW3CDOM) return document.getElementById(s).style; else return CSFindElement(s,0);  }
CSIImg=false;
function CSInitImgID() {if (!CSIImg && document.images) { for (var i=0; i<document.images.length; i++) { if (!document.images[i].id) document.images[i].id=document.images[i].name; } CSIImg = true;}}
function CSFindElement(n,ly) { if (CSBVers<4) return document[n];
	if (CSIsW3CDOM) {CSInitImgID();return(document.getElementById(n));}
	var curDoc = ly?ly.document:document; var elem = curDoc[n];
	if (!elem) {for (var i=0;i<curDoc.layers.length;i++) {elem=CSFindElement(n,curDoc.layers[i]); if (elem) return elem; }}
	return elem;
}
userAgent = window.navigator.userAgent;
browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);
mustInitImg = true;
function initImgID() {di = document.images; if (mustInitImg && di) { for (var i=0; i<di.length; i++) { if (!di[i].id) di[i].id=di[i].name; } mustInitImg = false;}}
function findElement(n,ly) {
	d = document;
	if (browserVers < 4)		return d[n];
	if ((browserVers >= 6) && (d.getElementById)) {initImgID; return(d.getElementById(n))}; 
	var cd = ly ? ly.document : d;
	var elem = cd[n];
	if (!elem) {
		for (var i=0;i<cd.layers.length;i++) {
			elem = findElement(n,cd.layers[i]);
			if (elem) return elem;
		}
	}
	return elem;
}
function changeImages() {
	d = document;
	if (d.images) {
		var img;
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			img = null;
			if (d.layers) {img = findElement(changeImages.arguments[i],0);}
			else {img = d.images[changeImages.arguments[i]];}
			if (img) {img.src = changeImages.arguments[i+1];}
		}
	}
}


function windowWidth() {
	return (document.all ? document.body.clientWidth : parseInt(window.innerWidth) );
}
function myMakeLayerEl(layer) {
	var el;
	if (IsIE()) el=document.all.tags("div")[layer];
	else if (CSBVers>=5) el=document.getElementById(layer);
	else el=CSNSStyl(layer);
	el.isIE = IsIE();
	el.layer = layer;
	return el;
}
function objWidth(obj) {
	var w;
	//alert(obj);
	if (CSIsW3CDOM) {
		//alert("CSIsW3CDOM");
		w = document.getElementById(obj).offsetWidth;
	} else if (IsIE()) {
		//alert("IsIE");
		w = document.all[obj].offsetWidth;
	} else {
		//alert("NS4");
		w = document.layers[obj].clip.width; 
	}
	//alert("objWidth = " + w);
	return (parseInt(w));
}

/*
function bottommenu() {
	//it's a one row table
	var html = "<table border='0' cellspacing='0' cellpadding='0'><tr>";
	for (var i=0; i<leftmenu.length; i+=4) {
		if (leftmenu[i] == THEMES) {	//find entry with number == THEMES
			for (var j=0; j<leftmenu[i+3].length; j+=3) {	//build the bottom menu
				html += "<td id='bottom" + j + "' bgcolor='" + vcpcBLUE + "'><img src='art/void-transp.gif' height='3'><br>";
				//split menu text at first space
				var menutext = leftmenu[i+3][j];
				var firstblank = menutext.indexOf(" ");	//first blank in menu item text
				if (firstblank != -1) {
					menutext = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + menutext.substring(0,firstblank) + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + "<br>" + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + menutext.substring(firstblank+1,menutext.length) + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" ;
				} else {
					menutext = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + menutext + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
				}
				html += "<a class='bottommenu' href='" + leftmenu[i+3][j+1] + "' onmouseover='showbottomsubmenu(" + i + "," + j + ");'><nobr>" + menutext + "&nbsp;&nbsp;&nbsp;</nobr></a><br>";
				html += "<img src='art/void-transp.gif' height='3'></td>"
			}
			html += "</tr></table>"
			//alert(html);
			return html;
		}
	}
}


function showbottomsubmenu(i,j) {
	//build the bottom hilite menu
	var html = "<table border='0' cellspacing='0' cellpadding='0'><tr>";
	for (var jj=0; jj<leftmenu[i+3].length; jj+=3) {	//build the bottom menu
		if (j != jj) {
			html += "<td id='bottom" + jj + "' bgcolor='" + vcpcBLUE + "'>";
		} else {
			html += "<td id='bottom" + j + "' bgcolor='" + vcpcCREAM + "'>;
		}
		html += "<a class='bottommenu' href='" + leftmenu[i+3][j+1] + "'>";
		html += "<img src='art/void-transp.gif' height='3'><br>";
		//split menu text at first space
		var menutext = leftmenu[i+3][jj];
		var firstblank = menutext.indexOf(" ");	//first blank in menu item text
		if (firstblank != -1) {
			menutext = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + menutext.substring(0,firstblank) + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + "<br>" + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + menutext.substring(firstblank+1,menutext.length) + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" ;
		} else {
			menutext = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + menutext + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
		}
		html += "<nobr>" + menutext + "</nobr><br>";
		html += "<img src='art/void-transp.gif' height='3'></a></td>"
	}
	html += "</tr></table>"
	widths=""; for (jj=0;jj<leftmenu[i+3].length;jj+=3) widths = widths + objWidth("bottom" + jj) + " ";
	//alert(html);
	
	//build and position the bottom submenu
	//alert("menuwidth(" + i + "," + j + ") = " + objWidth("bottom" + j) );
	if (leftmenu[i+3][j+2] != null) {
		html += "<table border='0' cellspacing='0' cellpadding='0'>";
		html += "<tr bgcolor='" + vcpcBLUE + "'>"
		var indent=0; 
		for(jj=0; jj<j; jj+=3) indent += bottomwidths[Math.floor(jj/3)];
		if (indent>0) html += "<td bgcolor='" + vcpcBLUE + "' rowspan='2'><img src='art/void-transp.gif' height='20' width='" + indent + "'></td>"
		html += "<td bgcolor='" + vcpcBLUE + "' colspan='" + leftmenu[i+3][j+2].length + "'><img src='art/void-cream.gif' height='3' width='" + bottomwidths[Math.floor(j/3)] + "'></td></tr>";
		html += "<tr>"
		for (var k=0; k<leftmenu[i+3][j+2].length;k++) {
			html += "<td id='bottomsub" + k + "' bgcolor='" + vcpcCREAM + "'><img src='art/void-transp.gif' height='3'><br>";
			html += "<a class='bottommenu' href='#'><nobr>&nbsp;&nbsp;&nbsp;" + leftmenu[i+3][j+2][k] + "&nbsp;&nbsp;&nbsp;</nobr></a><br>"
			html += "<img src='art/void-transp.gif' height='3'></td>"
		}
		html += "</tr></table>"
	}
	//alert(html);
	makemenu("bottommenuhi",html);
	//display the bottom hilite menu and the submenu if present
	CSShowHide(new Array('','bottommenuhi',SHOW));
	CSShowHide(new Array('','menucatcher',SHOW));
}
*/

//MAKE POPUP MENU LAYER for layer/div called thismenu
function makemenu(thismenu,thishtml) {
	//alert(thismenu + ":\n" + thishtml)
	if (document.all) {
		if(CSAg.indexOf("MSIE 5.0") > 0 && CSAg.indexOf("Mac") > 0) {	
			//bug in IE5.0 for Mac requires the extra space
			document.all(thismenu).innerHTML = thishtml + " ";
		} else {
			document.all(thismenu).innerHTML = thishtml;
		}
	} else if (CSIsW3CDOM) {
		document.getElementById(thismenu).innerHTML = thishtml;
	} else {
		document.layers[thismenu].document.write( thishtml );
		document.layers[thismenu].document.close();
	}
}

var HIDE = 0;
var SHOW = 1;

function doinit() {
	for (var i=0; i<leftmenu.length;i+=4) {
		makeleftdropdown(i)
		//alert("dropdown "  + leftmenu[i] );
		//CSShowHide(new Array('','leftmenupopup' + leftmenu[i],SHOW));
		//alert("dropdown "  + leftmenu[i] );
		if (leftmenu[i] == THEMES) {	//find entry with number == THEMES
			for (var j=0; j<leftmenu[i+3].length; j+=3) {	//save widths of bottom menu items
				//bottomwidths[Math.floor(j/3)] = objWidth("bottom"+j);
			}
		}
	}
	placeleftdropdowns();
}

function showleft(item) {
	if (item == droppedleftitem) return;
	if (droppedleftitem != 0) {
		CSShowHide(new Array('','leftmenupopup' + droppedleftitem,HIDE));
		CSShowHide(new Array('','leftmenuon' + droppedleftitem,HIDE));
	//	CSShowHide(new Array('','menucatcher',HIDE));
	}
	CSShowHide(new Array('','leftmenuon' + item,SHOW));
	CSShowHide(new Array('','leftmenupopup' + item,SHOW));
	CSShowHide(new Array('','menucatcher',SHOW));
	droppedleftitem = item;
}
function hideleft() {
	CSShowHide(new Array('','menucatcher',HIDE));
	for (var i=0; i<leftmenu.length;i+=4) {
		CSShowHide(new Array('','leftmenupopup' + leftmenu[i],HIDE));
		CSShowHide(new Array('','leftmenuon' + leftmenu[i],HIDE));
	}
	droppedleftitem = 0;
	//CSShowHide(new Array('','bottommenuhi',HIDE));

}

//construct left menu item dropdown menu
function makeleftdropdown(i) {
	var ncols = (document.all || CSIsW3CDOM) ? 1 : 2;	//need bullets column for rollovers if NS4
	var html = "";
	html += "<table width='250' bgcolor='" + vcpcGREEN + "' border='0' cellspacing='0' cellpadding='0'>" ;
	html += "<tr><td bgcolor='" + vcpcCREAM + "' colspan='" + ncols + "'><img src='/art/void-cream.gif' alt='' height='2' width='250' border='0'></td></tr>" ;
	for (var j=0; j<leftmenu[i+3].length; j+=3) {
		if (document.all || CSIsW3CDOM) {
			//if possible, change color of table row on rollover
			//html += "<tr><td bgcolor='" + vcpcGREEN + "'" + " onmouseover='this.style.backgroundColor=\"" + vcpcBLUE + "\";' " ;
			//html += "onmouseout='this.style.backgroundColor=\"" + vcpcGREEN + "\";' " ;
			//html += "onclick='window.location=\"" + ROOT + leftmenu[i+3][j+1] + "\"; return true;'>" ;
			//html += "<a class='leftmenupopup' href='" + ROOT + leftmenu[i+3][j+1] + "'><nobr>" + leftmenu[i+3][j] + "</nobr></a></td>" ;
			//html += "</tr>" ;
			//html += "<tr>" ;
			//html += "<td bgcolor='" + vcpcCREAM + "' colspan='" + ncols + "'><img src='/art/void.gif' alt='' height='2' width='100%' border='0'></td>" ;
			//html += "</tr>" ;
			html += "<tr>" ;
			html += "<td bgcolor='" + vcpcGREEN + "' colspan='" + ncols + "'><img src='/art/void.gif' alt='' height='3' width='100%' border='0'></td>" ;
			html += "</tr>" ;
			//alt: don't change background color, change type color by css hover
			html += "<tr><td bgcolor='" + vcpcGREEN + "' colspan='" + ncols + "'>" ;
			html += "<a class='leftmenupopup' href='" + ROOT + leftmenu[i+3][j+1] + "'><nobr>" + leftmenu[i+3][j] + "</nobr></a></td>" ;
			html += "</tr>" ;
			html += "<tr>" ;
			html += "<td bgcolor='" + vcpcGREEN + "' colspan='" + ncols + "'><img src='/art/void.gif' alt='' height='3' width='250' border='0'></td>" ;
			html += "</tr>" ;
			html += "<tr>" ;
			html += "<td bgcolor='" + vcpcCREAM + "' colspan='" + ncols + "'><img src='/art/void.gif' alt='' height='2' width='250' border='0'></td>" ;
			html += "</tr>" ;
		} else {
			//otherwise (NS4) use a bullet
			html += "<tr><td colspan='2' bgcolor='" + vcpcGREEN + "'><img src='/art/void.gif' alt='' height='2' width='100%' border='0'></td></tr>" ;
			html += "<tr>";
			html += "<td bgcolor='" + vcpcGREEN + "'><img name='bull" + i + "-" + j + "' src='/art/bullet-off.gif' width='12' height='10' border='0'></td>" ;
			html += "<td bgcolor='" + vcpcGREEN + "'><a href='" + ROOT + leftmenu[i+3][j+1] + "' " ;
			html += "onmouseover='changeImages(\"bull" + i + "-" + j + "\",\"/art/bullet-on.gif\");return true;' " ;
			html += "onmouseout='changeImages(\"bull" + i + "-" + j + "\",\"/art/bullet-off.gif\");return true;'>" ;
			html += "<span class='leftmenupopup'>" + leftmenu[i+3][j] + "</span></a></td>" ;
			html += "</tr>" ;
			html += "<tr><td colspan='2' bgcolor='" + vcpcGREEN + "'><img src='/art/void.gif' alt='' height='2' width='100%' border='0'></td></tr>" ;
			html += "<tr><td colspan='2' bgcolor='" + vcpcCREAM + "'><img src='/art/void.gif' alt='' height='2' width='100%' border='0'></td></tr>" ;
		}
	}
	//html += "<tr><td bgcolor='#ffffff' colspan='" + ncols + "'><img src='../../ktc/art/popupmenu-foot.gif' alt='' height='3' width='100%' border='0'></td></tr>" ;
	html += "</table>" ;
	//if (! (document.all || CSIsW3CDOM) ){
	//	alert( html.substr(0,250) );
	//	alert( html.substr(250,250) );
	//	alert( html.substr(500,250) );
	//}
	makemenu("leftmenupopup" + leftmenu[i],html);
}







//Move dropdown menus so they are aligned to right of items in leftnav bar
function placeleftdropdowns() {
	return;		//VCPC dropdowns are placed correctly by absolute positioning
	var leftpos = 190+shiftX;
	var toppos = 140;
	var SETLEFT = 0,SETTOP = 1;
	
	var w;
	for (var i=0; i < leftmenu.length;i+=4) { 
		//w = objWidth('menupopup' + leftmenu[i]);
		//alert(w + "; " + leftpos + "; ");
		//DLSetStyleWidth('menupopup' + leftmenu[i],w);
		//alert("Setting i=" + i + " (width " + w + ") at " + (leftpos + leftmenu[i+1] - w) );
		//CSSetStylePos('leftmenupopup' + leftmenu[i], SETLEFT, 190+shiftX);
		//leftpos += leftmenu[i+1];
	}
}
function DLSetStyleWidth(s,w) {
	if (CSIsW3CDOM)document.getElementById(s).style.width=w+"px";
	else if(IsIE())CSIEStyl(s).width=w;
	else CSNSStyl(s).clip.width=w;
}


//2004-07-29
//Show the preview window for type 1 (tour), type 2 (point of view), 0 (no video available)
//using format WMP=Windows Media Play or QT=QuickTime or None
//Storyfile is the page filename eg quayle.asp
//Storyhomeartfolder is the folder containing this page's homeart, eg /stories/quayle/homeart/
//Previewpath is the path from the root to the preview file
//If browser can't reset the inner html of teh preview window, display "Confirm" message with
//OK taking user directly to full-length video [this jump doesn't work].

function showPreviewByFormat(storytype,storyfile,storyhomeartfolder,previewpath,previewformat) {
	if (document.all || CSIsW3CDOM) {	//we're able to set the inner html of the preview window
		var leftpos,html;
		var SETLEFT = 0,SETTOP = 1;
		toppos = 135;
		switch (storytype) {
			case 1: leftpos = 190; break;
			case 2: leftpos = 394; break;
			default: leftpos = 190; break; //no video available
		}
		switch (previewformat) {
			case "WMP":
				switch (storytype) {
					case 1: 
					case 2: 
						html = '<table width="203" border="0" cellspacing="0" cellpadding="0" bgcolor="white">';
						html+= '<tr height="13">';
						html+= '<td><img src="/art/void-white.gif" alt="" height="13" width="70" border="0"></td>';
						html+= '<td><img src="/art/void-white.gif" alt="" height="13" width="133" border="0"></td>';
						html+= '</tr>';
						html+= '<tr>';
						html+= '<td colspan="2" align="center">';
						html+= '<OBJECT ID="mediaPlayer' + storytype + '"  width="160" height="160"' ;
						html+= 'CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" ';
						html+= 'CODEBASE=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 ';
						html+= 'STANDBY="Loading Microsoft Windows Media Player components..." ';
						html+= 'TYPE="application/x-oleobject"> ';
						html+= '<PARAM NAME="fileName" VALUE="' + previewpath + '">';
						html+= '<PARAM NAME="autoStart" VALUE="true">' ;
						html+= '<PARAM NAME="showControls" VALUE="true">';
						html+= '<EMBED type="application/x-mplayer2" ';
						html+= 'pluginspage ="http://www.microsoft.com/Windows/MediaPlayer/"' ;
						html+= 'src="' + previewpath + '" name="mediaPlayer' + storytype + '" ';
						html+= 'width="160"  height="160" AutoStart="true" controller="true"> ';
						html+= '</EMBED>';
						html+= '</OBJECT>';
						html+= '</td>';
						html+= '</tr>';
						
						html+= '<tr><td colspan="2">';
						html+= '<img src="' + storyhomeartfolder + 'preview-footer.gif" alt="" height="80" width="203" border="0">';
						html+= '</td></tr>';
						html+= '<tr>';
						html+= '<td><a href="#" onmouseover="changeImages(\'previewclose\',\'/nav/preview-closeon.gif\');" ';
						html+= 'onmouseout="changeImages(\'previewclose\',\'/nav/preview-close.gif\');" ';
						html+= 'onclick="makemenu(\'preview\',\'\');CSShowHide(new Array(\'\',\'preview\',' + HIDE + '));return true;">';	///mediaPlayer' + storytype + '.stop(); doesn't work on Mac
						html+= '<img src="/nav/preview-close.gif" name="previewclose" width="70" height="26" border="0" alt="Close video preview window">';
						html+= '</a></td>';
						html+= '<td><a href="/pages/story.asp?p=' + storyfile + '" ';
						html+= 'onmouseover="changeImages(\'previewgovideo\',\'/nav/preview-govideoon.gif\');" ';
						html+= 'onmouseout="changeImages(\'previewgovideo\',\'/nav/preview-govideo.gif\');" ';
						html+= 'onclick="return true;">';
						html+= '<img src="/nav/preview-govideo.gif" name="previewgovideo" width="133" height="26" border="0" alt="Play full video">';
						html+= '</a></td></tr></table>';
						break;
					default:
						//Means no video is available
						html = '<table width="203" border="0" cellspacing="0" cellpadding="0" bgcolor="white">';
						html+= '<tr><td><img src="../art/previewsorry.gif" width="203" height="244" border="0" ';
						html+= 'alt="Sorry, that video is not available at this time."></td></tr>';
						html+= '<tr><td><a href="#" onmouseover="changeImages(\'previewclosesorry\',\'/nav/preview-closeon.gif\');" ';
						html+= 'onmouseout="changeImages(\'previewclosesorry\',\'/nav/preview-close.gif\');" ';
						html+= 'onclick="CSShowHide(new Array(\'\',\'preview\',' + HIDE + '));hidetour();return true;">';
						html+= '<img src="/nav/preview-close.gif" name="previewclosesorry" width="70" height="26" border="0" alt="Close this window">';
						html+= '</a></td></tr></table>';
						break;
				}
				break;
			case "QT":
				switch (storytype) {
					case 1: 
					case 2: 
						html = '<table width="203" border="0" cellspacing="0" cellpadding="0" bgcolor="white">';
						html+= '<tr height="13">';
						html+= '<td><img src="/art/void-white.gif" alt="" height="13" width="70" border="0"></td>';
						html+= '<td><img src="/art/void-white.gif" alt="" height="13" width="133" border="0"></td>';
						html+= '</tr>';
						html+= '<tr>';
						html+= '<td colspan="2" align="center">';
						html += '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="160" height="136" >';
						html +=	'<param name="src" value="http://www.alternativefutures.bc.ca/art/movie.mov" >';
						html += '<param name="type" value="video/quicktime">';
						html += '<param name="qtsrc" value="' + previewpath + '" >';
						html += '<param name="autoplay" value="true" >';
						html += '<param name="scale" value="TOFIT" >';
						html += '<embed src="http://www.alternativefutures.bc.ca/art/movie.mov" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download" qtsrc="' + previewpath + '" width="160" height="136" scale="TOFIT" autoplay="true" controller="true" >';
						html += '</embed>';
						html += '</object>';
						html+= '</td>';
						html+= '</tr>';
						
						html+= '<tr><td colspan="2">';
						html+= '<img src="' + storyhomeartfolder + 'preview-footer.gif" alt="" height="80" width="203" border="0">';
						html+= '</td></tr>';
						html+= '<tr>';
						html+= '<td><a href="#" onmouseover="changeImages(\'previewclose\',\'/nav/preview-closeon.gif\');" ';
						html+= 'onmouseout="changeImages(\'previewclose\',\'/nav/preview-close.gif\');" ';
						html+= 'onclick="makemenu(\'preview\',\'\');CSShowHide(new Array(\'\',\'preview\',' + HIDE + '));hidetour();return true;">';
						html+= '<img src="/nav/preview-close.gif" name="previewclose" width="70" height="26" border="0" alt="Close video preview window">';
						html+= '</a></td>';
						html+= '<td><a href="/pages/story.asp?p=' + storyfile + '" ';
						html+= 'onmouseover="changeImages(\'previewgovideo\',\'/nav/preview-govideoon.gif\');" ';
						html+= 'onmouseout="changeImages(\'previewgovideo\',\'/nav/preview-govideo.gif\');" ';
						html+= 'onclick="return true;">';
						html+= '<img src="/nav/preview-govideo.gif" name="previewgovideo" width="133" height="26" border="0" alt="Play full video">';
						html+= '</a></td></tr></table>';
						break;
					default:
						//Means no video is available
						html = '<table width="203" border="0" cellspacing="0" cellpadding="0" bgcolor="white">';
						html+= '<tr><td><img src="../art/previewsorry.gif" width="203" height="244" border="0" ';
						html+= 'alt="Sorry, that video is not available at this time."></td></tr>';
						html+= '<tr><td><a href="#" onmouseover="changeImages(\'previewclosesorry\',\'/nav/preview-closeon.gif\');" ';
						html+= 'onmouseout="changeImages(\'previewclosesorry\',\'/nav/preview-close.gif\');" ';
						html+= 'onclick="CSShowHide(new Array(\'\',\'preview\',' + HIDE + '));hidetour();return true;">';
						html+= '<img src="/nav/preview-close.gif" name="previewclosesorry" width="70" height="26" border="0" alt="Close this window">';
						html+= '</a></td></tr></table>';
						break;
				}
				break;
			default:
				//Means invalid preview format was requested
				html = '<table width="203" border="0" cellspacing="0" cellpadding="0" bgcolor="white">';
				html+= '<tr><td><img src="../art/previewsorry.gif" width="203" height="244" border="0" ';
				html+= 'alt="Sorry, the video is not available in this format."></td></tr>';
				html+= '<tr><td><a href="#" onmouseover="changeImages(\'previewclosesorry\',\'/nav/preview-closeon.gif\');" ';
				html+= 'onmouseout="changeImages(\'previewclosesorry\',\'/nav/preview-close.gif\');" ';
				html+= 'onclick="CSShowHide(new Array(\'\',\'preview\',' + HIDE + '));hidetour();return true;">';
				html+= '<img src="/nav/preview-close.gif" name="previewclosesorry" width="70" height="26" border="0" alt="Close this window">';
				html+= '</a></td></tr></table>';
				break;
		}
		makemenu('preview',html);	//set the inner html
		CSSetStylePos('preview', SETLEFT, leftpos);
		CSSetStylePos('preview', SETTOP, toppos);
		CSShowHide(new Array('','preview',SHOW));

	} else {	//NS4 can't set inner html, so we can't show the preview window; here's the workaround
		if ( confirm("Sorry, we can't show the preview video in your browser.\rClick OK to go directly to the full-length video.") ) {
			window.top.location.href = "/pages/story.asp?p=" + storyfile; //doesn't work nor does window.top.location or top.window.location
		}
		alert("Going to full-length video...");	//it seems to need something here in order to make the link
	}
}
