var timer;
function init_woori() {
    var ua = navigator.userAgent;
    var un = navigator.appName;

    if(un == 'Microsoft Internet Explorer') {
        //IE인 경우.
        if(ua.indexOf('MSIE 7.0') > 0) {
            //IE7.0인 경우-AX 설치할필요없음. 
            // document.getElementById('info').innerHTML = document.getElementById('msie7').innerHTML;

        } else {
            //IE7.0이하버젼.

            if(ua.indexOf('Windows 98') > 0) {
                //98
                // document.location.href = 'index_win98.html';
                return false;
            } else if(ua.indexOf('Windows NT 5.1') > 0) {
                //WINDOWS XP
                document.getElementById("ax_container").innerHTML = 
                    '<OBJECT id="CTAdjust" ' + 
                    'codeBase="http://download.microsoft.com/download/7/E/6/7E6A8567-DFE4-4624-87C3-163549BE2704/clearadj.cab#version=1,0,0,4" ' +
                    'classid="CLSID:DE22A7AB-A739-4C58-AD52-21F9CD6306B7" VIEWASTEXT> ' + 
                    '</OBJECT>';
            } else if(ua.indexOf('Windows NT 5.0')) {
                //2000
                document.getElementById("ax_container").innerHTML = 
                    '<OBJECT id="CTAdjust" ' + 
                    'codeBase="http://download.microsoft.com/download/7/E/6/7E6A8567-DFE4-4624-87C3-163549BE2704/clearadj.cab#version=1,0,0,4" ' +
                    'classid="CLSID:DE22A7AB-A739-4C58-AD52-21F9CD6306B7" VIEWASTEXT> ' + 
                '</OBJECT>';
            } else {
                //other os.
                document.location.href = 'index_other_os.html';
                return false;
            }

            CTAdjust.onerror = function() { 
                alert('ActiveX를 설치하시면 더 좋은 폰트를 이용하실 수 있습니다.'); 
            }

            check_ctadjust();

        }
    } else {
        //IE가 아닌경우.
        //$('#info').html($('#not_ie').html());
       alert('지금 페이지는 IE 에서 최적화 되어 있습니다.'); 
    }
}

function check_ctadjust() {
    var CTAdjust = document.getElementById('CTAdjust');
    var ua = navigator.userAgent;
    var un = navigator.appName;

    if(CTAdjust && (CTAdjust.SmoothType == 0 || CTAdjust.SmoothType == 1 || CTAdjust.SmoothType ==2)) {
        //$("#msg").html('Microsoft에서 제공되는 Cleartype Tuner 프로그램이 설치되었습니다.');
        if(ua.indexOf('Windows NT 5.1') > 0) {
            //XP인 경우.
            if(CTAdjust.SmoothType == 2) {
                //document.getElementById('info').innerHTML = document.getElementById('cleartype_was_on').innerHTML;
            } else {
                CTAdjust.SmoothType = 2;
                //document.getElementById('info').innerHTML = document.getElementById('cleartype_was_off').innerHTML;
            }
        } else {
            CTAdjust.SmoothType = 1;
            //document.getElementById('info').innerHTML = document.getElementById('cleartype_was_0').innerHTML;
        }
    } else {
        timer = setTimeout("check_ctadjust()", 500);
    }
}
