var timer;
function init() {
    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> ' + 
                    '<div align="center"><img src="no_ax_xp2.gif" alt="ActiveX 컨트롤을 설치하셔야 합니다." /></div>' +
                    '</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> ' + 
                    '<div align="center"><img src="no_ax_2000.gif" alt="ActiveX 컨트롤을 설치하셔야 합니다." /></div>' +
                    '</OBJECT>';
            } else {
                //other os.
//                document.location.href = 'index_other_os.html';
                return false;
            }

            CTAdjust.onerror = function() { 
                //document.getElementById("submit").innerHTML = document.getElementById("btn_ax").innerHTML;

            }

            check_ctadjust();

        }

    } else {
        //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) {
            } else {
                CTAdjust.SmoothType = 2;                
            }
        } else {
            CTAdjust.SmoothType = 1;
                 }
	    document.getElementById('clear_guide').style.display = "none";
    } else {
	    document.getElementById('clear_guide').style.display = "block";
	    timer = setTimeout("check_ctadjust()", 500);
    }
}

