/*--------------------------------------------------------------------------*
 *  
 *  SmoothScroll JavaScript Library beta1
 *  
 *  MIT-style license. 
 *  
 *  2007 Kazuma Nishihata 
 *  http://www.webcreativepark.net
 *  
 *--------------------------------------------------------------------------*/
 
new function(){

	/*
	 *イベント追加用
	  -------------------------------------------------*/
	function addEvent(elm,listener,fn){
		try{ // IE
			elm.addEventListener(listener,fn,false);
		}catch(e){
			elm.attachEvent(
				"on"+listener
				,function(){
					fn.apply(elm,arguments)
				}
			);
		}
	}

	/*
	 *スムーズスクロール
	  -------------------------------------------------*/
	function SmoothScroll(a){
		if(document.getElementById(a.rel.replace(/.*\#/,""))){
			var e = document.getElementById(a.rel.replace(/.*\#/,""));
		}else{
			return;
		}
		
		//移動位置
		var end=e.offsetTop
		//現在位置
		var start=window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
		
		var flag=(end<start)?"up":"down";

		function scrollMe(start,end,flag) {

			setTimeout(
				function(){
					if(flag=="up" && start >= end){
						start=start-(start-end)/20-1;
						window.scrollTo(0,start)
						arguments.callee(start,end,flag);

					}else if(flag=="down" && start <= end){
						start=start+(end-start)/20+1;

						window.scrollTo(0,start)
						arguments.callee(start,end,flag);

					}else{
						scrollTo(0,end);
					}
				}
				,200
			);
			
		}
		scrollMe(start,end,flag)
	}

	/*
	 *スムーズ変換スクリプト
	  -------------------------------------------------*/
	addEvent(window,"load",function(){
		var anchors = document.getElementsByTagName("a");
		for(var i = 0 ; i<anchors.length ; i++){
			if(anchors[i].href.replace(/\#[a-zA-Z0-9]+/,"") == location.href.replace(/\#[a-zA-Z0-9]+/,"")){
				anchors[i].rel = anchors[i].href;
				anchors[i].href = "javascript:void(0)";
				anchors[i].onclick=function(){SmoothScroll(this)}
			}
		}
	});

}



/*--------------------------------------------------------------------------*
 *  
 *  ロールオーバー　javascript
 *  
 *--------------------------------------------------------------------------*/
 

function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");
		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				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);
}



/*--------------------------------------------------------------------------*
 *  
 *  Writers画像切り替え jQuery
 *  
 *--------------------------------------------------------------------------*/
  
  
  $(document).ready(function(){
							 
	$("ul.writersList li img").hover(function () {
      $(".targetArea img").css({ visibility:"hidden"});
    }, function () {
	  $(".targetArea img").css({ visibility:"visible"});
    });
    
    $("ul.writersList li img.id4").hover(function () {
	  $(".targetArea").css({ background:"url('http://www.j10.net/weblog/common/img/spot_list_01.gif')" });
    }, function () {
	  $(".targetArea").css({ background:"none" });
    });

    $("ul.writersList li img.id3").hover(function () {
	  $(".targetArea").css({ background:"url('http://www.j10.net/weblog/common/img/spot_list_02.gif')" });
    }, function () {
	  $(".targetArea").css({ background:"none" });
    });
	
    $("ul.writersList li img.id5").hover(function () {
	  $(".targetArea").css({ background:"url('http://www.j10.net/weblog/common/img/spot_list_04.gif')" });
    }, function () {
	  $(".targetArea").css({ background:"none" });
    });
	
    $("ul.writersList li img.id7").hover(function () {
	  $(".targetArea").css({ background:"url('http://www.j10.net/weblog/common/img/spot_list_05.gif')" });
    }, function () {
	  $(".targetArea").css({ background:"none" });
    });
	
    $("ul.writersList li img.id6").hover(function () {
	  $(".targetArea").css({ background:"url('http://www.j10.net/weblog/common/img/spot_list_06.gif')" });
    }, function () {
	  $(".targetArea").css({ background:"none" });
    });
	
    $("ul.writersList li img.id8").hover(function () {
	  $(".targetArea").css({ background:"url('http://www.j10.net/weblog/common/img/spot_list_08.gif')" });
    }, function () {
	  $(".targetArea").css({ background:"none" });
    });
	
    $("ul.writersList li img.id9").hover(function () {
	  $(".targetArea").css({ background:"url('http://www.j10.net/weblog/common/img/spot_list_09.gif')" });
    }, function () {
	  $(".targetArea").css({ background:"none" });
    });
	
    $("ul.writersList li img.id10").hover(function () {
	  $(".targetArea").css({ background:"url('http://www.j10.net/weblog/common/img/spot_list_10.gif')" });
    }, function () {
	  $(".targetArea").css({ background:"none" });
    });
	
    $("ul.writersList li img.id11").hover(function () {
	  $(".targetArea").css({ background:"url('http://www.j10.net/weblog/common/img/spot_list_11.gif')" });
    }, function () {
	  $(".targetArea").css({ background:"none" });
    });
	
    $("ul.writersList li img.id12").hover(function () {
	  $(".targetArea").css({ background:"url('http://www.j10.net/weblog/common/img/spot_list_12.gif')" });
    }, function () {
	  $(".targetArea").css({ background:"none" });
    });
	
    $("ul.writersList li img.id13").hover(function () {
	  $(".targetArea").css({ background:"url('http://www.j10.net/weblog/common/img/spot_list_13.gif')" });
    }, function () {
	  $(".targetArea").css({ background:"none" });
    });
	
    $("ul.writersList li img.id14").hover(function () {
	  $(".targetArea").css({ background:"url('http://www.j10.net/weblog/common/img/spot_list_dummy.gif')" });
    }, function () {
	  $(".targetArea").css({ background:"none" });
    });

    $("ul.writersList li img.id17").hover(function () {
	  $(".targetArea").css({ background:"url('http://www.j10.net/weblog/common/img/spot_list_dummy.gif')" });
    }, function () {
	  $(".targetArea").css({ background:"none" });
    });
	
  });
  


