// index.js

$(function(){
	
 // Doropdown navi
	
	$("#navi ul li").hover(function(){
		$("> ul:not(:animated)" , this).animate({height:"toggle", opacity:"toggle"}, 80 );
	},
	function(){	$("> ul" , this).fadeOut("fast"); });

 // _blank

	$('.blank').click(function(){
		window.open(this.href, '_blank');
		return false;
	});

 // Corner
	
//	$('.corner').corner({antiAlias:true});

 // Effect Images
 
	$(".banner img").fadeTo(0, 0.7, 0 );
	$(".banner img").hover(function(){$(this).fadeTo(0,1.0);}, function(){$(this).fadeTo(0,0.7);});
	$(".rbanner img").fadeTo(0, 1.0, 0 );
	$(".rbanner img").hover(function(){$(this).fadeTo(0,0.7);}, function(){$(this).fadeTo(0,1.0);});

 // Preload Images

	$.preloadImages = function(){
		for(var i=0; i<arguments.length; i++){
			jQuery("<img>").attr("src", arguments[i]);
		}
	}

	$.preloadImages("images/body.png", "images/logo.png", "images/header-top.png", "images/navi.png");

 // Smooth Scroll

 $('a[href*=#]').click(function() {
  if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
   var $target = $(this.hash);
   $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
   if ($target.length) {
    var targetOffset = $target.offset().top;
    $('html,body').animate({scrollTop: targetOffset}, 300);
    return false;
   }
  }
 });
});

