// class for Quick Time player                      classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
// class Windows Media Player 7 wmplayer.exe        classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6'
// class for Windows Media Player 6  mplayer2.exe   classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"

var LoadQT = false;
var loadWMP7 = false;
var loadRP = false;
var loadother = false;
var WMP7= false;
var vTop =(screen.availHeight-400)/2;
var vLeft=(screen.availWidth-400)/2;
var aTop =(screen.availHeight-200)/2;
var aLeft=(screen.availWidth-400)/2;
    if (haveqt)
	{
	LoadQT = true;
	}
    else
	{
	//make Media Player Video Window file param vfile
	if ( navigator.appName != "Netscape" ){
	     WMP7 = new ActiveXObject('WMPlayer.OCX');
	}
	// Windows Media Player 7 Code
	if (WMP7)
	{
	var loadWMP7 = true;
	}
	else
	   {
		if (confirm('Your browser does not have the recomended versions of\n'+
			'Plugins or ActiveX controls loaded for the Video media on our site\n'+
			'We recomend use of Quick Time or Windows Media Player, please\n'+
			'read the Media Format Help on our Help-About Us page\n'+ 
			'The media format on this site uses:-\n'+
			'      mp3 -- Audio files\n'+
			'      mpg -- Video files\n'+
			'You may have earlier versions loaded or alternative media software,\n'+
			'which may produce unpredictable results.\n'+
			'Click OK to loading your media or Cancel to Quit\n'+
			'Do you want to continue loading?')) 
		{
		loadother = true; alert("loadother");
	      }
	   }
	}

function makevideoWindow(vfile) {
// LoadQT = false;
// loadWMP7 = true;
// loadRP = false;
// loadother = false;

    if (LoadQT)
	{
	//make Quick Time Video Window file param vfile
	var content = '<html><head><title>Video Clip</title></head>\n';
	content += '<body background="back_vid.jpg">\n';
	content +='<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="320" height="262">\n';
	content +='<param name="SRC" value="images/movies/'+vfile+'">\n';
	content +='<param name="autoplay" value="true">\n';
	content +='<param name="controller" value="true">\n';
	content +='<embed src="images/movies/'+vfile+'" pluginspage="http://www.apple.com/quicktime/download" width="320" height="262" autoplay="true" controller="true">\n';
	content +='</embed>\n';
	content +='</object>\n';
	content += '</body>\n</html>';
	videoWindow = window.open("","video","top=" + vTop + ",left=" + vLeft+",resizable=0,height=309,width=356");
	videoWindow.opener = window;
	videoWindow.document.write(content);
	videoWindow.document.close();
	videoWindow.focus();
	}
    
// Windows Media Player 7 Code
	else if ( loadWMP7 )
	{
	var content = '<html><head><title>Video Clip</title></head>\n';
	content += '<body background="back_vid.jpg">\n';
	content +='<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="Player" width="364" height="346" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft® Windows® Media Player components...">\n';
	content +='<param name="url" value="video/'+vfile+'">\n';
	content +='<param name="AutoStart" value="true">\n';
	content +='<param name="ShowControls" value="1">\n';
	content +='<embed src="images/movies/'+vfile+'" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" width="364" height="346" autoplay="true" controller="true">\n';
//the WMP MS netscape plugins download but dont get loaded into either NN4.7 or  NS6.2 (NN4.7 does but needs a reboot!) so point them at QT
//	content +='<embed src="images/movies/'+vfile+'" pluginspage="http://www.apple.com/quicktime/download" width="364" height="346" autoplay="true" controller="true">\n';
	content +='</embed>\n';
	content +='</object>\n';
	content += '</body>\n</html>';
	videoWindow = window.open("","video","top=" + vTop + ",left=" + vLeft+",resizable=0,height=400,width=400");
	videoWindow.opener = window;
	videoWindow.document.write(content);
	videoWindow.document.close();
	videoWindow.focus();
	}
// Real Player Code
	else if (loadRP)
	{
	var content = '<html><head><title>Video Clip</title></head>\n';
	content += '<body background="back_vid.jpg">\n';
	content +='<OBJECT ID="video" CLASSID="CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" ALIGN="baseline" width="320" height="262" BORDER="0">\n';
	content +='<param name="src" value="video/'+vfile+'">\n';
	content +='<param name="backgroundcolor" value="#000000">\n';
	content +='<param name="controls" value="imagewindow">\n';
	content +='<param name="console" value="badger">\n';
	content +='<param name="autostart" value="true">\n';
	content +='<param name="nolabels" value="0">\n';
	content +='<param name="nologo" value="true">\n';
	content +='<embed src="images/movies/'+vfile+'" name="video" align="baseline" border=0 width="320" height="262" controls="imagewindow" console="table" autostart="true" type="audio/x-pn-realaudio-plugin" nojava="true" backgroundcolor="#000000" nologo="true" value="true"></object>\n';
// embedded player controls 
	content +='<object id="realvideo" classid="clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa" align="baseline" width="176" height="20" border="0">\n';
	content +='<param name="src" value="video/'+vfile+'">\n';
	content +='<param name="controls" value="controlpanel">\n';
	content +='<param name="console" value="table">\n';
	content +='<embed src="images/movies/'+vfile+'" width="176" height="20" nojava="true" controls="controlpanel" console="grand1" type="audio/x-pn-realaudio-plugin"></object>\n';
	content += '</body>\n</html>';
	videoWindow = window.open("","video","top=" + vTop + ",left=" + vLeft+",resizable=0,height=190,width=200");
	videoWindow.opener = window;
	videoWindow.document.write(content);
	videoWindow.document.close();
	videoWindow.focus();
	}
// Dont Know what they've got just embed
	else if (loadother) {

		var content = '<html><head><title>Video Clip</title></head>\n';
		content += '<body background="images/back_vid.jpg">\n';
		content +='<embed src="images/movies/'+vfile+'" pluginspage="http://www.apple.com/quicktime/download" width="176" height="150" autoplay="true" controller="true">\n';
		content +='</embed>\n';
		content += '</body>\n</html>';
		videoWindow = window.open("","video","top=" + vTop + ",left=" + vLeft+",resizable=0,height=190,width=200");
		videoWindow.opener = window;
		videoWindow.document.write(content);
		videoWindow.document.close();
		videoWindow.focus();
	      }
	     else
	      {
	      return;
	      }
	   
}


