
/*--------------------------------------------
ファンクションJS
サイト内で利用する汎用的な関数
2010.4
----------------------------------------------*/


// 画像のキャッシュ
try {
document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}


// 基本プランの写真きりかえ
function bpChg(x) {
    $('#alert').hide();
    for(i=0; i<10; i++) {
        $('#detail'+i).hide();
        $('#point'+i).children().css('marginTop','0px');
    }
    $('#detail'+x).show();
    $('#point'+x).children().css('marginTop','-31px');
}


// トップページのスライドショー
function topSS() {
    $('#dmy').fadeOut(3000, function() {
        $('#photo1').fadeOut(3000, function() {
            $('#dmy').fadeIn(3000, function() {
                $('#photo2').css('zIndex','10');
                $('#photo3').css('zIndex','9');
                $('#photo4').css('zIndex','8');
                $('#photo5').css('zIndex','7');
                $('#photo1').css('zIndex','6');
                $('#photo1').show();
                $('#photo2').fadeOut(3000, function() {
                    $('#dmy').fadeOut(3000, function() {
                        $('#photo3').css('zIndex','10');
                        $('#photo4').css('zIndex','9');
                        $('#photo5').css('zIndex','8');
                        $('#photo1').css('zIndex','7');
                        $('#photo2').css('zIndex','6');
                        $('#photo2').show();
                        $('#photo3').fadeOut(3000, function() {
                            $('#dmy').fadeIn(3000, function() {
                                $('#photo4').css('zIndex','10');
                                $('#photo5').css('zIndex','9');
                                $('#photo1').css('zIndex','8');
                                $('#photo2').css('zIndex','7');
                                $('#photo3').css('zIndex','6');
                                $('#photo3').show();
                                $('#photo4').fadeOut(3000, function() {
                                    $('#dmy').fadeIn(3000, function() {
                                        $('#photo5').css('zIndex','10');
                                        $('#photo1').css('zIndex','9');
                                        $('#photo2').css('zIndex','8');
                                        $('#photo3').css('zIndex','7');
                                        $('#photo4').css('zIndex','6');
                                        $('#photo4').show();
                                        $('#photo5').fadeOut(3000, function() {
                                            $('#dmy').fadeIn(3000, function() {
                                                $('#photo1').css('zIndex','10');
                                                $('#photo2').css('zIndex','9');
                                                $('#photo3').css('zIndex','8');
                                                $('#photo4').css('zIndex','7');
                                                $('#photo5').css('zIndex','6');
                                                $('#photo5').show();
                                                topSS();
                                            })
                                        })
                                    })
                                })
                            })
                        })
                    })
                })
            })
        })
    });
}


/* ONLOAD */
function onLoadFnc(fnc) {
    for(i=0; i<fnc.length; i++) {
        if(window.addEventListener) {
            window.addEventListener("load", eval(fnc[i]), false);
        }
        else if(window.attachEvent) {
            window.attachEvent("onload", eval(fnc[i]));
        }
    }
}
