﻿

/*기존 배너 변경[리뉴얼전]*/

/*기존 배너*/

//첫 메인 배너 세팅  관련

/*메인 배너 관련 자바스크립트*/
//시작 배너 (부터 1증가)
var BannerValue_Sub = 1;

//총 배너 수
var MaxBanner_Sub = 4;
//배너 딜레이
var BannerDelay_Sub = 3 * 1000;
//??
//var rollingFlag = true;

//var tick

//초기 배너 세팅
//defaultsetbannerurl_Sub();

//function defaultsetbannerurl_Sub() {
//    //alert("초기세팅");
//    var newTarget_Sub = false;

//    //익스플로러 체크
//    var isIE_Sub;
//    if (navigator.appName == "Microsoft Internet Explorer") {
//        isIE_Sub = true;
//    }
//    else {
//        isIE_Sub = false;
//    }

//    //본문형
//    purl_Sub = "http://rixco.net/apps/ThisIsNote/main_kr_features.html";
//    targetImg_Sub = "./img/app1.gif"

//    if (isIE_Sub) {
//        document.getElementById("img_left_bottom").filters.blendTrans.apply();
//    }

//    /*배너 링크*/
//    document.getElementById("img_left_bottom").src = targetImg_Sub;
//    
//    if (isIE_Sub) {
//        document.getElementById("img_left_bottom").filters.blendTrans.play();
//    }
//    
//    if (newTarget_Sub)     // 새창열기 처리
//    {
//        document.getElementById("img_left_bottom").onclick = function() {
//            var openNewWindow = window.open("about:blank");
//            openNewWindow.location.href = purl_Sub;
//        };
//    }
//    else {
//        document.getElementById("img_left_bottom").onclick = function() { location.href = purl_Sub; };
//    }
//    
//    document.getElementById("img_left_bottom").style.cursor = "pointer";

//}

var tick_Sub;
var Path;


function SetPath(WebPath) {
    Path = WebPath;
    //서브 배너 초기 세팅
    defaultsetbannerurl_Sub();
    //서브 배너 롤링 시작   
    RollingStart_Sub();
}

function defaultsetbannerurl_Sub() {
    //alert("초기세팅");
    var newTarget = false;

    //익스플로러 체크
    var isIE;
    if (navigator.appName == "Microsoft Internet Explorer") {
        isIE = true;
    }
    else {
        isIE = false;
    }
    
    //ThisIsNote
    purl_Sub = "http://rixco.net/apps/ThisIsNote/main_kr_features.html";
    targetImg_Sub = Path + "img/App_ThisisNote.gif"
    newTarget_Sub = true;

    if (isIE) {
        document.getElementById("img_left_bottom").filters.blendTrans.apply();
    }

    /*배너 링크*/
    document.getElementById("img_left_bottom").src = targetImg_Sub;
    if (isIE) {
        document.getElementById("img_left_bottom").filters.blendTrans.play();
    }
    if (newTarget)     // 새창열기 처리
    {
        document.getElementById("img_left_bottom").onclick = function() {
            var openNewWindow = window.open("about:blank");
            openNewWindow.location.href = purl_Sub;
        };
    }
    else {
        document.getElementById("img_left_bottom").onclick = function() { location.href = purl_Sub; };
    }
    document.getElementById("img_left_bottom").style.cursor = "pointer";

}

//RollingStart_Sub();

function RollingStart_Sub() {
    tick_Sub = setTimeout("RollingBanner_Sub()", BannerDelay_Sub);
}

function RollingBanner_Sub() {

    BannerValue_Sub = BannerValue_Sub + 1;

    if (BannerValue_Sub == MaxBanner_Sub + 1) {

        BannerValue_Sub = 1;
    }

    ShowBanner_Sub(BannerValue_Sub);

    RollingStart_Sub();
}

function RollingStop_Sub() {
    clearTimeout(tick_Sub);
}

