﻿function initTabMenu(tabContainerID, className) {
    var tabContainer = document.getElementById(tabContainerID);
    var tabAnchor = tabContainer.getElementsByTagName("a");
    var i = 0;

    for (i = 0; i < tabAnchor.length; i++) {
        if (tabAnchor.item(i).className == className)
            thismenu = tabAnchor.item(i);
        else
            continue;

        thismenu.container = tabContainer;
        thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
        thismenu.targetEl.style.display = "none";
        thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
        thismenu.onclick = function tabMenuClick() {
            currentmenu = this.container.current;
            if (currentmenu == this)
                return false;

            if (currentmenu) {
                currentmenu.targetEl.style.display = "none";
                if (currentmenu.imgEl) {
                    currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
                } else {
                    currentmenu.className = currentmenu.className.replace(" on", "");
                }
            }
            this.targetEl.style.display = "";
            if (this.imgEl) {
                this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
            } else {
                this.className += " on";
            }
            this.container.current = this;

            return false;
        };

        if (!thismenu.container.first)
            thismenu.container.first = thismenu;
    }
    if (tabContainer.first)
        tabContainer.first.onclick();
}

/*----------------------------------------------------------------------------------------------------------
swf object
swfprint('Object ID','경로','width','height','투명여부 (o-불투명 / t-투명)','변수명=xml경로&변수명=경로');
----------------------------------------------------------------------------------------------------------*/
//브라우져 체크
appname = navigator.appName;
useragent = navigator.userAgent;
if (appname == "Microsoft Internet Explorer") appname = "IE";
IE55 = (useragent.indexOf('MSIE 5.5') > 0);  //5.5 버전
IE6 = (useragent.indexOf('MSIE 6') > 0);     //6.0 버전
IE7 = (useragent.indexOf('MSIE 7') > 0);     //7.0 버전
//오브젝트 호출
function swfprint(objid, furl, fwidth, fheight, transoption, flashvars, pscale) {
    if (pscale == null) {
        pscale = "noscale";
    }
    if (typeof (scheme) == 'undefined' || scheme == null) {
        scheme = 'http';
    }
    var ieTxt = '<object id="' + objid + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="' + scheme + '"://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0" width="' + fwidth + '" height="' + fheight + '" align="middle">';
    ieTxt += '<param name="allowScriptAccess" value="always"/>';
    ieTxt += '<param name="movie" value="' + furl + '"/>';
    ieTxt += '<param name="quality" value="high"/>';
    ieTxt += '<param name="bgcolor" value="#ffffff"/> ';
    ieTxt += '<param name="salign" value="T"/> ';
    ieTxt += '<param name="menu" value="false"/> ';
    if (flashvars) ieTxt += '<param name="flashVars" value="' + flashvars + '">';
    if (transoption == "t") {
        ieTxt += '<param name="wmode" value="transparent"/>';
    } else if (transoption == "o") {
        ieTxt += '<param name="wmode" value="opaque"/>';
    }
    ieTxt += '</object>';

    var ffTxt = '<object id="' + objid + '" type="application/x-shockwave-flash" data="' + furl + '" width="' + fwidth + '" height="' + fheight + '"';
    if (flashvars) ffTxt += ' flashVars="' + flashvars + '" ';
    if (transoption == "t") {
        ffTxt += ' wmode="transparent"';
    } else if (transoption == "o") {
        ffTxt += ' wmode="opaque"';
    }
    ffTxt += 'allowScriptAccess="always"';
    ffTxt += '></object>';

    if (appname == "IE") document.write(ieTxt);
    else document.write(ffTxt);
}
