/* +++Mission Statement++++++++++++++++++++++++++++++++++++++++++++++
+
+ Update:2010-11-04
+
+ http://www.ms-inc.co.jp/
+ 
+ EditiorID:MS
+
+ + use library:jquery-1.4.1.min.js
+ +@@@
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */

/* On Load Action ++++++++++++++++++++++++++++++++++++++++++ */
/*@cc_on var doc = document; eval('var document = doc');@*/

// escape conflict
jQuery(function($){

//Mouseover
function initRollOverImages() {
  var image_cache = new Object();
  $("img.imgOn,input.imgOn").each(function(i) {
    var imgsrc = this.src;
    var dot = this.src.lastIndexOf('.');
    var imgsrc_on = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
    image_cache[this.src] = new Image();
    image_cache[this.src].src = imgsrc_on;
    $(this).hover(
      function() { this.src = imgsrc_on; },
      function() { this.src = imgsrc; });
  });
}
$(document).ready(initRollOverImages);


/*Auto TargetBlank*/
$(document).ready( function () {
    $('.blank').click(function(){
        window.open(this.href, '_blank');
        return false;
    });
});

//Gnavi mouse over
/*
$("#gNavi li a").fadeTo(1,0.0);
$("#gNavi li a").hover(function(){
        $(this).fadeTo(300,1.0);
    },
    function(){
        $(this).fadeTo(300,0);
    });
*/

//PullDown

$(function(){
	$("ul#gNavi ul").hide()
	$("ul#gNavi li").hover(function(){
		$("> ul:not(:animated)" , this).slideDown({
			height : "toggle",
			opacity : "toggle"
		}, 500 );
	},
	function(){
		//$("> ul" , this).slideUp("fast");
		$("> ul:not(:animated)" , this).slideUp({
			height : "toggle",
			opacity : "toggle"
		}, 500 );
	});
});


//Page scroll
jQuery.fn.extend({
  scrollTo : function(speed, easing) {

    if(!$(this)[0].hash || $(this)[0].hash == "#") {
      return false;
    }
    return this.each(function() {
      var targetOffset = $($(this)[0].hash).offset().top;
      $('html,body').animate({scrollTop: targetOffset}, speed, easing);
    });
  }
});

$(document).ready(function(){
  $('a[href*=#]').click(function() {
    $(this).scrollTo(300);
    return false;
  });
});


//site edit
//toppage:left column
$(".numTxt:last").css("background", "none");

//toppage:right column
$("#siteBox li:last").css("background", "none");


$(function(){
	$("#siteBox li span").hide()
	$("#siteBox li a").toggle(function(){
		$("> span:not(:animated)" , this).slideDown({
			height : "toggle",
			opacity : "toggle"
		}, 500 );
	},
	function(){
		$("> span" , this).slideUp("fast");
	});
});


// escape conflict close
});
