(function($) {
	//=====================================Main Routine
	//window onload
	$(function() {
		/* rollover init */
		setRollovers();

		/* bt_menu_selection initial */
		$("body.menu_selection_purpose").find("#sec_menu_selection_purpose").fadeIn("slow");
		$("body.menu_selection_ingredient").find("#sec_menu_selection_ingredient").fadeIn("slow");

		/* bt_menu_selection click */
		$("#bt_menu_selection_purpose a").click(
			function () {
				$("body").removeClass("menu_selection_ingredient").removeClass("menu_selection_ranking").addClass("menu_selection_purpose");
				$("#sec_menu_selection_ingredient").hide();
				$("#sec_menu_selection_purpose").fadeIn("slow");
			}
		);
		$("#bt_menu_selection_ingredient a").click(
			function () {
				$("body").removeClass("menu_selection_purpose").removeClass("menu_selection_ranking").addClass("menu_selection_ingredient");
				$("#sec_menu_selection_purpose").hide();
				$("#sec_menu_selection_ingredient").fadeIn("slow");
			}
		);

		/* menu selection - checkbox */
		/*
		$(".checklist_table input:checked").parent().addClass("selected");

		$(".checklist_table .checkbox-select").click(
			function(event) {
				event.preventDefault();
				$(this).parent().addClass("selected");
				$(this).parent().find(":checkbox").attr("checked","checked");
			}
		);

		$(".checklist_table .checkbox-deselect").click(
			function(event) {
				event.preventDefault();
				$(this).parent().removeClass("selected");
				$(this).parent().find(":checkbox").removeAttr("checked");
			}
		);
		*/

		/* table.product_table cell hover */
		$("table.product_table td").hover(
			function () {
				$(this).addClass("td_hover");
			},
			function () {
				$(this).removeClass("td_hover");
			}
		);

		/* table.product_table cell click */
		$("table.product_table td").click(
			function () {
				strLink=$(this).find("a").attr("href");
				location.href=strLink;
			}
		);

		/* store_index - table.data_table cell hover */
		$("body#store_index table.data_table td.td_ch").hover(
			function () {
				$(this).addClass("td_ch_hover");
			},
			function () {
				$(this).removeClass("td_ch_hover");
			}
		);
		$("body#store_index table.data_table td.td_sl").hover(
			function () {
				$(this).addClass("td_sl_hover");
			},
			function () {
				$(this).removeClass("td_sl_hover");
			}
		);
		$("body#store_index table.data_table td.td_ex").hover(
			function () {
				$(this).addClass("td_ex_hover");
			},
			function () {
				$(this).removeClass("td_ex_hover");
			}
		);

		/* store_index - table.data_table cell click */
		$("body#store_index table.data_table td").click(
			function () {
				strLink=$(this).find("a").attr("href");
				location.href=strLink;
			}
		);


	});

})(jQuery)


/* popup window */
function openWin(url, name, W, H) {
	window.open(url, name, 'toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width='+ W +',height='+ H);
}
function openWinNoscrollbars(url, name, W, H) {
	window.open(url, name, 'toolbar=no,status=no,menubar=no,scrollbars=no,resizable=yes,directories=no,location=no,width='+ W +',height='+ H);
}


