﻿function addLoadEvent(func){var oldonload = window.onload;if (typeof window.onload != 'function') {window.onload = func;} else {window.onload = function(){oldonload();func();}}}
function OnMouseV() { this.className += (this.className.length > 0 ? " " : "") + "Hover"; }
function OnMouseU() { this.className = this.className.replace(new RegExp("( ?|^)Hover\\b"), ""); }
function TopMenuFix() { var TopMenuLi = GetID("TopMenu").getElementsByTagName("li"); for (var i = 0; i < TopMenuLi.length; i++) { TopMenuLi[i].onmouseover = OnMouseV; TopMenuLi[i].onmouseout = OnMouseU; } }
function GetID(t) { return document.getElementById(t); }

function MarPic() {
    var mar = GetID("MarObj");
    if (!mar) {
        return;
    }
    var w = mar.style.width;
    var h = mar.style.height;
    new Marquee("MarObj", "left", 1, w, h, 30, 0, 0, -1);
}
var NowFrame = 1;
var MaxFrame = 0;
var bStart = 0;
function showBanner() {
    var sb = GetID("ShowBanner");
    if (!sb) {
        return;
    }
    var ss = sb.getElementsByTagName("IMG");
    if (ss.length == 0) {
        return;
    }
    var i = 0;
    for (i = 0; i < ss.length; i++) {
        ss[i].id = "SB_IMG_" + (i + 1);
        if (i > 0) {
            ss[i].style.display = "none";
        }
    }
    MaxFrame = i;
    fnToggle();
}

function fnToggle() {
    var next = NowFrame + 1;
    if (next == MaxFrame + 1) {
        NowFrame = MaxFrame;
        next = 1;
    }
    if (bStart == 0) {
        bStart = 1;
        setTimeout('fnToggle()', 1000);
        return;
    }
    else {
        GetID("ShowBanner").filters[0].Apply();
        GetID("SB_IMG_" + next).style.display = "";
        GetID("SB_IMG_" + NowFrame).style.display = "none";
        GetID("ShowBanner").filters[0].Play(duration = 5);
        if (NowFrame == MaxFrame)
            NowFrame = 1;
        else
            NowFrame++;
    }
    setTimeout('fnToggle()', 6000);
}

function Flash(src, width, height, FlashVars) {
    AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0', 'width', width.toString(), 'height', height.toString(), 'src', src, 'movie', src, 'quality', 'high', 'wmode', 'transparent', 'pluginspage', 'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash', 'FlashVars', FlashVars);
}

addLoadEvent(TopMenuFix);
addLoadEvent(MarPic);
addLoadEvent(showBanner);



/*************************/

function daClick(a, b, c, d, e) {
    var ts = GetID(a).getElementsByTagName("LI");
    var bs = GetID(b).getElementsByTagName("DIV");
    var i = 0;
    for (i = 0; i < ts.length; i++) {
        if (i == c) {
            ts[i].className = "tCur";
        }
        else {
            ts[i].className = "";
        }
    }
    var j = -1;
    for (i = 0; i < bs.length; i++) {
        if (bs[i].className == "dab") {
            j++;
            if (j == c) {
                bs[i].style.display = "";
            }
            else {
                bs[i].style.display = "none";
            }
        }
    }
    GetID(e).href = d;
    return false;
}