//
//	jquery RollOver用
//	オーバー画像には_on.gifにする。
//	対応tag : [input],[img]
//	使用する場所に rel="over"をいれる。
//
$.fn.RollOver = function()
{
	$(this).hover(function(){
		mouseOver($(this));
		return true;
	},function(){
		mouseOut($(this));
		return true;
	});
	
	_preload($(this));
	
	function mouseOver (el)
	{
		$(el).attr("src",$(el).attr("src").replace(".gif", "_on.gif"));
	}
	
	function mouseOut (el)
	{
		$(el).attr("src",$(el).attr("src").replace("_on.gif", ".gif"));
	}
	
	function _preload (el)
	{
		var preLoadImg = new Image();
		preLoadImg.src = $(el).attr("src").replace(".gif", "_on.gif");
	}
}

//	プルダウンメニュー

$.fn.PullDownMenu = function()
{
	$(this).bind('mouseover',function(){
		if($(this).children("img")){
			$(this).children("img").attr("src",$(this).children("img").attr("src").replace(".gif", "_on.gif"));
		}
		$(this).find(".menuChild").show();
	});
	
	$(this).bind('mouseout',function(){
		if($(this).children("img")){
			$(this).children("img").attr("src",$(this).children("img").attr("src").replace("_on.gif", ".gif"));
		}
		$(this).find(".menuChild").hide();
	});

}

// アコーディオン

$.fn.Accordion = function()
{
	$(this).bind('click',function(){
		
		var tog = $(this).children("img").attr("src");
		if(tog.match(/\_on\.gif/)){
			$(this).children("img").attr("src",$(this).children("img").attr("src").replace("_on.gif", ".gif"));
		}else{
			$(this).children("img").attr("src",$(this).children("img").attr("src").replace(".gif", "_on.gif"));
		}
		
		$(this).parent(".toggle").next("dd").slideToggle('600');
	});
}


/*ボックス表示・非表示*/
$.fn.toggleBox = function()
{
	$(this).bind('click',function(){
		
		$(this).parent(".toggle").next("input").toggle();
	});
}


/*別ウィンドウ*/
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



/*フォーム可視*/
function Form_visible(){

radio = document.getElementsByName('mail-send') 
	if(radio[2].checked){
	document.getElementById("mail-body").style.display ="";
		}else{
	document.getElementById("mail-body").style.display ="none";
		}
}
