/*
 * UPDATE : 2011.03.03
 * AUTOR : watuu
 * 
 *
 * 1.reset
 * 2.hover img
 * 3.IE png
 * 4.other
 *
*/

/*
 1.reset [
----------------------------------------------------------- */
$(function(){
	//外部リンクにtarget="_blank"を付与
	$("a[href^='http://']").attr("target","_blank");
	$("a[href$='.pdf']").attr("target","_blank");
	//css3のクラスを追加
	$('body :first-child').addClass('firstChild');
	$('body :last-child').addClass('lastChild');
	$('ul, ol').each(function(){
		$(this).children('li:odd').addClass('even');
		$(this).children('li:even').addClass('odd');
	});
	$('table, tbody').each(function(){
		$(this).children('tr:odd').addClass('even');
		$(this).children('tr:even').addClass('odd');
	});
	$('body :empty').addClass('empty');
});

/*
 2.hover img [
----------------------------------------------------------- */
$(function(){
  $("a img[src$='.gif'],a img[src$='.jpg']").hover(function(){
				$(this).animate({opacity: 0.65},150);
			},
			function(){
				$(this).animate({opacity: 1},150);
			});
});

/*
 3.IE png [
----------------------------------------------------------- */
$(function(){
	if(jQuery.browser.msie && (parseInt(jQuery.browser.version) == 6 || parseInt(jQuery.browser.version) == 7 || parseInt(jQuery.browser.version) == 8 || parseInt(jQuery.browser.version) == 9 )){
		//$("img[src$='.png']").fixPng();
	}
}); 

/*
 4.other [
----------------------------------------------------------- */
$(function(){
	$("#fnavi dl,#box_contents div.section").each(function(n){
		$(this).addClass("nth-child"+(n+1));
	});
});

function swappSwf(){
	$("body#index").attr("style","background:#fff url(images/bg_body_top.jpg) 0 0 repeat-x;padding-top:0px;");
	$("#wrapp_swf").remove();
	$("#wrapp").fadeIn();
	$('#slider').nivoSlider({
		directionNav: false,
		controlNav: false,
		animSpeed: 500,
		pauseTime: 3000
	});
	$.getScript("js/script.js");
}

