// browser

// this will also catch chrome and iPhone
var isSafari = (navigator.userAgent.toLowerCase().indexOf('safari') != -1);
var isFF2 = (navigator.userAgent.toLowerCase().indexOf('firefox/2') != -1);
var isFF3 = (navigator.userAgent.toLowerCase().indexOf('firefox/3.0')  != -1);
var isFF3_5 = (navigator.userAgent.toLowerCase().indexOf('firefox/3.5') != -1);
var isIE6 = (navigator.appVersion.toLowerCase().indexOf('msie 6.0') != -1);
var isIE7 = (navigator.appVersion.toLowerCase().indexOf('msie 7.0') != -1);
var isIE8 = (navigator.appVersion.toLowerCase().indexOf('msie 8.0') != -1);
var isChrome = (navigator.appVersion.toLowerCase().indexOf('chrome') != -1);

var isiPhone = detect_iphone();
// var isMobile = detect_mobile();

// platform
var isPC = (navigator.platform.toLowerCase().indexOf('win') != -1);

// Detect Flash
var flashPresent = false;
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}
if ( MM_FlashCanPlay ) {
	flashPresent = true;
}

// Detect iPhone devices
function detect_iphone() {
		
	if(navigator.userAgent.toLowerCase().indexOf('iphone') != -1) {
		return true;
	} else if(navigator.userAgent.toLowerCase().indexOf('ipod') != -1) {
		return true;
	} else {
		return false;
	}	
}

// Detect mobile devices
// function detect_mobile() {
// 		
// 	if(navigator.userAgent.toLowerCase().indexOf('iphone') != -1) {
// 		return true;
// 	} else if(navigator.userAgent.toLowerCase().indexOf('ipod') != -1) {
// 		return true;
// 	} else if(navigator.userAgent.toLowerCase().indexOf('iemobile') != -1) {
// 		return true;
// 	} else if(navigator.userAgent.toLowerCase().indexOf('blackberry') != -1) {
// 		return true;
// 	} else if(navigator.userAgent.toLowerCase().indexOf('android') != -1) {
// 		return true;		
// 	} else if(navigator.userAgent.toLowerCase().indexOf('palm') != -1) {
// 		return true;
// 	} else if(navigator.userAgent.toLowerCase().indexOf('opera mini') != -1) {
// 		return true;
// 	} else if(navigator.userAgent.toLowerCase().indexOf('windows ce') != -1) {
// 		return true;
// 	} else {
// 		return false;
// 	}	
// }
