function getFlashStatus() {
    var MinVer = 7;
    if (navigator.plugins && navigator.plugins.length && navigator.plugins.length > 0) {
        //Firefox
		var flashObj = navigator.plugins["Shockwave Flash"];
        if (flashObj && flashObj.length && flashObj.length > 0) {
            var flashMimeObj = flashObj["application/x-shockwave-flash"];
            if (flashMimeObj) {
                var tempStr = flashObj.description.split(" Flash ");
                var verNo = parseFloat(tempStr[1]);
                if (verNo >= MinVer) {
                   FlashState = 1;
                } else {
                   FlashState = 0;
                }
            }
        }
    }else
	{
		//IE
		for (var i = MinVer; i > 0; i--) {
            try {
                var flashObj = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
				FlashState = 1;
            } catch(e) {
                FlashState = 0;
            }
        }
    }
}

function FlashCheckResult() {
	getFlashStatus();
	if(FlashState!=1)
	{
		alert('為了讓您能更順暢的使用本系統，請先依照系統提示步驟安裝Flash player後再進行評量測驗。');
		location.href='../../../explain/index/8';
	}
}

function PopCheckResult() {
	popup = getPopupStatus("../../../views/main/exam/open.htm");
	if(PopState!=1)
	{
		sure = confirm('為了能正常的列印測驗結果，請先依照系統提示步驟逐一設定之後，再重新進行列印，您需要馬上看如何進行設定嗎？')
		if (sure)
		{
			location.href='../../../explain/index/9';
		}
		return false;
	}
	return true;
}

function getPopupStatus(winUrl) {
    var str_feature = 'toolbar=no'
    + ',menubar=no'
    + ',scrollbars=no'
    + ',resizable=no'
    + ',status=no'
    + ',width=180'
    + ',height=65'
    + ',top=0'
    + ',left=0'
    + ',screenX=0'
    + ',screenY=0';
    var popup_win = window.open(winUrl, "wb_check", str_feature);

    if (popup_win) {
        PopState = 1;
    }
}

var FlashState= 0;
var PopState = 0;

//FlashCheckResult();
//PopCheckResult();