function ShowBanner_Sub(idx_Sub) {
    //익스플로러 체크
    var isIE_Sub;
    if (navigator.appName == "Microsoft Internet Explorer") {
        isIE_Sub = true;
    }
    else {
        isIE_Sub = false;
    }
    
    var newTarget_Sub = false;
    var targetImg_Sub = "";

    switch (idx_Sub) {
        case 1:
            //ThisIsNote
            purl_Sub = "http://rixco.net/apps/ThisIsNote/main_kr_features.html";
            targetImg_Sub = Path + "img/App_ThisisNote.gif"
            newTarget_Sub = true;
            break;
        
        case 2:
            //글꼴짱
            purl_Sub = "http://rixco.net/apps/rixfont/index.html";
            targetImg_Sub = Path + "img/App_FontBest.gif"
            newTarget_Sub = true;
            break;
        
        case 3:
            //Hand DO
            purl_Sub = "http://rixco.net/apps/handdo/index.html";
            targetImg_Sub = Path + "img/App_HandDo.gif"
            newTarget_Sub = true;
            break;
            
        case 4:
            //31fonts
            purl_Sub = "http://rixco.net/apps/31fonts/index.html";
            targetImg_Sub = Path + "img/App_31Fonts.gif"
            newTarget_Sub = true;
            break;
    }

    if (isIE_Sub) {
        document.getElementById("img_left_bottom").filters.blendTrans.apply();
    }

    /*배너 링크*/
    document.getElementById("img_left_bottom").src = targetImg_Sub;

    if (isIE_Sub) {
        document.getElementById("img_left_bottom").filters.blendTrans.play();
    }

    if (newTarget_Sub)     // 새창열기 처리
    {
        document.getElementById("img_left_bottom").onclick = function() {
            var openNewWindow = window.open("about:blank");
            openNewWindow.location.href = purl_Sub;
        };
    }
    else {
        document.getElementById("img_left_bottom").onclick = function() { location.href = purl_Sub; };
    }

    document.getElementById("img_left_bottom").style.cursor = "pointer";
}

function BannerChange_Sub(Type) {
    if (Type == "Forward") {
        BannerValue_Sub = BannerValue_Sub - 1;
        if (BannerValue_Sub == 0) {
            BannerValue_Sub = MaxBanner_Sub;
        }
    }

    if (Type == "Back") {
        BannerValue_Sub = BannerValue_Sub + 1;
        if (BannerValue_Sub == MaxBanner_Sub + 1) {
            BannerValue_Sub = 1;
        }
    }

    ShowBanner_Sub(BannerValue_Sub);
}

/*Default Page용*/

function STZ_swapImage(Control, Path) {

    $("#" + Control).attr("src", Path);
}

////메인 배너 롤링 시작
//RollingStart_Sub();

//function RollingStart_Sub() {
//    tick_Sub = setTimeout("RollingBanner_Sub()", BannerDelay_Sub);
//}

//function RollingBanner_Sub() {

//    BannerValue_Sub = BannerValue_Sub + 1;

//    if (BannerValue_Sub == MaxBanner_Sub + 1) {

//        BannerValue_Sub = 1;
//    }
//    
//    ShowBanner_Sub(BannerValue_Sub);

//    RollingStart_Sub();
//}

//function RollingStop_Sub() {
//    clearTimeout(tick_Sub);
//}

//function ShowBanner_Sub(idx_Sub) {
//    //alert("1");
//    //익스플로러 체크
//    var isIE_Sub;
//    if (navigator.appName == "Microsoft Internet Explorer") {
//        isIE_Sub = true;
//    }
//    else {
//        isIE_Sub = false;
//    }

//    //alert("시작");
//    //alert(idx_Sub);

//    var newTarget_Sub = false;
//    var targetImg_Sub = "";

//    switch (idx_Sub) {
//        case 1:
//            //ThisIsNote
//            purl_Sub = "http://rixco.net/apps/ThisIsNote/main_kr_features.html";
//            targetImg_Sub = "./img/App_ThisisNote.jpg"
//            newTarget_Sub = true;
//            break;

//        case 2:
//            //글꼴짱
//            purl_Sub = "http://rixco.net/apps/rixfont/";
//            targetImg_Sub = "./img/App_FontBest.jpg"
//            newTarget_Sub = true;
//            break;
//    }

//    if (isIE_Sub) {
//        document.getElementById("img_left_bottom").filters.blendTrans.apply();
//    }

//    /*배너 링크*/
//    document.getElementById("img_left_bottom").src = targetImg_Sub;
//    
//    if (isIE_Sub) {
//        document.getElementById("img_left_bottom").filters.blendTrans.play();
//    }
//    
//    if (newTarget_Sub)     // 새창열기 처리
//    {
//        document.getElementById("img_left_bottom").onclick = function() {
//            var openNewWindow = window.open("about:blank");
//            openNewWindow.location.href = purl_Sub;
//        };
//    }
//    else {
//        document.getElementById("img_left_bottom").onclick = function() { location.href = purl_Sub; };
//    }
//    
//    document.getElementById("img_left_bottom").style.cursor = "pointer";
//}

//function BannerChange_Sub(Type) {
//    if (Type == "Forward") {
//        BannerValue_Sub = BannerValue_Sub - 1;
//        if (BannerValue_Sub == 0) {
//            BannerValue_Sub = MaxBanner_Sub;
//        }
//    }

//    if (Type == "Back") {
//        BannerValue_Sub = BannerValue_Sub + 1;
//        if (BannerValue_Sub == MaxBanner_Sub + 1) {
//            BannerValue_Sub = 1;
//        }
//    }

//    ShowBanner_Sub(BannerValue_Sub);
//}

///*Default Page용*/

//function STZ_swapImage(Control, Path) {

//    $("#" + Control).attr("src", Path);
//}
