//定義変数
///////////////////
//var f_page_ad = "http://www./"; //ホームページのアドレス
//var f_sent = "/"; //区切り
///////////////////
var f_page_ad = ""; //ホームページのアドレス(ローカル)
var f_sent = "\\"; //区切り
///////////////////

//コンテンツテーブル
var contentsTbl = new Array();
//0:ファイル名 1:ページ名 2:親ページ 3:格納フォルダ名
contentsTbl['index'] = new Array('index.html','トップページ','',f_page_ad);
contentsTbl['privacypolicy'] = new Array('privacypolicy.html','個人情報の保護について','index',f_page_ad);
contentsTbl['syoutorihikihou'] = new Array('syoutorihikihou.html','特定商取引について','index',f_page_ad);
contentsTbl['pro_order'] = new Array('pro_order.html','ご注文方法','index',f_page_ad);
contentsTbl['pro_order_af'] = new Array('pro_order_af.html','お支払・商品発送について','index',f_page_ad);
contentsTbl['company_intro'] = new Array('company_intro.html','会社紹介','index',f_page_ad);
contentsTbl['question'] = new Array('question.html','お問合せ','index',f_page_ad);
contentsTbl['basket'] = new Array('basket.html','買い物かご','index',f_page_ad);
contentsTbl['link'] = new Array('link.html','リンク','index',f_page_ad);

contentsTbl['item_set'] = new Array('item_set.html','セット商品','index',f_page_ad);
contentsTbl['item_pi_tanaka1'] = new Array('item_pi_tanaka1.html','にしん漬','index',f_page_ad);
contentsTbl['item_pi_tanaka2'] = new Array('item_pi_tanaka2.html','北海道のお漬物','index',f_page_ad);
contentsTbl['item_pi_tanaka3'] = new Array('item_pi_tanaka3.html','ピクルス','index',f_page_ad);
contentsTbl['item_fi_nihon'] = new Array('item_fi_nihon.html','利尻・留萌 日本海の魚','index',f_page_ad);
contentsTbl['item_fi_oho'] = new Array('item_fi_oho.html','網走・知床・羅臼 オホーツク海の魚','index',f_page_ad);
contentsTbl['item_fi_ku'] = new Array('item_fi_ku.html','明太子さんま','index',f_page_ad);
contentsTbl['item_fi_gin'] = new Array('item_fi_gin.html','北海道 銀だら','index',f_page_ad);
contentsTbl['item_season_item'] = new Array('item_season_item.html','季節の商品','index',f_page_ad);
contentsTbl['item_ar_uni'] = new Array('item_ar_uni.html','利尻エゾバフン 一夜漬純粒うに','index',f_page_ad);
contentsTbl['item_ar_rishiri'] = new Array('item_ar_rishiri.html','利尻昆布商品','index',f_page_ad);
contentsTbl['item_ar_wasabi'] = new Array('item_ar_wasabi.html','北海道特産品 山わさび','index',f_page_ad);
contentsTbl['item_ar_souya'] = new Array('item_ar_souya.html','北海道特産品 宗谷の塩','index',f_page_ad);
contentsTbl['item_ar_hako'] = new Array('item_ar_hako.html','北海道函館 特選加工品','index',f_page_ad);
contentsTbl['item_ar_kaba'] = new Array('item_ar_kaba.html','樺のアナ茸エキス','index',f_page_ad);
contentsTbl['item_gift'] = new Array('item_gift.html','ギフト商品','index',f_page_ad);
contentsTbl['item_asahiyamazoo'] = new Array('item_asahiyamazoo.html','旭山動物園DVD','index',f_page_ad);
contentsTbl['item_sw_waraku1'] = new Array('item_sw_waraku1.html','わらく堂スイートポテト','index',f_page_ad);
contentsTbl['item_sw_waraku2'] = new Array('item_sw_waraku2.html','わらく堂スイートオーケストラ','index',f_page_ad);
contentsTbl['item_sw_waraku3'] = new Array('item_sw_waraku3.html','わらく堂かご盛り','index',f_page_ad);
contentsTbl['item_sw_waraku4'] = new Array('item_sw_waraku4.html','わらく堂サウンドケーキ','index',f_page_ad);
contentsTbl['item_sw_cake'] = new Array('item_sw_cake.html','北海道素材ホールケーキ','index',f_page_ad);
contentsTbl['item_sw_cookie'] = new Array('item_sw_cookie.html','生クッキー','index',f_page_ad);
contentsTbl['item_set_item'] = new Array('item_set_item.html','セット商品','index',f_page_ad);
contentsTbl['item_sweets-set'] = new Array('item_sweets-set.html','どさんこスイーツセット','index',f_page_ad);
contentsTbl['item_sum_item'] = new Array('item_sum_item.html','おまとめ商品','index',f_page_ad);
contentsTbl['item_sale_item'] = new Array('item_sale_item.html','特価商品','index',f_page_ad);
contentsTbl['item_hachi'] = new Array('item_hachi.html','熱血テレビショッピング はっちゃき北海道','index',f_page_ad);
contentsTbl['item_ar_shinya'] = new Array('item_ar_shinya.html','常呂町　株式会社　しんや','index',f_page_ad);