function makeaudiocontrol(afile) {
//  LoadQT = false;
//  loadWMP7 = false;
//  loadRP = false;
//  loadother = true;
    if (LoadQT)
	{
	//make Quick Time Audio Window file param vfile
	var content = '<html><head><title>Quick Time Audio</title></head>\n';
	content += '<body background="back_aud.jpg"><br>\n';
	content +='<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab" width="195" height="25">\n';
	content +='<param name="src" value="audio/'+afile+'">\n';
	content +='<param name="autoplay" value="true">\n';
	content +='<param name="controller" value="true">\n';
	content +='<embed src="audio/'+afile+'" pluginspage="http://www.apple.com/quicktime/download" width="180" height="16" autoplay="true" controller="true">\n';
	content +='</embed>\n';
	content +='</object>\n';
	content +='</body>\n</html>';
	audioWindow = window.open("","audio","top=" + aTop + ",left=" + aLeft+",resizable=0,height=100,width=200");
	audioWindow.opener = window;
	audioWindow.document.write(content);
	audioWindow.document.close();
	audioWindow.focus();
	}
    else if (loadWMP7)
	{
	//make Media Player Audio Window file param vfile
	var content ='<html><head><title>WMP7 Audio</title></head>\n';
	content +='<body background="back_aud.jpg"><br>\n';
	content +='<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="Player" width="180" height="60" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft® Windows® Media Player components...">\n';
	content +='<param name="url" value="audio/'+afile+'">\n';
	content +='<param name="AutoStart" value="1">\n';
	content +='<param name="uiMode" value="full">\n';
//the WMP MS netscape plugin downloads but get loaded into either NN4.7 or  NS6.2 so point them at QT
//	content +='<embed src="audio/'+afile+'" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" width="180" height="60" AutoStart="true" ShowControls="true">\n';
	content +='<embed src="audio/'+afile+'" pluginspage="http://www.apple.com/quicktime/download" width="180" height="25" autoplay="true" controller="true">\n';
	content +='</embed>\n';
	content +='</object>\n';
	content +='</body>\n</html>';
	audioWindow = window.open("","audio","top=" + aTop + ",left=" + aLeft+",resizable=0,height=100,width=200");
	audioWindow.opener = window;
	audioWindow.document.write(content);
	audioWindow.document.close();
	audioWindow.focus();
	}
	else if (loadRP)
	{
	var content ='<html><head><title>Real Audio Clip</title></head>\n';
	content +='<body background="back_aud.jpg"><br>\n';
	content +='<object id="realvideo" classid="clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa" align="baseline" width="176" height="20" border="0">\n';
	content +='<param name="src" value="audio/'+afile+'">\n';
	content +='<param name="controls" value="controlpanel">\n';
	content +='<param name="console" value="table">\n';
	content +='<param name="autostart" value="true">\n';
	content +='<embed src="audio/'+afile+'" width="180" height="20" nojava="true" controls="controlpanel" console="grand1" type="audio/x-pn-realaudio-plugin"></object>\n';
	content +='</body>\n</html>';
	videoWindow = window.open("","video","top=" + vTop + ",left=" + vLeft+",resizable=0,height=100,width=200");
	videoWindow.opener = window;
	videoWindow.document.write(content);
	videoWindow.document.close();
	videoWindow.focus();
	}
	else if (loadother) {
	var content ='<html><head><title>Other Audio</title></head>\n';
	content +='<body background="back_aud.jpg"><br>\n';
	content +='<embed src="audio/'+afile+'" pluginspage="http://www.apple.com/quicktime/download" width="180" height="42" autostart="true" controller="true">\n';
	content +='</embed>\n';
	content +='</object>\n';
	content +='</body>\n</html>';
	audioWindow = window.open("","audio","top=" + aTop + ",left=" + aLeft+",resizable=0,height=100,width=200");
	audioWindow.opener = window;
	audioWindow.document.write(content);
	audioWindow.document.close();
	audioWindow.focus();
	      }
	     else
	      {
	      return;
	      }

}



// for nn4 scrolller
function scrollUp(inc) {
    var lyr = document.layers.Layer4;
    if (lyr.top !=94) {  				// at top stop scrolling up
	lyr.top = lyr.top + inc;
	lyr.clip.top = lyr.clip.top - inc;
	lyr.clip.bottom = lyr.clip.bottom - inc;
	stimer = setTimeout("scrollUp("+inc+")",100);
    }
}

function scrollDown(inc) {
   var lyr = document.layers.Layer4;
	lyr.top = lyr.top - inc;
	lyr.clip.top = lyr.clip.top + inc;
	lyr.clip.bottom = lyr.clip.bottom + inc;
	stimer = setTimeout("scrollDown("+inc+")",100);
}

function stopscroll() {
	clearTimeout(stimer);
}


