jQuery.easing.easeOutQuart=function(x,t,b,c,d){return -c*((t=t/d-1)*t*t*t-1)+b;};

var ie = (function(){
var undef,v = 3,div = document.createElement('div'),all = div.getElementsByTagName('i');
while (div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->',all[0]);
return v > 4 ? v : undef;
}());

$(function(){
	//*ga track
	$('a[href^=http]')
	.not("[href*="+location.hostname+"]").attr('onclick','pageTracker._link(this.href); return false;')
	.end()
	.not("[href*="+location.protocol +"]").attr('onclick','pageTracker._link(this.href); return false;')
	
   $('a[href^=#]').click(function() {
      var href= $(this).attr("href");
      var target = $(href == "#" || href == "" ? 'html' : href);
      var position = target.offset().top;
      $($.browser.safari ? 'body' : 'html').animate({scrollTop:position}, 750, 'easeOutQuart');
      return false;
   });
	
});

$(window).load(function() {
	if(ie===6){ $("#footer").css('margin-top','1px') }
});

/////////////////////////////////////////////////////////////////////////////////

initRollOverImages = function(elm){ // rollover共通処理  _on.拡張子
    $(elm).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"));
    })
} 
initRollOverFead = function(elm2){ // rollover共通フェード処理 
    $(elm2).mouseover(function(){
//		console.log($(this).find("img"));	$(this).children("img")
        $(this).fadeTo("fast", 0.7);
    }).mouseout(function(){
       $(this).fadeTo("fast", 1);
    })
} 
function gotoTop(){
	$("html, body").animate({scrollTop: "0px"}, 500);
}
function gotoBottom(){
	$("html, body").animate({scrollTop: $('#main').height()+200 }, 500);
}

function getScrollPosition(){
　　return (document.documentElement.scrollTop || document.body.scrollTop);
}




