// JavaScript Document

//▼▼　ロールオーバーした時の効果　▼▼
$(function(){
    $("img.rollover").each(function(){
        $("<img>").attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"));
    });
    if($.browser.msie && $.browser.version<7){
		$("img.alpha").each(function(){
            $(this)
                .data("src",$(this).attr("src"))
                .attr("src","image/transparent.gif")
                .css("filter","progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+$(this).data("src")+"',sizingMethod='scale')")
        });
        $("img.rollover").each(function(){
            $(this)
                .data("src",$(this).attr("src"))
                .attr("src","image/transparent.gif")
                .css("filter","progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+$(this).data("src")+"',sizingMethod='scale')")
            
        }).mouseover(function(){
            $(this).css("filter","progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+$(this).data("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2")+"',sizingMethod='scale')")
        }).mouseout(function(){
            $(this).css("filter","progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+$(this).data("src")+"',sizingMethod='scale')")
        })
    }else{
        $("img.rollover").mouseover(function(){
            $(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"));
        }).mouseout(function(){
            $(this).attr("src",$(this).attr("src").replace(/^(.+)_on(\.[a-z]+)$/, "$1$2"));
        });
    }
});


//▼▼　IE6以下でメニューに現れる線を消す　▼▼
$(function(){
	$("#side").fadeTo(0,0);
	$("#side").fadeTo(0,1);
});
//▼▼　IE7以下で不必要なツールチップを非表示　▼▼
$(function(){
	if($.browser.msie && $.browser.version<8){
		$("img:not('nav img')").attr("title","");
	}
});
//▼▼　"別ウィンドウで開きます"ツールチップを自動表示　▼▼
$(function(){
	$("a[target='_blank']").attr("title","別ウィンドウで開きます");
});
//▼▼　濱亮平のページの表示方法　▼▼
$(function(){
	$("a[href$='ryohei/']").click(function(){
		u = $(this).attr("href");
		window.open(u,"","Width=951,top=50,left=50,scrollbars=1");
		return false;
	});
});
//▼▼　FireFoxのバグ回避　▼▼
//function resetRollover() {
//	var images = $('img.rollover');
//	for(var i = 0; i < images.length; i++){
//		if(images[i].getAttribute("src").match("_on.")) {
//			images[i].setAttribute("src", images[i].getAttribute("src").replace("_on.", "."));
//		}
//	}
//	$("body").css("display","block");
//}
