/*
 * jQuery_inc.js
 *
 * Copyright (c) 2008 Tomohiro Okuwaki (http://www.tinybeans.net/blog/)
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * Modified: 2008-11-10
 * Document: http://www.tinybeans.net/blog/2008/11/10-173717.html
 *
 */
var myFlag=0;

function strRef (text) {
	text = text.replace(/&amp;/g,'&');
	text = text.replace(/&lt;/g,'<');
	text = text.replace(/&gt;/g,'>');
	text = text.replace(/&quot;/g,'"');
	return text;
}
function mact(){
$(document).ready(
function(){
$("a.fade,a.fade img,#header li a,span a,a.tag").hover(function(){
$(this).fadeTo("fast", 0.6); // マウスオーバーで透明度を30%にする
},function(){
$(this).fadeTo("fast", 1.0); // マウスアウトで透明度を100%に戻す
});
});
//set margin
$("div.block2").each(function(){
    jQuery(this).find("dl:odd").addClass("ml20");
});
//smoothscroll
//smooth scroll
jQuery.fn.extend({
  scrollTo : function(speed, easing) {
    <!-- hashの取得が出来なければ、処理を中断 -->
    if(!$(this)[0].hash || $(this)[0].hash == "#") {
      return false;
    }
    return this.each(function() {
      var targetOffset = $($(this)[0].hash).offset().top;
      $('html,body').animate({scrollTop: targetOffset}, speed, easing);
    });
  }
});

$(document).ready(function(){
  $('a[href*=#]').click(function() {
    $(this).scrollTo(1500,"easeOutExpo");
    return false;
  });
});

$(function() {
$("img[src$=png]").pngfix();
});
};
function slide(){
	$(function() {
		$("#slider").easySlider({
		auto: true, 
		continuous: true
	});
	});
}

$(function(){
	jQuery('.jquery_inc').each(function(){
		var inc_url = 'parts.html';   /* <== Edit it first */
		var inc_selector = jQuery(this).attr('title');
		var replace_inc = jQuery(this).filter('.replace_inc').size();
		var file_inc = jQuery(this).filter('.file_inc').size();
		var child_inc = jQuery(this).filter('.child_inc').size();
		inc_selector = strRef(inc_selector);

		if (jQuery.browser.msie) {
			/* for IE [start] */
			if (file_inc) {
				inc_selector = inc_selector.replace(/ ?/,':');
				inc_selector = inc_selector.split(':');
				inc_url = inc_selector[0];
				inc_selector = inc_selector[1];
			}
			if (child_inc) {
				var matchStr = inc_url.match(' ');
				if (matchStr) {
					inc_selector = inc_selector + '>*';
				}
			}
			jQuery.ajax({cache: false});
			if (replace_inc) {
				jQuery(this).load(
					inc_url,
					function (response,status) {
						var default_content = jQuery(this).clone();
						var inc_content = default_content.find(inc_selector);
						jQuery(this).replaceWith(inc_content);
						if(status=="success"&& myFlag==0){
						myFlag+=1;
						mact();
						}
					}
				);
			} else {
				jQuery(this).load(
					inc_url,
					function (response, status) {
						var default_content = jQuery(this).clone();
						var inc_content = default_content.find(inc_selector);
						jQuery(this).html(inc_content);
						if(status=="success"&& myFlag==0){
						myFlag+=1;
						mact();
						}
					}
				);
			}
			/* for IE [ end ] */
		} else {
			if (file_inc) {
				inc_url = inc_selector;
			} else {
				inc_url = inc_url + ' ' + inc_selector;
			}
			if (child_inc) {
				var matchStr = inc_url.match(' ');
				if (matchStr) {
					inc_url = inc_url + '>*';
				}
			}
			jQuery.ajax({cache: false});
			if (replace_inc) {
				jQuery(this).load(
					inc_url,
					function () {
						var default_content = jQuery(this).clone();
						var inc_content = default_content.html();
						jQuery(this).replaceWith(inc_content);
						mact();
					}
				);
			} else {
				jQuery(this).load(
					inc_url,
					function(){
					mact();
					}
					);
			}
		}
	});
});

slide();

