//=============================================
// BlWin2()
//=============================================
$(function() {
	var anchors = $("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") &&
		anchor.getAttribute("rel") == "bl")
		anchor.target = "_blank";
	}
});

//=============================================
// SmartRollOver()
//=============================================
$(function() {
	var postfix = '_on';
	$('.ov').not('[src*="'+ postfix +'."]').each(function() {
		var img = $(this);
		var src = img.attr('src');
		var src_on = src.substr(0, src.lastIndexOf('.'))
		           + postfix
		           + src.substring(src.lastIndexOf('.'));
		$('<img>').attr('src', src_on);
		img.hover(
			function() {
				img.attr('src', src_on);
			},
			function() {
				img.attr('src', src);
			}
		);
	});
});


//=============================================
// PullDown()
//=============================================
$(function() {
	$("#gNavi li").hover( 
		function() {$(this).addClass("hov");},
		function() {$(this).removeClass("hov");}
	);
	$(".gN").hover(
		function() {
			if(window.addEventListener){
				$(this).children("ul").fadeIn(200);
			} else if(window.attachEvent){//IEでは透過PNGのfade()がうまく機能しないため分岐
			    $(this).children("ul").addClass("plHoverIE");
			}
			$(this).addClass("plHover");
		},
		function() {
			if(window.addEventListener){
				$(this).children("ul").fadeOut(150);
			} else if(window.attachEvent){//IEでは透過PNGのfade()がうまく機能しないため分岐
			    $(this).children("ul").removeClass("plHoverIE");
			}
			$(this).removeClass("plHover");
		}
//		function() {$(this).addClass("plHover");},
//		function() {$(this).removeClass("plHover");}
	);
});

//=============================================
// newIcon()
//=============================================
$(function() {
	$("#wList .new").append($("<img src='images/icon_new.png' alt='new' class='newIcon pfix'>"));
});

