// ロールオーバーイメージのプリロードと動作
// 例）Category = "Corporate";の書式で
// ローカルナビを使用するHTMLにあらかじめ変数を定義する。

lNvNum=0; // 各カテゴリのローカルナビ数（初期値は0）
abbrevCat="";
if(Category=="Corporate"){
	lNvNum=6; // ローカルナビの数
	abbrevCat=Category.substring(0,1); // カテゴリーの最初の1文字を略称とする
}

if(Category=="Information"){
	lNvNum=7; // ローカルナビの数
	abbrevCat=Category.substring(0,1); // カテゴリーの最初の1文字を略称とする
}

if(Category=="Store"){
	lNvNum=3; // ローカルナビの数
	abbrevCat=Category.substring(0,1); // カテゴリーの最初の1文字を略称とする
}

if(Category=="Article"){
	lNvNum=20; // ローカルナビの数
	abbrevCat=Category.substring(0,1); // カテゴリーの最初の1文字を略称とする
}

if(Category=="Product"){
	lNvNum=2; // ローカルナビの数
	abbrevCat=Category.substring(0,1); // カテゴリーの最初の1文字を略称とする
}

// ローカルナビ画像のプリロード
var img=new Array();
for(i=1; i<=lNvNum; i++){
	if(i<10){i="0"+i;}
	name=abbrevCat+"lNv"+i;
	nameOn=abbrevCat+"lNv"+i+"On";
	path="/"+Category+"/images/lNv"+i+".gif";
	pathOn="/"+Category+"/images/lNv"+i+"On.gif";
	img[name]=path; // ロールアウト時のパス
	img[nameOn]=pathOn; // ロールオーバー時のパス
}

// グローバルナビ画像のプリロード
img["home"]="/images/header/gNv/home.gif";
img["homeOn"]="/images/header/gNv/home_on.gif";
img["info"]="/images/header/gNv/info.gif";
img["infoOn"]="/images/header/gNv/info_on.gif";
img["product"]="/images/header/gNv/product.gif";
img["productOn"]="/images/header/gNv/product_on.gif";
img["english"]="/images/header/gNv/english.gif";
img["englishOn"]="/images/header/gNv/english_on.gif";
img["shopping"]="/images/header/gNv/shopping.gif";
img["shoppingOn"]="/images/header/gNv/shopping_on.gif";
img["support"]="/images/header/gNv/support.gif";
img["supportOn"]="/images/header/gNv/support_on.gif";
img["press"]="/images/header/gNv/press.gif";
img["pressOn"]="/images/header/gNv/press_on.gif";
img["oem"]="/images/header/gNv/oem.gif";
img["oemOn"]="/images/header/gNv/oem_on.gif";


// ショッピングカート画像のプリロード
img["gobackshopping"]="/Cart/images/gobackshopping.gif";
img["gobackshoppingOn"]="/Cart/images/gobackshopping_on.gif";
img["payment"]="/Cart/images/payment.gif";
img["paymentOn"]="/Cart/images/payment_on.gif";
img["kessaihouhou"]="/Cart/images/kessaihouhou.gif";
img["kessaihouhouOn"]="/Cart/images/kessaihouhou_on.gif";

// アウトレットナビ画像のプリロード
img["Outlet01"]="/Store/Outlet/images/outlet_navi01.gif";
img["Outlet01On"]="/Store/Outlet/images/outlet_navi01On.gif";
img["Outlet02"]="/Store/Outlet/images/outlet_navi02.gif";
img["Outlet02On"]="/Store/Outlet/images/outlet_navi02On.gif";
img["Outlet03"]="/Store/Outlet/images/outlet_navi03.gif";
img["Outlet03On"]="/Store/Outlet/images/outlet_navi03On.gif";
img["Outlet04"]="/Store/Outlet/images/outlet_navi04.gif";
img["Outlet04On"]="/Store/Outlet/images/outlet_navi04On.gif";

// ローカルナビ用ロールオーバー関数
function lNvRO(target,status){
	tag=abbrevCat+target+status;
	document.images[target].src=img[tag];
}

 // グローバルナビ用ロールオーバー関数
function gNvRO(target,status){
	tag=target+status;
	document.images[target].src=img[tag];
}

 // ショッピングカート用ロールオーバー関数
function CartRO(target,status){
	tag=target+status;
	document.images[target].src=img[tag];
}

 // アウトレットナビ用ロールオーバー関数
function OutletRO(target,status){
	tag=target+status;
	document.images[target].src=img[tag];
}

// プロダクトページローカルナビロールオーバー処理
var imgNum;
if(Category=="Product"){
	abbrevCat=Category.substring(0,1); // カテゴリーの最初の1文字を略称とする

	var img2=new Array();
	for(i=1; i<=imgNum; i++){
		if(i<10){i="0"+i;}
		name=abbrevCat+"Navilist"+i;
		nameOn=abbrevCat+"Navilist"+i+"On";
		img2[name]=imgPath+"navi"+i+".gif"; // ロールアウト時のパス
		img2[nameOn]=imgPath+"navi"+i+"On.gif"; // ロールオーバー時のパス
	}

}

// プロダクトページローカルナビ用ロールオーバー関数
function pNvRO(target,status){
	tag=abbrevCat+target+status;
	document.images[target].src=img2[tag];
}

// Normalロールオーバー用
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// メルマガチェック用
function form_check(myForm) {

 if (myForm.email.value.length == 0) {
	alert('メールアドレスの入力をお願いします。');
	myForm.email.focus();
	return false;
}

  var adr = myForm.email.value;
  adr = adr.replace(/ /g, "");
  var re;
  //re = /^?w+([?.-]??w+)*@?w+([?.-]??w+)*(?.?w{2,})+$/;
  //re = "([a-zA-Z0-9])+([a-zA-Z0-9＼._-＼+])*@(a-zA-Z0-9_-])+(a-zA-Z0-9＼._-]+)+$"
  re = /^[0-9A-Za-z＼+＼._-]+@[0-9A-Za-z＼._-]+$/;
  if (re.test(adr) != true) {
     alert('メールアドレスに誤りがあるようです。確認をお願いします。');
     myForm.email.focus();
     return false;
  }

 return true;

}

function triple_banner()
{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="221" height="78" id="topbanner_20070126">\n');
	document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
	document.write('<param name="movie" value="triple.swf" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="bgcolor" value="#FFFFFF" />\n');
	document.write('<embed src="triple.swf" quality="high" bgcolor="#FFFFFF" width="221" height="78" name="topbanner_20070126" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
    document.write('</object>\n');
}

