/*!
 *
 * Copyright 2010
 *
 *      ;;;;;;;;;       ;;;;;;;;;;;;      ;;;;;;;;;;              
 *    ;;;       ;;;     ;;;       ;;;   ;;;        ;;;            
 *   ;;;          ;;    ;;;       ;;;   ;;          ;;            
 *   ;;;          ;;    ;;;;;;;;;;;;   ;;;          ;;;           
 *   ;;;          ;;    ;;;     ;;      ;;          ;;            
 *    ;;;        ;;;    ;;;      ;;;    ;;;        ;;;            
 *     ;;;;;  ;;;;      ;;;       ;;;     ;;;;  ;;;;          
 *          ;                                 ;;                     
 *
 * Date: Fri May 28 22:33:48 2010 -0900
 */

			
//　Trigger for Scroll
jQuery.easing.quart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

// Trigger for Style Select
$(document).ready(function(){
	//set max height
	$('#location_selector').sSelect({ddMaxHeight: '300px'});
})

$(document).ready(function(){
//
// Image Rollover
//
	$("img[src*='_on']").addClass("current");

	$("img,input").mouseover(function(){
		if ($(this).attr("src")){
			$(this).attr("src",$(this).attr("src").replace("_off.", "_on."));
		}
	});

	$("img[class!='current'],input").mouseout(function(){
			if ($(this).attr("src")){
				$(this).attr("src",$(this).attr("src").replace("_on.", "_off."));
			}
	});
//
// External Link
//
	$("a[rel=external]").click(function(){
		window.open(this.href,"_blank");
	return false;
	});

//
// <a href="#***">の場合、スクロール処理を追加
//
	jQuery('a[href^=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
			var $target = jQuery(this.hash);
			$target = $target.length && $target || jQuery('[name=' + this.hash.slice(1) +']');
			if ($target.length) {
				var targetOffset = $target.offset().top;
				jQuery('html,body').animate({ scrollTop: targetOffset }, 1200, 'quart');
				return false;
			}
		}
	});
});
		
		
// select menu link
function selectorWebsiteURL(obj){
	if(obj.selectedIndex>0){
		window.open(obj.options[obj.selectedIndex].value);
	}
	obj.selectedIndex=0;
}


