jQuery.noConflict();
var j$ = jQuery;

j$(function () {
     j$('img').error(function(){
          j$(this).attr({src:'/snowtown/images/common/noimage.gif',alt:'画像が見つかりません'});
     });
});

j$(document).ready(function(){
	j$('#Links div').hide();
	j$('#Links div:first').show();
	j$('#Links ul.navi li:first').addClass('active');
	j$('#Links ul.navi li a').click(function(){
		j$('#Links ul.navi li').removeClass('active');
		j$(this).parent().addClass('active');
		var currentTab = j$(this).attr('href');
		j$('#Links div').hide();
		j$(currentTab).show();
		return false;
	});
});

//QAの回答
j$(document).ready(function(){
	j$("dd.answer").hide();
	j$("dt.question a").click(function(){
		j$(this).parent().next().slideToggle("300");
			return false;
		});
	j$("div#Enter").show();
	j$("div#ContainerHide").hide();
	j$("div#Enter a.close").click(function(){
		j$("div#Enter").slideToggle("300");
		j$("div#ContainerHide").slideToggle("300");
			return false;
		});
});

/*スムーススクロール*/
j$(function() {
	j$('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
			var target = j$(this.hash);
			target = target.length && target;
			if (target.length) {
				var sclpos = 20;
				var scldurat = 900;
				var targetOffset = target.offset().top - sclpos;
				j$('html,body')
					.animate({scrollTop: targetOffset}, {duration: scldurat, easing: "easeOutExpo"});
				return false;
			}
		}
	});
});

/*ライトボックス*/
j$(function() {
	j$('.news div a').lightBox(); 
});
j$(function() {
	j$('a[rel*=lightbox]').lightBox();
});

/*トップページニュースヘッドライン*/
j$(function() {
	function headline() {
		setTimeout(function() {
			headline();
			j$("#RecentNews li").not(':first').css('display', 'none');
			j$("#RecentNews li:first").fadeOut('normal', function() {
				j$(this).next().fadeIn('normal');
				j$(this).clone().appendTo("#RecentNews ul");
				j$(this).remove();
			});
		}, 2500);
	}
	var n_size = j$("#RecentNews li").size();
	if(n_size > 1) {
		headline();
	}
});

/*Skypeのスタイル削除*/
$(document).ready(function() {
	window.setTimeout(function() {
		$('.skype_pnh_container').html('');
		$('.skype_pnh_print_container*').removeClass('skype_pnh_print_container*');
	}, 800);
});


