$(function(){
	$('#header > *').remove();
	$('#header').load('/header.html',function(){$('#header').fadeIn('slow')});
});


/*

function hasClassRecursive(elm, classStr) {
  var flag = false;
  jQuery(elm).parents().each(function() {
    if (jQuery(this).hasClass(classStr)) {
      flag = true;
      return false;
    }
  });
  return flag;
}
function addClassToCurrentImages(currentStr){
	if (!currentStr) currentStr = "current";
	var curHref = location.href.toString().replace(/[#?].*$/, "");
	var curDir = curHref.substring(0, curHref.lastIndexOf("/") + 1);
	if (curHref == curDir) {
		curHref += "index.html";
	}
	jQuery("a").each(function(){
		if (hasClassRecursive(this, 'jqexclude')) {
			return;
		}
		var theHref = this.href;
		var prefixSearch = (theHref.substring(theHref.length - 1) == "/");
		var has = jQuery(this).hasClass(currentStr);
		var cur = (prefixSearch ? curHref.match(new RegExp('^' + theHref)) : theHref == curHref);
		if (!has && cur) {
			jQuery(this).addClass(currentStr);
		}
		else if (has && !cur) {
			jQuery(this).removeClass(currentStr);
		}
	});
}
*/


// スムーズスクロール用
jQuery.fn.jqScroll = function(props) {
  props = jQuery.extend({duration: 'fast', easing: 'swing'}, (props?props:{}));
  this.each(function(){
    jQuery(this).click(function(){
      if (this.props == undefined) {
        this.props = props;
      }
      var scrollTop = jQuery(this.href.replace(/^.*#/, '#')).offset().top;
      var maxTop = jQuery(document).height() - jQuery(window).height();
      var tmp = {};
      for(key in this.props) {
        tmp[key] = this.props[key];
      }
      jQuery('html,body').animate({scrollTop: parseInt(Math.min(scrollTop, maxTop), 10)}, tmp);
      return false;
    });
  });
}
function setJqScroll() {
	jQuery('.jqScroll').jqScroll();
}


/*
jQuery(function(){
// 画像コンテンツの補足テキストを削除
	jQuery(".imgContent .imgText").remove();
	// current image
	addClassToCurrentImages("current",true);
	//image hover
	var _si=function(ev){
		if($t=jQuery(this))var s=$t.attr("src_"+ev.type);
		if(s)this.src=s;
	};
	var _sii=function(ev){
		if($i=jQuery("img",this))$i.trigger(ev.type);
	};
	var _ri=function(){
		$t=jQuery(this.t);
		if(hasClassRecursive(this.t,"current")){
			if(this.e=="mouseenter"){
				$t.attr("src",this.src).unbind("mouseenter").unbind("mouseleave");
			}
		}else if($t){
			$t.attr("src_"+this.e,this.src);
		}
	};
	jQuery("img:not(.jqexclude)").each(function(){
		$t=jQuery(this);
		$t.hover(_si,_si);
		var o={
			"mouseleave":$t.attr("src"),
			"mouseenter":$t.attr("src").replace(/\.(jpe?g|gif|png)$/,'_on.$1')
		};
		for(k in o){
			var i=new Image();
			jQuery(i).bind("load",_ri);
			i.t=this;i.e=k;i.src=o[k];
		}
	});
	jQuery("a.hover").each(function(){
		jQuery(this).hover(_sii,_sii);
	});

//target="_blank"自動化
	jQuery('a[@href^="http://"]').click(function(){
		if (opt = jQuery(this).attr('rel')) {
			window.open(this.href, '_blank', opt);
		}
		else {
			window.open(this.href, '_blank');
		}
		return false;
	});
});
*/



