//// CHECK COOKIE FOR LGT FLASH PLAYER ////

function Check4FlashCookie(){
	myFlashPlayer = getCookie('myFlashPlayer');
	if (myFlashPlayer == null){
	Sniff4FlashPlayer();
	setCookie('myFlashPlayer', myFlashPlayer)
}

function Sniff4FlashPlayer(){
	// INTIALISE VARIABLES //
	maxFlashPlayer="10";//10,0,0,0
	myFlashPlayer=0;
	//// Find Flash Player Version! ////
	if(!supportedBrowser){myFlashPlayer=0;}
	if(NNpass || macIEpass){Flash_checkForPlugIn();}
	if(winIEpass){myFlashPlayer = (Flash_checkForActiveX());}
	}
}







////  BROWSER DETECTION  ////

// Is this a Mac running Microsoft Internet Explorer V5+ or Opera
macIEpass = ((navigator.appVersion.indexOf("MSIE") != -1) && (navigator.appVersion.indexOf("Mac") != -1)) && (parseFloat(navigator.appVersion) >= 4) ? true : false; 
 
// Is this a PC running Microsoft Internet Explorer V4+
winIEpass = ((navigator.appName.indexOf("Microsoft") != -1) && (navigator.appVersion.indexOf("Windows") != -1)) && (parseFloat(navigator.appVersion) >= 4) ? true : false;
  
// Is this a Mac or PC running Netscape V4+ or a Mac running Safari
NNpass = ((navigator.appName == "Netscape") && (navigator.userAgent.indexOf("Mozilla") != -1) && (parseFloat(navigator.appVersion) >= 4)) ? true : false;
//  (navigator.javaEnabled())) ? true : false; Doesn't work with Mac Nav7+

supportedBrowser = (winIEpass || NNpass || macIEpass) ? true : false;
//alert ("Browser: Windows="+winIEpass+"  Nestcape="+NNpass+"  Mac IE="+macIEpass); -- for testing purposes
	
////  END BROWSER DETECTION  ////


//// FLASH DETECTION ////

function Flash_checkForPlugIn() {
  var plugin = (navigator.mimeTypes &&
  navigator.mimeTypes["application/x-shockwave-flash"]) ?
  navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
  if (plugin) {
    myFlashPlayer = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) 
  }
}

// vbscript check for Flash ActiveX control in windows IE
if(supportedBrowser && winIEpass) {
  document.write('<scr' + 'ipt language="VBScript"\> \n');
  document.write('Function Flash_checkForActiveX()' + '\n');
  document.write('Dim hasPlayer, playerversion' + '\n' );
  document.write('hasPlayer = false' + '\n' );
  document.write('playerversion = 10' + '\n' );
  document.write('Do While playerversion >= 1' + '\n' );
  document.write('On Error Resume Next' + '\n');
  document.write('hasPlayer = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.\" & playerversion & \"\")))' + '\n' );
  document.write('If hasPlayer = true Then Exit Do' + '\n' );
  document.write('playerversion = playerversion - 1' + '\n');
  document.write('Loop' + '\n');
  document.write('Flash_checkForActiveX = playerversion' + '\n');
  document.write('End Function' + '\n');
  document.write('</scr' + 'ipt\> \n');
}

//// END FLASH DETECTION ////


