﻿/* pngFix */
$(document).ready(function() {
    $("img[src$='.png']").fixPNG();
});

/* load popup img */
$(function() {
    $('img[rel]').overlay({ mask: '#666' });
});

/* show sub */
function showSubPage(menuItem, divSubPage) {
    $('html, body').animate({ scrollTop: 0 }, { duration: 50 });
    $('.menuItem').removeClass('select');
    $(menuItem).addClass('select');
    $('.subPage:visible').fadeOut(250);
    $('#' + divSubPage).hide().fadeIn(500);
}

/* popupImg hover */
$(document).ready(function() {
    $('.layout.three div img[rel]').hover(
        function() { $(this).parent().animate({ top: "-0.4em", opacity: "0.8" }, 150); },
        function() { $(this).parent().animate({ top: "0", opacity: "1" }, 150); }
    );
});

/* GET from Url */
function getUrlVars() {
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for (var i = 0; i < hashes.length; i++) {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}

/* InitDIVFlashMenu */
function InitDIVFlashMenu(iMainPath, iCurrentPage) {
    flashembed("DIVFlashMenu",
        { src: iMainPath + "img/swf/main_menu.swf",
            wmode: 'transparent',
            version: [8, 0],
            onFail: function() { $('#flashfail').show(); }
        },
        { mainPath: iMainPath, currentPage: iCurrentPage }
    );
}


