MJL.event.add(window, "load", function(event) {
    MJL.enable.tab("tabs");
    MJL.enable.heightEqualizer("column_col2", {groupBy : 2});
    MJL.enable.heightEqualizer("column_col3", {groupBy : 3});
    MJL.enable.rollover("roll", {disable : "unroll"});
	
	
    function getImgParallelStyler(side) {
        if ("left" != side && "right" != side) {
            throw Error("invalid side type: '"+side+"'");
        }
        return function() {
            var obj = $(this);
            var imgBlock = $("div.image:first-child", obj);
            var imgWidth = $("p.image img", imgBlock).width();
            imgBlock.css("width", imgWidth+"px");
            $("div.column", obj).css("margin-"+side,
                                     imgBlock[0].offsetWidth+"px");
        };
    }
    $(".image_parallel.image_L").each(getImgParallelStyler("left"));
    $(".image_parallel.image_R").each(getImgParallelStyler("right"));
}, false);




$(function() {

    // globalNavi
    var bodyClass = $('body').attr("class");
    $('img', '#globalNavi').each(function(){
        var imgPath = $(this).parents('li').attr("class");
        if (bodyClass == imgPath) {
            $(this).parents("li").addClass("unroll");
            this.src = this.src.replace( /(\.[a-z]{3})$/, "_ov$1");
        }
    });

    // localNavi Drop Down
    $('#localNavi > ul > li').hover(function() {
       $('.dropdown a', this).css({'border-top':'#ffe9d8 1px solid', 'border-right':'#ffe9d8 1px solid', background:'#ffe9d8 url("/shared/images/navi/licalNav_arrow_o.gif") right center no-repeat'});
       $('>div', this).stop();
       $('div', this).css({display:'block', height:'auto', opacity:'0.5'});
       $('div', this).animate({opacity:'1'},100);
       $('>div', this).fadeIn(100);
    },function() {
	$(this).children('div').fadeOut(0);
	$('.dropdown a', this).css({'border-top':'#ffa851 1px solid', 'border-right':'#ffbf77 1px solid', background:'url("/shared/images/navi/licalNav_arrow.gif") right center no-repeat'});
    });

    // localNavi Current Control
    var _location = location.pathname.replace('index.html', '');
    $('a', '#localNavi').each(function(){
        var _href = $(this).attr('href').replace('index.html', '');
        if(_location == _href){
            $(this).parents("li").addClass("current");
        }
    });

});


// scalability Map links
function scover01(chg){
	if(chg){document.getElementById("scalabilitymaplinks").src='/english/asia/images/img_scalability_01_on01.gif'}
	else{	document.getElementById("scalabilitymaplinks").src='/english/asia/images/img_scalability_01.gif'}
}
function scover02(chg){
	if(chg){document.getElementById("scalabilitymaplinks").src='/english/asia/images/img_scalability_01_on02.gif'}
	else{	document.getElementById("scalabilitymaplinks").src='/english/asia/images/img_scalability_01.gif'}
}
function scover03(chg){
	if(chg){document.getElementById("scalabilitymaplinks").src='/english/asia/images/img_scalability_01_on03.gif'}
	else{	document.getElementById("scalabilitymaplinks").src='/english/asia/images/img_scalability_01.gif'}
}