/* 画面表示処理 */
function init_OnLoad(pageNm) {

	// prototypeとの競合を避ける処置
	//$.noConflict();
	jQuery(document).ready(function($) {

		//ヘッダー
		$("#cheader").ready(function(){
		$("#cheader").load("c_header.html");
		});
		
		//フッター
		$("#cfooter").ready(function(){
		$("#cfooter").load("c_footer.html");
		});

		//サイドメニュー
		$("#csideme").ready(function(){
		$("#csideme").load("c_side_me.html");
		});

		//パン屑リスト入れ替え
		$("#cblist").ready(function(){
		$("#cblist").html(set_blist2(pageNm));
		});

		//アイテムページトップへ
		$("div.itempg_top").ready(function(){
		$("div.itempg_top").html("<table  width='540' height='31'><tr><td align='left'><A href='basket.html'><IMG src='img/basket-inside.gif' width='150' height='31' border='0' alt='買い物かごの中を見る'></A></td><td align='right'><a href='#top'><img src='img/pagetop-off.gif' width='79' height='18'></a></td></tr></table>");
		});

		//おすすめ商品一覧
		$("#cosusume1").ready(function(){
		$("#cosusume1").html(item_osusumelist('ku-sanma-menta,nihon_nishinnuka,nihon_sanmanuka,nihon_nishinkazu,rau-mahokke,rau-komai,tatsujin3s,wasabi2-set,wasabi3-set,syouyu6,hako-taki-kani,hako-taki-hotate,sweetpotato1kg,sweeto-fromage,sweets-set3'));
		});

		//買い物ガイド
		$("#cguide1").ready(function(){
		$("#cguide1").load("c_guide1.html");
		});

		//「会社紹介・個人情報保護法・特定商取引」へのリンク
		$("div.intro_link").ready(function(){
		$("div.intro_link").html("<div style='font-size:95%;border-bottom:1px dotted gray;padding-bottom:5px;' align='right'><a href='company_intro.html'>会社紹介</a>&nbsp;/&nbsp;<a href='privacypolicy.html'>個人情報の保護について</a>&nbsp;/&nbsp;<a href='syoutorihikihou.html'>特定商取引について</a></div>");
		});

		////////////////////////////
		// メニューの作成
		//  var $content = $("#furuya_article3 div.content");
		//  $abstract = $("<ul class='abstract-list'></ul>");
		//  $content.children("h2").each(function(index) {
		//    $("<li class='menu-item'>" + $(this).text() + "</li>").click(function() {
		//      $("#furuya_article3 li.menu-item").removeClass("selected").eq(index).addClass("selected");
		//      $content.hide().eq(index).fadeIn(2000);
		//    }).appendTo($abstract);
		//  });
		////////////////////////////
		////////////////////////////
		//  $("#furuya_article3 div#abstract").append($abstract);
		//  $content.hide().filter(":first").show();
		//  $("#furuya_article3 li.menu-item:first").addClass("selected");
		////////////////////////////
		// イベントハンドラの作成------------------------*
		$(".pg_tp").click(function() {
		$("html, body").animate({scrollTop : $("#pg_cap").offset().top}, 800);
		return false;
		});
		// イベントハンドラの作成------------------------*
		////////////////////////////
		//  // ストライプテーブル
		//  $("#stripe-num").change(function() {
		//    var stripe_num = $("#stripe-num").attr("value");
		//    $("#stripe tbody tr").removeClass("stripe-1 stripe-2 stripe-3 stripe-4 stripe-5");
		//    $("#stripe").stripeTable({pattern_num : parseInt(stripe_num)});
		//  });
		//  $("#stripe").stripeTable();
		////////////////////////////
		//jQueryでメニューを固定位置に追随させる------------------------*
		var name = ".categp_mu_scroll";
		var menuYloc = null;
		$(name).ready(function(){
			if ($(name).css("top") != null) {
				menuYloc = parseInt($(name).css("top").substring(0,$(name).css("top").indexOf("px")))
				$(window).scroll(function () { 
					offset = menuYloc+$(document).scrollTop()+"px";
					$(name).animate({top:offset},{duration:500,queue:false});
				});
			}
		});
		//jQueryでメニューを固定位置に追随させる------------------------*
		//prettyPhoto------------------------*
		//$(".sm_bx").ready(function(){
		//	//prettyPhoto----*
		//	$("a[rel^='prettyOverlay'],a[rel^='prettyPhoto']").prettyPhoto({
		//		animationSpeed: 'normal', /* fast/slow/normal */
		//		padding: 40, /* padding for each side of the picture */
		//		opacity: 0.35, /* Value betwee 0 and 1 */
		//		showTitle: true, /* true/false */
		//		allowresize: true /* true/false */
		//	});
		//	//prettyPhoto----*
		//});
		//prettyPhoto------------------------*

	});


}
/* パン屑リスト編集 */
function set_blist2(pageNm) {
	var w_html = "";

	if (pageNm == 'index') {
		return "";
	}

	try{

		w_html = "<table width='100%' border='0' cellpadding='5' cellspacing='0' style='font-size:95%;'><tr><td align='left'>";

		var w_pageNm = pageNm;
		var w_pageTbl = new Array();
		while (w_pageNm != '') {
			w_pageTbl.push(w_pageNm);
			w_pageNm = contentsTbl[w_pageNm][2];
		}
		//
		for (var i = w_pageTbl.length-1;i>-1; i--) {
			if (i != (w_pageTbl.length-1)) {
				w_html += " > ";
			}
			if (i > 0) {
				w_html += "<a class='link1' href='" + contentsTbl[w_pageTbl[i]][3] + contentsTbl[w_pageTbl[i]][0] + "'>" + contentsTbl[w_pageTbl[i]][1] + "</a>";
			} else {
				w_html += contentsTbl[w_pageTbl[i]][1] + "";
			}
		}
		//
		w_html += "</td></tr></table>";

	}catch( e ){
		alert( "init.js - " + e ); // バグの内容をダイアログで表示する
		alert( "init.js - pageNm= " + pageNm ); // バグの内容をダイアログで表示する
	}

	return w_html;
}
/* 画面表示処理２ */
function init_OnLoad2(pageNm) {

	//アドレス表示
	init_sethtml();

}
/* 所在地情報 */
function init_sethtml() {
	//---***** 所在地情報 *****--->>
	//会社名を表示する
	$(".showName").ready(function(){
		$(".showName").html("株式会社アーサ");
	});
	//郵便番号を表示する
	$(".showZipcode").ready(function(){
		$(".showZipcode").html("〒065-0026");
	});
	//住所を表示する
	$(".showAddress").ready(function(){
		$(".showAddress").html("北海道札幌市東区北26条東2丁目2番26号");
	});
	//電話を表示する
	$(".showTelephone_honsya").ready(function(){
		$(".showTelephone_honsya").html("011-299-3823");
	});
	//電話を表示する
	$(".showTelephone").ready(function(){
		$(".showTelephone").html("011-299-3825");
	});
	//ファックスを表示する
	$(".showFacsimile").ready(function(){
		$(".showFacsimile").html("011-299-3824");
	});
	//メールアドレスを表示する
	$(".showMailAddress").ready(function(){
		$(".showMailAddress").html("<a class='mailad' href='mailto:a-sabt@as-ic.co.jp'>a-sabt@as-ic.co.jp</a>");
		//$(".showMailAddress").html("<a class='mailad' href='mailto:a-sabt@as-icr.com'>a-sabt@as-icr.com</a>");
	});
	//---***** 所在地情報 *****---<<
}
/* メーラーを開く */
function init_callmail() {
	var mailto = "mailto:a-sabt@as-ic.co.jp";
	//var mailto = "mailto:a-sabt@as-icr.com";
	//mailto = mailto +     "?subject=サブジェクト&body=本文です。%0D%0A改行もできます。";
	location.href= mailto;
}
