function initVideoWin() {
	vidVertPos = getAbsY(fixElement("navTable"))+getAbsHeight(fixElement("navTable"));
	if (fixElement("subNavTable")) vidVertPos += getAbsHeight(fixElement("subNavTable"));
	if (fixElement("videoDiv")) {
		setAbsX(fixElement("videoDiv"),parseInt((getUsableWidth()/2)-(getAbsWidth(fixElement("videoDiv"))/2)));
		setAbsY(fixElement("videoDiv"),vidVertPos);
	}
}
function toggleVideoWin(onOff) {
	var vis = (onOff) ? "visible" : "hidden";
	if (!vis) document.videoFrame.location = "/video_library/videoWindow.php";
	if (vis) if (fixElement("videoDiv")) setVisibility(fixElement('videoDiv'),vis);
}


// ------------------------------------------------------------------------------------
// PLAY VIDEO
// ------------------------------------------------------------------------------------
function playVideo(whichVideo, videoTitle, videoLength) {
		
	loc = "/video_library/videoWindow.php?videoFormat=FLV&videoName=" + whichVideo;
		
	if (videoTitle) loc += "&videoTitle=" + videoTitle;
	if (videoLength) loc += "&videoLength=" + videoLength;
		
	vidWinWidth = 520;
	vidWinHeight = 430;
	widthBuffer = 0;
	heightBuffer = 0;
		
	if (isMac) widthBuffer = 12;
	if (isMac) heightBuffer = 12;
		
	vidWinWidth += widthBuffer;
	vidWinHeight += heightBuffer;
		
	newWin = window.open(loc, "videoWin", "width=" + vidWinWidth + ", height=" + vidWinHeight);
	newWin.focus();
	//document.videoFrame.location = loc;
}

// ------------------------------------------------------------------------------------
// PLAY AUDIO
// ------------------------------------------------------------------------------------
function playAudio(whichAudio, audioTitle, audioDate) {
	
	// FLASH player
	if ( typeof playerStyle != "undefined" ) {
		
		loc = "/video_library/audioWindow2.php?audioName=" + whichAudio;
		
		audioWinWidth  = 520;
		audioWinHeight = 230;
	}
	
	// WINDOWS MEDIA or QUICK TIME player
	else {
		
		loc = "/video_library/audioWindow.php?audioName=" + whichAudio;
		
		audioWinWidth  = 520;
		audioWinHeight = 350;
	}
	
	if ( audioTitle ) loc += "&audioTitle=" + audioTitle;
	if ( audioDate )  loc += "&audioDate=" + audioDate;
	
	widthBuffer = 0;
	heightBuffer = 0;
	
	if ( isMac ) widthBuffer = 12;
	if ( isMac ) heightBuffer = 12;
	
	audioWinWidth  += widthBuffer;
	audioWinHeight += heightBuffer;
	
	newWin = window.open(loc, "videoWin", "width=" + audioWinWidth + ", height=" + audioWinHeight);
	newWin.focus();

}	// End playAudio() function
