/*--------------------------------------------------------------------------*
 *  
 *  blinkAnchor JavaScript Library beta 3
 *  
 *  jQuery is required.
 *  
 *  MIT-style license. 
 *  
 *  2008.08.31 Koji Kimura @ STARRYWORKS inc.
 *  http://www.starryworks.co.jp/
 *  
 *--------------------------------------------------------------------------*/

new function() {
	function blinkAnchor() {
		$(".blinkAnchor").click(clk);
	}
	function clk(e) {
		var a = e.target;
		var i = "";
		if (a.hash && a.hash.replace('#', '')) i = a.hash;
		else if ( a.href && a.href.split("#").pop()) i = "#"+a.href.split("#").pop();
		if ( i && $(i).length ) {
			$(i).fadeOut(200,function(e) {$(i).fadeIn(200,function(e) {$(i).fadeOut(200,function(e) {$(i).fadeIn(200,function(e) {$(i).fadeOut(200,function(e) {$(i).fadeIn(200);});});});});});
			var sTop = $(i).offset().top;
			var sLeft = $(i).offset().left;
			$('html,body').animate({scrollTop: sTop, scrollLeft:sLeft}, 600);
		}
		return false;
	}
	$(document).ready(blinkAnchor);
}

