var defaultURL = "/kr/application/runningdiary/content";
function login(mvPage) {
    window.open(defaultURL + "/popup/login.asp?mvPage=" + mvPage, "", "width=446,height=225,scrollbars=yes,status=no");
}
function join() {
    window.open(defaultURL + "/popup/adidasMemberJoin.asp", "at", "width=423,height=505,scrollbars=yes,status=no");
}
function mail_check() {
    window.open(defaultURL + "/popup/mail_check.asp", "", "width=300,height=225,status=no");
}
function mail_inquery_result() {
    window.open(defaultURL + "/popup/mail_inquery_result.asp", "", "width=300,height=225,status=no");
}
function mail_inquery() {
    window.open(defaultURL + "/popup/mail_inquery.html", "", "width=300,height=225,status=no");
}
function post() {
    window.open(defaultURL + "/popup/search_address.html", "", "width=316,height=280,status=no,scrollbars=yes");
}
function _myPage() {
    login(defaultURL + "/mypage/mypage.view.asp");
}
function _myDiary() {
    login(defaultURL + "/diary/mydiary.list.asp");
}
function _logout() {
    location.href = defaultURL + "/inc/logout.asp"
}
function layerAction(t) {
    var _t = document.getElementById(t);
    if (_t.style.display == "") {
        document.getElementById(t).style.display = "none";
    }
    else {
        document.getElementById(t).style.display = "";
    }
}
function random(img, w, h) {
    var random = Math.random();
    var image = "<img src='" + defaultURL + "/images/" + img + "_0" + Math.round(random) + ".jpg' width='" + w + "' height='" + h + "' alt=''>";
    document.write(image);
}
function viewnews() {
	layerAction('shade');
	layerAction('whatsnew');
}
function adidasRunning_01() {
    location.href = "/campaigns/verticalsrunning/content/ss09/index.asp?strCountry_adidascom=kr&view=module&module=home&name=content&args=story:supernovaFemale_1/content:0";
}
function adidasRunning_02() {
    location.href = "/campaigns/verticalsrunning/content/ss09/index.asp?strCountry_adidascom=kr&view=module&module=home&name=content&args=story:adistarMale/content:0";
}
function adidasRunning_03() {
    location.href = "/campaigns/verticalsrunning/content/ss09/index.asp?strCountry_adidascom=kr&view=module&module=home&name=content&args=story:supernovaMale/content:0";
}
function adidasRunning_04() {
    location.href = "/campaigns/verticalsrunning/content/ss09/index.asp?strCountry_adidascom=kr&view=module&module=home&name=content&args=story:adistarFemale_1/content:0";
}
/*function random(img, w, h) {
    var holder = document.getElementById("holder");
    var random = Math.random();
    var image = "<img src='../images/" + img + "_0" + Math.round(random) + ".jpg' width='" + w + "' height='" + h + "' alt=''>";
    document.write(image);
}*/
function menus() {
    var ts = document.getElementById("top_shortcut").getElementsByTagName("img");
    var tm = document.getElementById("top_menu").getElementsByTagName("img");
    var sm = document.getElementById("sub_menu").getElementsByTagName("img");

    for (i = 0; i < ts.length; i++) {
        ts[i].onmouseover = function() {
            var src = this.getAttribute("src").replace("_off.gif", "_on.gif");
            this.setAttribute("src", src);
        }
        ts[i].onmouseout = function() {
            var src = this.getAttribute("src").replace("_on.gif", "_off.gif");
            this.setAttribute("src", src);
        }
    }
    for (i = 1; i < tm.length; i++) {
        tm[i].onmouseover = function() {
            var src = this.getAttribute("src").replace("_off.gif", "_on.gif");
            this.setAttribute("src", src);
        }
        tm[i].onmouseout = function() {
            var src = this.getAttribute("src").replace("_on.gif", "_off.gif");
            this.setAttribute("src", src);
        }
    }
    for (i = 0; i < sm.length; i++) {
        sm[i].onmouseover = function() {
            var src = this.getAttribute("src").replace("_off.gif", "_on.gif");
            this.setAttribute("src", src);
        }
        sm[i].onmouseout = function() {
            var src = this.getAttribute("src").replace("_on.gif", "_off.gif");
            this.setAttribute("src", src);
        }
    }
}
window.onload = menus;