// JavaScript Document


/*	top-image style
==================================================*/
load.Set('FEATURE_PREPARATION();');

var FEATURE;
var BUTTON;

function FEATURE_PREPARATION () {
FEATURE = new CLASS('FEATURE');
if (!FEATURE.length) return;
BUTTON = new CLASS('BUTTON');
for (i = 0; i < FEATURE.length; i ++) {
FEATURE[i].setA(0);
eval('BUTTON[' + i + '].path.onmouseover = function () { FEATURE_SWEEP(' + i + ') }');
eval('BUTTON[' + i + '].path.onmouseout = function () { FEATURE_SWEEPtimer[' + (i) + '] = setTimeout("FEATURE[' + (i) + '].setZ(99);sweep.Set(FEATURE[' + (i) + '],125,950,125,0);trans.Set(FEATURE[' + (i) + '],0);", 768); }');
eval('FEATURE[' + i + '].path.onmouseover = function () { FEATURE_SWEEP(' + i + ') }');
eval('FEATURE[' + i + '].path.onmouseout = function () { FEATURE_SWEEPtimer[' + (i) + '] = setTimeout("FEATURE[' + (i) + '].setZ(99);sweep.Set(FEATURE[' + (i) + '],125,950,125,0);trans.Set(FEATURE[' + (i) + '],0);", 768); }');
}
}

var FEATURE_SWEEPtimer = new Array();
function FEATURE_SWEEP () {
var key = arguments[0];
if (FEATURE_SWEEPtimer[key]) clearTimeout(FEATURE_SWEEPtimer[key]);
if (FEATURE[key].Z == 100) { return; }
FEATURE[key].setA(0);
FEATURE[key].setD(1);
FEATURE[key].setC(100,950,200,0);
for (i = 0; i < FEATURE.length; i ++) { if (i == key) { FEATURE[i].setZ(100); } else if (FEATURE[i].Z == 100) { FEATURE[i].setZ(98); } else { FEATURE[i].setZ(97); } }
sweep.Set(FEATURE[key],0,950,250,0);
trans.Set(FEATURE[key],100);
}


/*	tab-change style
==================================================*/
function changeImg(tab) {
  if (tab == 'tab_01') {
    document.getElementById("tab_01").src = "images/index/tab_01.gif";
    document.getElementById("tab_02").src = "images/index/tab_02_on.gif";
    document.getElementById("tab_03").src = "images/index/tab_03_on.gif";
	document.getElementById("tab_04").src = "images/index/tab_04_on.gif";
	document.getElementById("information-img").src = "images/index/information_01.gif";
	document.getElementById("information-link").href = "information/";
  }
	else if (tab == 'tab_02') {
    document.getElementById("tab_01").src = "images/index/tab_01_on.gif";
    document.getElementById("tab_02").src = "images/index/tab_02.gif";
    document.getElementById("tab_03").src = "images/index/tab_03_on.gif";
	document.getElementById("tab_04").src = "images/index/tab_04_on.gif";
	document.getElementById("information-img").src = "images/index/information_02.gif";
	document.getElementById("information-link").href = "information/exam.html";
  }
	else if (tab == 'tab_03') {
    document.getElementById("tab_01").src = "images/index/tab_01_on.gif";
    document.getElementById("tab_02").src = "images/index/tab_02_on.gif";
    document.getElementById("tab_03").src = "images/index/tab_03.gif";
	document.getElementById("tab_04").src = "images/index/tab_04_on.gif";
	document.getElementById("information-img").src = "images/index/information_03.gif";
	document.getElementById("information-link").href = "information/find-work.html";
  }
	else {
    document.getElementById("tab_01").src = "images/index/tab_01_on.gif";
    document.getElementById("tab_02").src = "images/index/tab_02_on.gif";
    document.getElementById("tab_03").src = "images/index/tab_03_on.gif";
	document.getElementById("tab_04").src = "images/index/tab_04.gif";
	document.getElementById("information-img").src = "images/index/information_04.gif";
	document.getElementById("information-link").href = "information/seminar.html";
  }
}


/*	information-bottom style
==================================================*/
var handlePrevButtonState = function(type, args) {
    var enabling = args[0];
    var leftImage = args[1];
    if(enabling) {
        leftImage.src = "images/index/bottom-menu_previous-btn.gif";    
    } else {
        leftImage.src = "images/index/bottom-menu_previous-btn.gif";    
    }
    
};

var handleNextButtonState = function(type, args) {
    var enabling = args[0];
    var rightImage = args[1];
    
    if(enabling) {
        rightImage.src = "images/index/bottom-menu_next-btn.gif";
    } else {
        rightImage.src = "images/index/bottom-menu_next-btn.gif";
    }
    
};

var carousel;
var pageLoad = function() {
    carousel = new YAHOO.extension.Carousel("mycarousel", 
        {
            numVisible:        4,
            animationSpeed:    0.15,
            scrollInc:         1,
            navMargin:         20,
            prevElement:     "previous",
            nextElement:     "next",
            size:              5,
            prevButtonStateHandler:   handlePrevButtonState,
            nextButtonStateHandler:   handleNextButtonState
        }
    );
};
