// Browser detection
var browserVersion;
// Change below for testing******************************//
var flashPlugInState = true;


if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
	var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
if (ieversion>=8){
	browserVersion = "ie8";
	}
else if (ieversion>=7){
	browserVersion = "ie7";
	}
else if (ieversion>=6){
	browserVersion = "ie6";
	}
else if (ieversion>=5)
	browserVersion = "ie5";
	}
else{
	browserVersion = "notIE";
}


if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent))
{
    var ffversion=new Number(RegExp.$1) // capture x.x portion and store as a number
    if (ffversion<3)
    {
    //        alert(ffversion);
        if(currentPage == "coverage" || currentPage == "rate")
            flashPlugInState = false;
    }
}


var haveFlashPlugin;
// Version check based upon the values entered above in "Globals"
//var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

//Detect Plugin (Flash, Java, RealPlayer etc) script- By Frederic (fw4@tvd.be)
//Visit http://javascriptkit.com for this script and more

//SAMPLE USAGE- detect "Flash"
//if (pluginlist.indexOf("Flash")!=-1)
//document.write("You have flash installed")

//This script detects the following:
//Flash
//Windows Media Player
//Java
//Shockwave
//RealPlayer
//QuickTime
//Acrobat Reader
//SVG Viewer




var agt=navigator.userAgent.toLowerCase();
var ie  = (agt.indexOf("msie") != -1);
var ns  = (navigator.appName.indexOf("Netscape") != -1);
var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
var mac = (agt.indexOf("mac")!=-1);

//if (ie && win) {	pluginlist = detectIE("Adobe.SVGCtl","SVG Viewer") + detectIE("SWCtl.SWCtl.1","Shockwave Director") + detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash") + detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") + detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player") + detectIE("PDF.PdfCtrl.5","Acrobat Reader"); }
if (ie && win) {	pluginlist = detectIE("Adobe.SVGCtl","SVG Viewer") + detectIE("SWCtl.SWCtl.1","Shockwave Director") + detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash") + detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") + detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + detectIE("PDF.PdfCtrl.5","Acrobat Reader"); }
if (ns || !win) {
		nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
		pluginlist = detectNS("image/svg-xml","SVG Viewer") + detectNS("application/x-director","Shockwave Director") + detectNS("application/x-shockwave-flash","Shockwave Flash") + detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows Media Player") + detectNS("application/pdf","Acrobat Reader");
}

function detectIE(ClassID,name) { result = false; document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</SCRIPT>\n'); if (result) return name+','; else return ''; }
function detectNS(ClassID,name) { n = ""; if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; return n; }

pluginlist += navigator.javaEnabled() ? "Java," : "";
if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);

// This checks to see if the user has a Flash Plugin
function checkFlashPlugin(pagePassed) {
    //*********** HOME PAGE Flash replacement ******************
	
    if((hasReqestedVersion == false || flashPlugInState == false))
	{
   	    
    }

}

function haveFlashPlugin(){
	//SAMPLE USAGE- detect "Flash"
	if (pluginlist.indexOf("Flash")!=-1){
		haveFlashPlugin = true;
		//alert("You have Flash installed");
		return haveFlashPlugin;
	}

	else{
		haveFlashPlugin = false;
		return haveFlashPlugin;
		//alert("No Flash installed");
	}
}
