$(document).ready(function(){
	var targetimg=$('#btn_detail img,#gnav img,#l_contact img,#top_detail img,#btm_contact img');
	for(var j=0;j<targetimg.length;j++){
		if($(targetimg[j]).parent().parent().attr('class') != $('body').attr('class').replace("page_","")){
			$(targetimg[j]).mouseover(function(ev){
				img_on(ev);
			});
			$(targetimg[j]).mouseout(function(ev){
				img_off(ev);
			});
		}else{
			var newsrc=$(targetimg[j]).attr('src').replace("_off","_on");
			$(targetimg[j]).attr('src',newsrc);
		}
	}	
	
	if($('input#subject_inq').attr('checked')==true){
		inq_show();
	}
	if($('input#subject_cost').attr('checked')==true){
		cost_show();
	}

	$('input#subject_inq').click(inq_show);
	$('input#subject_cost').click(cost_show);

});

function img_on(ev){
	var newsrc=$(ev.target).attr('src').replace("_off","_on");
	$(ev.target).attr('src',newsrc);

}

function img_off(ev){
	var newsrc=$(ev.target).attr('src').replace("_on","_off");
	$(ev.target).attr('src',newsrc);
}

function inq_show(){
	$('tr.cost_only').css('display','none');	
	$('tr.inq_only').css('display','');	
}


function cost_show(){
	$('tr.cost_only').css('display','');	
	$('tr.inq_only').css('display','none');	
}
