﻿jQuery(function(){
	// Image rollover
	var image_cache = new Object();
	jQuery("img.btn").each(function(i){
		var imgsrc = this.src;
		var dot = this.src.lastIndexOf('.');
		var imgsrc_on = this.src.substr(0, dot) + '_f2' + this.src.substr(dot, 4);
		image_cache[this.src] = new Image();
		image_cache[this.src].src = imgsrc_on;
		jQuery(this).hover(
			function() { this.src = imgsrc_on; },
			function() { this.src = imgsrc; }
		);
	});

	//alyobtn、menubtnの読み込み(UTF-8)
	jQuery.getJSON("http://www.alyo.jp/js/alyobtns.jsonp?callback=?")
});

//alyobtn、menubtnの表示
var jsonColback = function(jsonData){
	jQuery(jsonData.btns).each(function(){
		jQuery("div#alyobtn").append(this.alyobtn);
		jQuery("div.menubtn640").replaceWith(this.menubtn640);
		jQuery("div.menubtn620").replaceWith(this.menubtn620);
		jQuery("div#top_message").append(this.top_message);
		jQuery("div#top_message620").append(this.top_message620);
	});
}

// Page Print
function this_print() {
	window.print();
}

//faq用on-off切り替え
function faq(id) {
	if (document.getElementById(id).style.display == "none") {
		document.getElementById(id).style.display="block";
	} else {
		document.getElementById(id).style.display="none";
	}
}