$(function(){
if($.browser.msie)
	$("body").addClass("ltsp");
	
//window.open
if(!$.browser.safari) {

	$("a.openwin").each(function () {
		var owUrl = $(this).attr("href");
		var owTxt = $(this).text();
		$(this).after('&nbsp;<a href="'+owUrl+'" class="owimg" title="'+owTxt+'を別窓で開く"><img src="/img/openwin.gif" alt="別窓で開く" /></a>&nbsp;');
	});
	$("a.owimg").click(function(){
		window.open(this.href);
		return false;
	});
}

//smoothscroll
	$('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
			var target = $(this.hash);
			target = target.length && target;
			if (target.length) {
				var sclpos = 30;
				var scldurat = 1200;
				var targetOffset = target.offset().top - sclpos;
				$('html,body')
					.animate({scrollTop: targetOffset}, {duration: scldurat, easing: "easeOutExpo"});
				return false;
			}
		}
	});
});
