﻿// ################################################# 클래스 추가 #####################################################
PS.System.importClass("PS.Ajax");
PS.System.importClass("PS.Ajax.Brand");
PS.System.importClass("PS.Utils");
// ################################################# 선언부 #########################################################

var ResourceServer = "http://resource.koreapolyschool.com";



// 이미지 오버
function imageOver(obj) {
    var imageName = obj.src.split("off")[0];
    
    obj.src = imageName + "on.gif";
}

// 이미지 아웃
function imageOut(obj) {
    var imageName = obj.src.split("on")[0];
    obj.src = imageName + "off.gif";
}





// 공함수
function nothing() {

}

// 페이지 이동 함수
function pageChange(addr) {

    if (addr.substring(0, 1) == "/") {
        window.location = addr;
    }
    else if (addr == "alert") {
        alert("준비중입니다");
    }
    else {
        window.open(addr);
    }
}

// as > js 서브 네비게이션 사이즈 조정 함수
function setSubNaviSize(subNaviHeight) {
    document.getElementById("subNavi").height = subNaviHeight;
    document.getElementById("subNavi2").height = subNaviHeight;
}


// 탭 페이지 이동 함수
function moveTabPage(pageName) {

    switch (pageName) {
        case "job1":
            window.location = "/AboutUs/AboutCareerIntro.aspx";
            break;
        case "job2":
            window.location = "/AboutUs/AboutCareerBoard.aspx";
            break;
    }

}


// 왼쪽 아이콘
function moveLocation(type) {

    switch (type) {

        case 1:
            // 페이지 뷰 업데이트
            PS.Ajax.Brand.updateViewCount("DEMO", null);
            PS.Utils.showDialog("GENERAL", "http://2009.epolyschool.com/E-Poly/Demo/IndexECD.aspx", 790, 550);
            break;

        case 2:
            window.location = "/Business/BizAcaCurriculum.aspx";
            break;

        case 3:
            window.location = "/Business/BizAcaAdmission.aspx";
            break;
    }

}


// IE6 용 폰트 적용
function getIE6Text(str, align) {

    var rtnString = String.format(
                "<font align=\"{0}\" style=\"font-size:12px; font-family:'굴림'; text-align:{0}\">{1}</font>",
                align, str);

    //alert (rtnString);
    return rtnString;
}

// 로딩폼 출력
function showContentsLoadingForm(objId, type, colCount) {
    var htmlString = "";

    htmlString = String.format(
            "   <{1} height=\"200\" align=\"center\" {0}>\n" +
            "       <img src=\"" + ResourceServer + "/Images/Brand/loading.gif\" border=\"0\">Loading . . . \n" +
            "   </{1}>\n",
            (colCount != undefined) ? "colspan=\"" + colCount + "\"" : "",
            type
        );
    $(objId).update(htmlString);
    
}