function initRollovers() {
    if (!document.getElementById) return

    var aPreLoad = new Array();
    var sTempSrc;
    var aImages = document.getElementsByTagName('img');

    for (var i = 0; i < aImages.length; i++) {
        if (aImages[i].className.indexOf('imgover') != -1) {
            var src = aImages[i].getAttribute('src');
            var ftype = src.substring(src.lastIndexOf('.'), src.length);
            var hsrc = src.replace(ftype, '_o' + ftype);

            aImages[i].setAttribute('hsrc', hsrc);

            aPreLoad[i] = new Image();
            aPreLoad[i].src = hsrc;

            aImages[i].onmouseover = function () {
                sTempSrc = this.getAttribute('src');
                this.setAttribute('src', this.getAttribute('hsrc'));
            }

            aImages[i].onmouseout = aImages[i].onmouseup = function () {
                if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_o' + ftype, ftype);
                this.setAttribute('src', sTempSrc);
            }
        }
    }
}

//dropy使わない時は使用する
$(document).ready(function () {
    initRollovers();
    window.name = 'parent'; //ウインドウネーム指定
/*if ($("body#home").length != 0) {
        $("a").each(function () {
            $(this).bind("click", function(event){
                var linkref = $(this).href;
																event.preventDefault();
            });
        });
    }*/

    $("#l-cate .cate-inn > ul > li").each(function () {
        if ($(this).find("a").length == 0) {
            $(this).remove();
        }

    });


    /*if ($("#top-flash").length >= 0) {
									$("body").css("background", "#483A36")
        flafix();
								setInterval(flafix,10)
        $(window).resize(function () {
											if($(window).height() >= 595){
            flafix();
											}
        });
    }*/


}); /**/

function flafix() {
	if($(window).height() >= 595){
    $("#top-flash").height($(window).height() - $("#top-main").height() - $("#footer").height());
	}
}



//透過png
DD_belatedPNG.fix('#cts, #r-col');

//高さを揃える（jquery.flatheights.js）css要素設定
$(function () {
    $('#cts, #l-cate').flatHeights();
    $('.ph-mid dl dd').flatHeights();
    //$('body, #top-col, #ctr-col').flatHeights();
});


// ここからツールチッププラグイン
(function ($) {
    $.fn.easyToolTip = function (options) {

        // toolTipを生成してbodyに追加しておく
        var toolTip = $('<div id="toolTip"></div>').hide();
        $('body').append(toolTip);

        $(this).filter(function () {
            // titleかaltを持っているものだけに絞る
            return this.title || this.alt;
        }).each(function () {

            var self = $(this);
            // titleがあればtitleを、なければaltをターゲットにする
            var target = this.title ? 'title' : 'alt';
            // ターゲットにした属性の値を保存する
            var tipText = self.attr(target);

            self.hover(function (e) {
                // ブラウザのツールチップが表示されるのを防ぐために一時的にtitle(alt)を削除
                self.attr(target, '');
                //alert(target);
                // toolTipにテキストを入れて表示
                toolTip.stop(true, true).fadeIn('fast').text(tipText).css({
                    position: 'absolute',
                    top: e.pageY + 23,
                    left: e.pageX + 1
                })
            }, function () {
                // title(alt)を元に戻す
                self.attr(target, tipText);
                // toolTipを非表示にする
                toolTip.fadeOut('fast');
            }).mousemove(function (e) {
                // カーソルに追従させる
                toolTip.css({
                    top: e.pageY + 23,
                    left: e.pageX + 1
                });
            });

        });
    }
})(jQuery);

jQuery(function ($) {
    // ツールチップの実行
    $('img,a,span').easyToolTip();
});


//form
var GuideSentence = 'メールアドレスご記入欄';

function ShowFormGuide(obj) {
    // 入力案内を表示
    if (obj.value == '') {
        obj.value = GuideSentence;
        obj.style.color = '#000000';
    }
}

function HideFormGuide(obj) {
    // 入力案内を消す
    if (obj.value == GuideSentence) {
        obj.value = '';
        obj.style.color = '#000000';
    }
}