/********************/
/* 実績フェードイン */
/********************/
$(function(){
	$('.work').each(function(i){
		var item = $(this);
		item.css('opacity', 0);
		setTimeout(function(){
			item.animate({
				opacity: 5
			}, 800, 'linear', function(){
				if (!$.support.opacity) {
					if (this.style.filter && this.style.removeAttribute) {
						this.style.removeAttribute('filter');
					}
				}
			});
		}, i * 150);
	});
});


/**************/
/* スクロール */
/**************/
jQuery(document).ready(function() {
	jQuery('a[href^=#top]').bind("click", function(event) {
		event.preventDefault();
		var ziel = jQuery(this).attr("href");
		jQuery('html,body').animate({
				scrollTop: jQuery(ziel).offset().top
		}, 800);
		return false;
	});
});


/******************/
/* ロールオーバー */
/******************/
function smartRollover() {
	if(document.getElementsByTagName) {
		//変数の中に全ての画像要素をつっこむ
		var images = document.getElementsByTagName("img");
		
		//img要素数分ループ
		for(var i=0; i < images.length; i++) {
			//以下は、正規表現で"_off."にマッチしたものだけの処理
			if(images[i].getAttribute("src").match("_off."))
			{
				//src属性の中身を変換して再設定。
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}

/******************/
/* LiveBookMaster */
/******************/
function MM_openBrWindow(theURL,winName,popupwidth,popupheight) { //v2.0
  if (navigator.userAgent.indexOf('Safari') >= 0) {
    window.open(theURL,winName,'width=' + (popupwidth + 1) + ',height=' + (popupheight + 1) + ',resizable=yes');
  } else {
    window.open(theURL,winName,'width=' + popupwidth + ',height=' + popupheight + ',resizable=yes');
  }
}

