function browserCheck() {
	var result = true;
	var ua = navigator.userAgent;
	result = !(ua.indexOf('iPad;') > -1);
	if (result) {
		result = !(ua.indexOf('iPhone;') > -1);
	}
	return result;
}
function displayFlashDialog() {
	var showUpdateButton = false;
	var arrButtons = [];
	var content = 'Adobe Flash Player 10.0 or greater is required to use the WebPortal.<br><br>';
	if (FlashDetect.installed) {
		var flashVersion = FlashDetect.major + '.' + FlashDetect.minor + '.' + FlashDetect.revision;
		content += 'You currently have Adobe Flash Player ' + flashVersion + ' installed.';
		var buttonText = "Update Flash";
		showUpdateButton = true;
	} else if (browserCheck()) {
		content += 'Adobe Flash Player is currently NOT installed on your web browser.';
		var buttonText = "Get Flash";
		showUpdateButton = true;
	} else {
		content += 'We are sorry, but your browser does not support Adobe Flash which is necessary for the American Gift WebPortal.  '
			+ 'Please try again from another device (PC or MAC) that supports Adobe Flash.';
	}
	
	if (showUpdateButton) {
		arrButtons.push({
			text: buttonText,
			click: function() {
				$(this).dialog("close"); 
				location.href = 'http://get.adobe.com/flashplayer/';
			}
		});
	}
	arrButtons.push({
		text: "Close",
		click: function() {
			$(this).dialog("close");
		}
	});
	
	$("<div title='Adobe Flash Player'>" + content + "</div>").dialog({
		modal: true,
		resizable: false,
		closeOnEscape: true,
		buttons: arrButtons,
		close: function(event, ui){
			$(this).dialog("destroy");
			$(this).remove();
		}
	});
}
function displayWebportalLogin() {
	//if (FlashDetect.versionAtLeast(10)) {
		window.open(
			'https://webportal.agiftcorp.com/login/login.cfm',
			'WebPortal',
			'status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=0'
		);
	//} else {
	//	displayFlashDialog();
	//}
}
