// JavaScript Document
$(function()
{
//プリロードイメージ
	var buttonImg=$('#contents img[src*="_off"]');
	buttonImg.each(function()
		{
			plImg=$(this).attr("src").split("_");
			if(plImg.length==3){
				crtFileType=plImg[2].split(".");
					$(this).attr("src",plImg[0]+"_"+plImg[1]+"_on."+crtFileType[1]);
					$(this).attr("src",plImg[0]+"_"+plImg[1]+"_off."+crtFileType[1]);
			}else if(plImg.length==2){
				crtFileType=plImg[1].split(".");
					$(this).attr("src",plImg[0]+"_on."+crtFileType[1]);
					$(this).attr("src",plImg[0]+"_off."+crtFileType[1]);
			}
		});
//ロールオーバー
	buttonImg.hover(
		function(){
			crtImg=$(this).attr("src").split("_");
			if(crtImg.length==3){
				crtFileType=crtImg[2].split(".");
				$(this).attr("src",crtImg[0]+"_"+crtImg[1]+"_on."+crtFileType[1]);
			}else if(crtImg.length==2){
				crtFileType=crtImg[1].split(".");
				$(this).attr("src",crtImg[0]+"_on."+crtFileType[1]);
			}
		},
		function(){
			crtImg=$(this).attr("src").split("_");
			if(crtImg.length==3){
				crtFileType=crtImg[2].split(".");
				$(this).attr("src",crtImg[0]+"_"+crtImg[1]+"_off."+crtFileType[1]);
			}else if(crtImg.length==2){
				crtFileType=crtImg[1].split(".");
				$(this).attr("src",crtImg[0]+"_off."+crtFileType[1]);
			}
		});

//おためし査定
	/*$("#asm-url").focus(function()		{if($(this).val()=="査定したいサイトのアドレス"){$(this).val("");}});
	$("#asm-sales").focus(function()	{if($(this).val()=="月間売上（非商用サイトは0円）"){$(this).val("");}});
	$("#asm-cost").focus(function()		{if($(this).val()=="サイトの維持にかかる経費の合計"){$(this).val("");}});
	$("#asm-pv").focus(function()		{if($(this).val()=="月間ページビュー(総閲覧数)"){$(this).val("");}});
	$("#asm-mail").focus(function()		{if($(this).val()=="連絡先メールアドレス（任意）"){$(this).val("");}});
	$("#asm-mail2").focus(function()	{if($(this).val()=="もう一度入力してください"){$(this).val("");}});*/
//faq
	$("#faqTable tr").each(function()
	{
		crtTd = $(this).attr("id").split("-");
		if(crtTd[0] == "A")
		{
			$(this).hide();
		}else if(crtTd[0] == "Q")
		{
			$(this).attr("rel","close");
		}
	});
	$("#faqTable tr[id *= 'Q']").click(function()
	{
		if($(this).attr("rel") == "close")
		{
			$("#A-" + $(this).attr("id").split("-")[1]).fadeIn(500);
			$(this).attr("rel","open");
		}else{
			$("#A-" + $(this).attr("id").split("-")[1]).hide();
			$(this).attr("rel","close");
		}
	});
});
