﻿<!--

var homeurl = "http://aifish.com";

wkmemoarray = new Array();
ANIMA = new Array();
NAME = new Array();
DETAIL = new Array();
timerID = new Array();

Items = new Array();
Items[0] = new Array();
Items[1] = new Array();
Items[2] = new Array();

Items[3] = new Array();
Items[4] = new Array();
Items[5] = new Array();
//Items[3] = [];

mimgItemCount = new Array();
mimgItemCount[0] = new Array();
mimgItemCount[1] = new Array();
mimgItemCount[2] = new Array();

tryl0 = new Array();
tryl1 = new Array();
tryl2 = new Array();
tryl3 = new Array();
tryl4 = new Array();
tryl5 = new Array();
tryl6 = new Array();
tryls = new Array(0, 0, 0);

TRYnm0 = new Array("TRY00", "TRY10", "TRY20");
TRYnm1 = new Array("TRY01", "TRY11", "TRY21");
TRYnm2 = new Array("TRY02", "TRY12", "TRY22");
TRYnm3 = new Array("TRY03", "TRY13", "TRY23");
TRYnm4 = new Array("TRY04", "TRY14", "TRY24");
TRYnm5 = new Array("TRY05", "TRY15", "TRY25");
TRYnm6 = new Array("TRY06", "TRY16", "TRY26");

TRYt = new Array("TRY0t", "TRY1t", "TRY2t");
TRYs = new Array("TRY0s", "TRY1s", "TRY2s");
TRYsd = new Array("TRY0sd", "TRY1sd", "TRY2sd");
var TRYsdt = new Array(0, 0, 0);

Form = new Array("form0", "form1", "form2");
Kwd = new Array("kwd0", "kwd1", "kwd2");
keyword = new Array("", "", "", "", "", "");
TRYchangex0 = new Array("TRYchange00", "TRYchange10", "TRYchange20");
catnum = new Array("1902", "1903", "1904", "1902", "1903", "1904");

TimeSet1 = new Array(1, 1, 1);
TimeCount = new Array(-1, 700, -1);
CycleCount = new Array(0, 0, 0);
TimeSpd = new Array(20, -20, 20);
Tsdf = new Array(0, 0, 0);
hTsdf = new Array(-1, -1, -1);
trID = new Array(0, 0, 0);
Spdctl = new Array(1, -20, 1);
parm = new Array(0, 0, 0);
Ipage = new Array(0, 0, 0, 0, 0, 0);
ShopId = new Array("aJP", "aJP", "aJP", "sel", "sel", "sel");
ShopItemnum = {'aJP': '10', 'rJP': '30', 'yJP': '30'};
DGflg = new Array(0, 0, 0, 0, 0, 0);
LFflg = new Array("n", "n", "n", "n", "n", "n");

cnum = new Array("", "", "", 0, 0, 0);

imgarea = new Array(0, 0, 0);
var scmodeflg = 1;
Enum = 2;
coodpm = new Array("", "", "");
var TRYmimgTop = 35;
var TRYmimgLeft = 0;
var linkparm = new Array ([], [], [], [], [], []);
var coodlink = "";


if (window.ActiveXObject && !window.XMLHttpRequest)
{
 window.XMLHttpRequest = function()
  {
   try { return (new ActiveXObject('Msxml2.XMLHTTP'));  } catch (e) {}
   try { return (new ActiveXObject('Microsoft.XMLHTTP')); } catch (e) {}
   return (null);
  }
}

//window.localStorage = window.localStorage || window.globalStorage[location.host];
//window.localStorage = window.localStorage || window.globalStorage[location.hostname];
//window.localStorage = window.localStorage || window.globalStorage[localhost];

function DataGet(Gnum,ppage,sShopId) {
LFflg[Gnum] = "n";
DGflg[Gnum] = 0;
if (Gnum < 3) {
 preset(Gnum);
} else {
// catnum[Gnum] = 1902;
}
var the_object;
var http_request = new XMLHttpRequest();
if ( ppage == 0 ) {
 Ipage[Gnum] = 1;
} else {
 Ipage[Gnum] = Ipage[Gnum] + ppage;
}
if ( document.form0.kwd0.value == "" ) { keyword[0] = "";} else { keyword[0] = "&k=" + encodeURI(document.form0.kwd0.value);}
if ( document.form1.kwd1.value == "" ) { keyword[1] = "";} else { keyword[1] = "&k=" + encodeURI(document.form1.kwd1.value);}
if ( document.form2.kwd2.value == "" ) { keyword[2] = "";} else { keyword[2] = "&k=" + encodeURI(document.form2.kwd2.value);}
if ( Ipage[Gnum] < 1 ) { Ipage[Gnum] = 1;}
if ( sShopId != "" ) { ShopId[Gnum] = sShopId;}
var the_url = homeurl + "/e/indexcode.cgi?c=" + catnum[Gnum] + "&s=" + ShopId[Gnum] + "&h=y&p=" + Ipage[Gnum] + keyword[Gnum];
//var the_url = homeurl + "/e/indexcode.cgi?c=1902" + "&s=" + ShopId[Gnum] + "&h=y&p=" + Ipage[Gnum] + keyword[Gnum];
http_request.open( "GET", the_url, true );
http_request.onreadystatechange = function () {
    if ( http_request.readyState == 4 ) {
        if ( http_request.status == 200 ) {
            Items[Gnum] = eval( "(" + http_request.responseText + ")" );
            if (linkparm[Gnum].length > 0) {
             linkpmset(Gnum);
             linkparm[Gnum].length = 0;
            }
            DGflg[Gnum] = 1;
            if (Gnum < 3) {
             changetry(Gnum);
            } else {
//             chara();
            }
        } else {
            alert( "There was a problem with the URL." );
        }
        http_request = null;
    }
};
http_request.send(null);
}

function preset(Gnum) {
coodpm[Gnum] = "";
mimgItemCount[Gnum] = [];
document.images["dimg" + Gnum + 0].src = "w.jpg";
document.images["dimg" + Gnum + 1].src = "w.jpg";
document.images["dimg" + Gnum + 2].src = "w.jpg";
document.images["dimg" + Gnum + 3].src = "w.jpg";
document.images["dimg" + Gnum + 4].src = "w.jpg";
document.images["dimg" + Gnum + 5].src = "w.jpg";
document.images["dimg" + Gnum + 6].src = "w.jpg";
document.images["dimg" + Gnum + 0].title = "";
document.images["dimg" + Gnum + 1].title = "";
document.images["dimg" + Gnum + 2].title = "";
document.images["dimg" + Gnum + 3].title = "";
document.images["dimg" + Gnum + 4].title = "";
document.images["dimg" + Gnum + 5].title = "";
document.images["dimg" + Gnum + 6].title = "";
document.images["dimg" + Gnum + 0].alt = "";
document.images["dimg" + Gnum + 1].alt = "";
document.images["dimg" + Gnum + 2].alt = "";
document.images["dimg" + Gnum + 3].alt = "";
document.images["dimg" + Gnum + 4].alt = "";
document.images["dimg" + Gnum + 5].alt = "";
document.images["dimg" + Gnum + 6].alt = "";
if (document.all){
 document.all("TRYsearch").style.top=(Gnum * 125) + 10;

document.all["dlink" + Gnum + 0].href = "";
document.all["dlink" + Gnum + 1].href = "";
document.all["dlink" + Gnum + 2].href = "";
document.all["dlink" + Gnum + 3].href = "";
document.all["dlink" + Gnum + 4].href = "";
document.all["dlink" + Gnum + 5].href = "";
document.all["dlink" + Gnum + 6].href = "";

} else{
 if (document.getElementById){
  document.getElementById("TRYsearch").style.top=(Gnum * 125) + 10;

document.links["dlink" + Gnum + 0].href = "";
document.links["dlink" + Gnum + 1].href = "";
document.links["dlink" + Gnum + 2].href = "";
document.links["dlink" + Gnum + 3].href = "";
document.links["dlink" + Gnum + 4].href = "";
document.links["dlink" + Gnum + 5].href = "";
document.links["dlink" + Gnum + 6].href = "";

 } else{
  if (document.layers){
   document.layers["TRYsearch"].top=(Gnum * 125) + 10;
  }
 }
}
changez("TRYsearch",2);
changez("TRYlocal3",0)
}

function changetry(Gnum) {

changez("TRYsearch",0);
scmodeflg = 1;

if ( TimeSet1[Gnum] > 20 ) {
 if ( TimeSpd[Gnum] == 0 ) {
  TimeSet1[Gnum] = 1;
  TimeSpd[Gnum] = 30;
 }
 else {
  TimeSet1[Gnum] = 1;
  TimeSpd[Gnum] = TimeSpd[Gnum] * 30;
 }
 TimeCount[Gnum] = (700 + (TimeSpd[Gnum]/Math.abs(TimeSpd[Gnum]))) % 700;
}
if ( TimeSpd[Gnum] == 0 ) { TimeSpd[Gnum] = 30 }

var fmkwd;
if ( Gnum == 0 ) { fmkwd = document.form0.kwd0.value; }
if ( Gnum == 1 ) { fmkwd = document.form1.kwd1.value; }
if ( Gnum == 2 ) { fmkwd = document.form2.kwd2.value; }
var psrJP;
var psyJP;
var psaJP;
var pssel;
var pslcl = "";
if ( ShopId[Gnum] == "rJP" ) {psrJP = "<b>楽天市場</b> |"} else {psrJP = "<a href='javascript:DataGet(" + Gnum + ",0,\"rJP\")'>楽天市場</a> |"}
if ( ShopId[Gnum] == "yJP" ) {psyJP = " <b>ヤフーショッピング</b> |"} else {psyJP = " <a href='javascript:DataGet(" + Gnum + ",0,\"yJP\")'>ヤフーショッピング</a> |"}
if ( ShopId[Gnum] == "aJP" ) {psaJP = " <b>アマゾン（日本）</b> |"} else {psaJP = " <a href='javascript:DataGet(" + Gnum + ",0,\"aJP\")'>アマゾン（日本）</a> |"}
if ( ShopId[Gnum] == "sel" ) {pssel = " <b>試着用調整済みアイテム</b> "} else {pssel = " <a href='javascript:DataGet(" + Gnum + ",0,\"sel\")'>試着用調整済みアイテム</a> "}
var TRYchangex0html;
TRYchangex0html = "\
<br>\
<font size=2>ショップ : [ " + psrJP + psyJP + psaJP + pssel + pslcl + "]<br>\
ページ : [ \
<a href='javascript:DataGet(" + Gnum + ",-1,\"\")'>＜</a> <b>" + Ipage[Gnum] + "</b> \
<a href='javascript:DataGet(" + Gnum + ",1,\"\")'>＞</a> \
]　\
アイテム数/ページ : [ <b>" + Items[Gnum][1] + "</b> ]<br>\
<form name=\"form" + Gnum + "\">\
キーワード : [ \
<input type=\"text\" name=\"dummy\" style=\"position:absolute;visibility:hidden\">\
<input type=\"text\" name=\"kwd" + Gnum + "\" size=\"30\" value=\"" + fmkwd + "\">\
<input type=\"button\" value=\"seaech\" onClick='DataGet(" + Gnum + ",0,\"\")'> \
<a href='javascript:trDG(" + Gnum + ",\"ビジネス\")'>ビジネス</a>　\
<a href='javascript:trDG(" + Gnum + ",\"カジュアル\")'>カジュアル</a>　\
<a href='javascript:trDG(" + Gnum + ",\"光沢\")'>光沢</a> ... \
]</form></font>";
if (document.all){ document.all(TRYchangex0[Gnum]).innerHTML=TRYchangex0html }
if (document.getElementById){ document.getElementById(TRYchangex0[Gnum]).innerHTML=TRYchangex0html }

if (LFflg[2] == "k") { var TRYmimgkininaruhtml = "<font size=2>気になるアイテムリスト→</font>" }
else if (LFflg[2] == "y") { var TRYmimgkininaruhtml = "<font size=2>PC画像→</font>" }
else if (LFflg[2] == "u") {var TRYmimgkininaruhtml = "<font size=2>外部のオンライン画像→</font>" }
else {var TRYmimgkininaruhtml = "" }
if (document.all){ document.all("TRYmimgkininaru").innerHTML=TRYmimgkininaruhtml + "<br><a href='javascript:DataGet(2,0,\"rJP\")'>×</a>" }
else if (document.getElementById){ document.getElementById("TRYmimgkininaru").innerHTML=TRYmimgkininaruhtml + "<br><a href='javascript:DataGet(2,0,\"rJP\")'>×</a>" }

}

//delay汎用化
function tstart(cat0,svc0,kwd0,cat1,svc1,kwd1,cat2,svc2,kwd2) {
stop(0);
stop(1);
stop(2);
changez("TRYchange0",0);
changez("TRYchange1",0);
changez("TRYchange2",0);
changez("TRYwait",3)
//catnum = new Array(cat0, cat1, cat2, "1902", "1903", "1904");
catnum[0] = cat0;
catnum[1] = cat1;
catnum[2] = cat2;

document.form0.kwd0.value = kwd0;
document.form1.kwd1.value = kwd1;
document.form2.kwd2.value = kwd2;
DataGet(0,0,svc0);
DataGet(1,0,svc1);
DataGet(2,0,svc2);
scstart(0);
}

function trDG(Gnum,rtxt) {
if ( Gnum == 0 ) { document.form0.kwd0.value = rtxt;}
if ( Gnum == 1 ) { document.form1.kwd1.value = rtxt;}
if ( Gnum == 2 ) { document.form2.kwd2.value = rtxt;}
DataGet(Gnum,0,"");
}

function cngcg(bt,at,cat0,svc0,kwd0,cat1,svc1,kwd1,cat2,svc2,kwd2) {
movetray(35,0,4);
changez("TRYla",2);
changez("TRYme",2);
scmodeflg = 1;
if (at != "TRYmimg") {changez("TRYmimg",0)}
changez(bt,0);
changez(at,2);
tstart(cat0,svc0,kwd0,cat1,svc1,kwd1,cat2,svc2,kwd2);
}

//現在不使用
function delayl() {
 DataGet(0,1,"aJP");
 DataGet(1,1,"yJP");
 DataGet(2,1,"rJP");
 scstart(0);
}

function scstart() {
 IntervarID=setTimeout("scstart()", 50);
 if ( DGflg[0] + DGflg[1] + DGflg[2] == 3 ) {
  changez("TRYwait",0);
  clearTimeout(IntervarID);
  delayani(0);
 }
}

function changez(StyleSheet,znum) {
 if (document.getElementById){
   document.getElementById(StyleSheet).style.zIndex=znum
  } else {
  if (document.all){document.all(StyleSheet).style.zIndex=znum}
 }
}

function changezm(znum) {
if (znum == 0){
 if (document.all){
  document.all("TRYmimgsetumei").innerHTML= "";
  document.all("TRYmimgsetumei").style.width=0;
  document.all("TRYmimgmove").style.left=100;
  document.all("TRYmimgmove").style.top=100;
  document.all("TRYmimgsize").style.left=100;
  document.all("TRYmimgsize").style.top=100;
  document.all("TRYmimgarea").style.left=100;
  document.all("TRYmimgarea").style.top=100;
 }else if (document.getElementById){
  document.getElementById("TRYmimgsetumei").innerHTML= "";
  document.getElementById("TRYmimgsetumei").style.width=0;
  document.getElementById("TRYmimgmove").style.left=100;
  document.getElementById("TRYmimgmove").style.top=100;
  document.getElementById("TRYmimgsize").style.left=100;
  document.getElementById("TRYmimgsize").style.top=100;
  document.getElementById("TRYmimgarea").style.left=100;
  document.getElementById("TRYmimgarea").style.top=100;
 }
}
changez("TRYmimgmove",znum);
changez("TRYmimgsize",znum);
changez("TRYmimgarea",znum);
changez("TRYmimgsetumei",znum);
}

function schange(Gnum) {
TimeSpd[0] = 0;
TimeSpd[1] = 0;
TimeSpd[2] = 0;
Enum = Gnum;
if (( Gnum == 2 )&&(LFflg[Gnum] == "k")) {
var TRYmimglnkhtmlb = "<font size=2><a href=\"" + Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][2] + "\" target=\"detail\">詳細ページを表示する</a>　<a href=\"" + homeurl + "/e/index.cgi?c=";
//var TRYmimglnkhtmlb = "<font size=2><a href=\"" + homeurl + "/e/index.cgi?c=";
var TRYmimglnkhtmla = "&t=df&h=y&lang=jp\" target=\"detail\">類似アイテム・コーデ例を表示する</a><br>\
<br><a href='javascript:delmemo(" + Gnum + ")'>気になるアイテムリストから削除</a><br>\
<br><a href='javascript:ssave(" + Gnum + ")'>×</a>\
</font>";
} else {
//var TRYmimglnkhtmlb = "<font size=2><a href=\"" + homeurl + "/e/index.cgi?c=";
var TRYmimglnkhtmlb = "<font size=2><a href=\"" + Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][2] + "\" target=\"detail\">詳細ページを表示する</a>　<a href=\"" + homeurl + "/e/index.cgi?c=";
var TRYmimglnkhtmla = "&t=df&h=y&lang=jp\" target=\"detail\">類似アイテムを表示する</a><br>\
<br><a href='javascript:addmemo(" + Gnum + ")'>気になるアイテムリストに登録する</a><br></font>\
<font size=1>↑登録すると、ブラウザに情報が保存され、後でアイテムを見直す事ができます。</font><br>\
<font size=2><br><a href='javascript:ssave(" + Gnum + ")'>×</a></font>";
}

if (Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][8] == undefined) {
 if ( Gnum == 0 ) { Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][8] = document.form0.kwd0.value; }
 if ( Gnum == 1 ) { Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][8] = document.form1.kwd1.value; }
 if ( Gnum == 2 ) { Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][8] = document.form2.kwd2.value; }
}

if (document.all){
 document.all("TRYmimgmove").style.background ="tan";
 document.all("TRYmimgsize").style.background ="blue";
 document.all("TRYmimgarea").style.background ="red";
 document.all("TRYmimgmove").style.left=parseInt(document.all("TRYmimg" + Gnum).style.left) + 50;
 document.all("TRYmimgmove").style.top=parseInt(document.all("TRYmimg" + Gnum).style.top) - 10;
 document.all("TRYmimgsize").style.left=parseInt(document.all("TRYmimg" + Gnum).style.left) + 50;
 document.all("TRYmimgsize").style.top=parseInt(document.all("TRYmimgmove").style.top) + parseInt(document.images["mimg" + Enum].height) - 20;
 document.all("TRYmimgarea").style.left=parseInt(document.all("TRYmimg" + Gnum).style.left) + 20;
 document.all("TRYmimgarea").style.top=parseInt(document.all("TRYmimgmove").style.top) + parseInt(document.all("TRYmimg" + Enum).style.height) - 20;
 document.all("TRYmimgsetumei").style.width=350;
 document.all("TRYmimgsetumei").style.top=parseInt(document.all("TRYmimg" + Gnum).style.top) + 30;
 document.all("TRYmimgsetumei").innerHTML= TRYmimglnkhtmlb + catnum[Gnum] + "&s=rJP&k=" + encodeURI(Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][8]) + TRYmimglnkhtmla;
 document.all("TRYmimgmove").innerHTML= "<center><font size=2>Click<br>to<br>move.</font></center>";
 document.all("TRYmimgsize").innerHTML= "<center><font size=2 color=white>Click<br>to<br>zoom.</font></center>";
 document.all("TRYmimgarea").innerHTML= "<center><font size=2>Click<br>to ctrl<br>area.</font></center>";
}else if (document.getElementById){
 document.getElementById("TRYmimgmove").style.background ="tan";
 document.getElementById("TRYmimgsize").style.background ="blue";
 document.getElementById("TRYmimgarea").style.background ="red";
 document.getElementById("TRYmimgmove").style.left=parseInt(document.getElementById("TRYmimg" + Gnum).style.left) + 50;
 document.getElementById("TRYmimgmove").style.top=parseInt(document.getElementById("TRYmimg" + Gnum).style.top) - 10;
 document.getElementById("TRYmimgsize").style.left=parseInt(document.getElementById("TRYmimg" + Gnum).style.left) + 50;
 document.getElementById("TRYmimgsize").style.top=parseInt(document.getElementById("TRYmimgmove").style.top) + parseInt(document.images["mimg" + Enum].height) - 20;
 document.getElementById("TRYmimgarea").style.left=parseInt(document.getElementById("TRYmimg" + Gnum).style.left) + 20;
 document.getElementById("TRYmimgarea").style.top=parseInt(document.getElementById("TRYmimgmove").style.top) + parseInt(document.getElementById("TRYmimg" + Enum).style.height) - 20;
 document.getElementById("TRYmimgsetumei").style.width=350;
 document.getElementById("TRYmimgsetumei").style.top=parseInt(document.getElementById("TRYmimg" + Gnum).style.top) + 30;
 document.getElementById("TRYmimgsetumei").innerHTML= TRYmimglnkhtmlb + catnum[Gnum] + "&s=rJP&k=" + encodeURI(Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][8]) + TRYmimglnkhtmla;
 document.getElementById("TRYmimgmove").innerHTML= "<center><font size=2>Click<br>to<br>move.</font></center>";
 document.getElementById("TRYmimgsize").innerHTML= "<center><font size=2 color=white>Click<br>to<br>zoom.</font></center>";
 document.getElementById("TRYmimgarea").innerHTML= "<center><font size=2>Click<br>to ctrl<br>area.</font></center>";
}
changezm(5);
}

function changezm1(znum0,znum1,znum2) {
changez("TRYmimg0",znum0)
changez("TRYmimg1",znum1)
changez("TRYmimg2",znum2)
}

function anime_2(Gnum,TRnum,ItemCount) {

if (navigator.appName.match(/Explorer/)){
 if (ShopId[Gnum] == "aJP"){
  if (parseInt((Items[Gnum][0][ItemCount][3] * 100) / Items[Gnum][0][ItemCount][4]) < 115) {
   document.images["dimg" + Gnum + TRnum].width = 99;
   document.images["dimg" + Gnum + TRnum].height = parseInt((Items[Gnum][0][ItemCount][3] * 99) / (Items[Gnum][0][ItemCount][4] * 1));
  } else {
   document.images["dimg" + Gnum + TRnum].width = parseInt((Items[Gnum][0][ItemCount][4] * 114) / (Items[Gnum][0][ItemCount][3] * 1));
   document.images["dimg" + Gnum + TRnum].height = 114;
  }
 } else {
   document.images["dimg" + Gnum + TRnum].width = 99;
 }
}

document.images["dimg" + Gnum + TRnum].src = Items[Gnum][0][ItemCount][0];
document.images["dimg" + Gnum + TRnum].title = Items[Gnum][0][ItemCount][1];
document.images["dimg" + Gnum + TRnum].alt = Items[Gnum][0][ItemCount][1];
if (document.all){
 document.all["dlink" + Gnum + TRnum].href = Items[Gnum][0][ItemCount][2].replace(/amp;/g, "");
} else{
 if (document.getElementById){
  document.links["dlink" + Gnum + TRnum].href = Items[Gnum][0][ItemCount][2].replace(/amp;/g, "");
 }
}
if( ItemCount == 0) {
 tryls[Gnum] = TimeCount[Gnum] - (TimeCount[Gnum] % 100);
 TRYsdt[Gnum] = 5;
}
else {
 if(tryls[Gnum] == TimeCount[Gnum] - (TimeCount[Gnum] % 100)) {
  TRYsdt[Gnum] = 0;
 }
}

if (document.all){
  document.all(TRYsd[Gnum]).style.top= TRYsdt[Gnum];
} else if (document.getElementById){
  document.getElementById(TRYsd[Gnum]).style.top= TRYsdt[Gnum];
} else if (document.layers){
  document.layers[TRYsd[Gnum]].top= TRYsdt[Gnum];
}

if (ShopId[Gnum] == "yJP"){
 yhodmy ="<img Src='http://ad.jp.ap.valuecommerce.com/servlet/gifbanner?sid=2743507&pid=879745247' height='1' width='1' Border='0'>";
} else {
 yhodmy ="";
}
mimgItemCount[Gnum][TRnum] = ItemCount;
}

function mimgup(Gnum,TRnum,ItemCount) {
changezm(0);
if (mimgItemCount[Gnum][TRnum] == undefined) {mimgItemCount[Gnum][TRnum] = 0}
document.images["mimg" + Gnum].src = Items[Gnum][0][mimgItemCount[Gnum][TRnum]][0];
document.images["mimg" + Gnum].title = Items[Gnum][0][mimgItemCount[Gnum][TRnum]][1];
document.images["mimg" + Gnum].alt = Items[Gnum][0][mimgItemCount[Gnum][TRnum]][1];
if (LFflg[2] == "n") {
 changez("TRYmimg0",3);
 changez("TRYmimg1",2);
 changez("TRYmimg2",4);
 changez("TRYmimgkininaru",0);
} else {
 changez("TRYmimgkininaru",4);
 if (Gnum == 2) {
  Enum = 2;
  document.images["mimg" + Gnum].height = Items[Gnum][0][mimgItemCount[Gnum][TRnum]][5];
  TRYmimgctl(parseInt(Items[Gnum][0][mimgItemCount[Gnum][TRnum]][6]),parseInt(Items[Gnum][0][mimgItemCount[Gnum][TRnum]][9]));
 }
}
 document.images["mimg" + Gnum].height = Items[Gnum][0][mimgItemCount[Gnum][TRnum]][5];

coodlink = "";
if ((Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][11] != undefined)&&(Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][11].match(/ID/) == null)) {
 coodpm[Gnum] = ""
 + "s" + Gnum + "=" + Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][11] + "ID&"
 + "i" + Gnum + "=" + Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][12] + "&"
 + "ih" + Gnum + "=" + Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][5] + "&"
 + "t" + Gnum + "=" + Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][6] + "&"
 + "l" + Gnum + "=" + Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][7] + "&"
 + "sh" + Gnum + "=" + Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][9] + "";
}
if ((coodpm[0] != "")&&(coodpm[1] != "")&(coodpm[2] != "")) {
 coodlink = homeurl + "/index.cgi?" + coodpm[0] + "&" + coodpm[1] + "&" + coodpm[2] + "&c=19#cood";
 changez("TRYmimglnkw",0);
} else {
 changez("TRYmimglnkw",2);
}

if (document.all){
  if ( Items[Gnum][0][mimgItemCount[Gnum][TRnum]][6] ) { document.all("TRYmimg" + Gnum).style.top=Items[Gnum][0][mimgItemCount[Gnum][TRnum]][6]; } else {document.all("TRYmimg" + Gnum).style.top= 100}
  if ( Items[Gnum][0][mimgItemCount[Gnum][TRnum]][7] ) { document.all("TRYmimg" + Gnum).style.left=parseInt(Items[Gnum][0][mimgItemCount[Gnum][TRnum]][7]) + 10; } else {document.all("TRYmimg" + Gnum).style.left= 10}
  if ( Items[Gnum][0][mimgItemCount[Gnum][TRnum]][9] ) { document.all("TRYmimg" + Gnum).style.height=Items[Gnum][0][mimgItemCount[Gnum][TRnum]][9]; } else {document.all("TRYmimg" + Gnum).style.height= document.all("TRYmimg" + Gnum).style.height = document.images["mimg" + Gnum].height}
// document.all["mlink" + Gnum].href = document.all["dlink" + Gnum + TRnum].href;
 if (document.images["mimg" + Gnum].height > 160) { document.all("TRYmimg" + Gnum).style.width=document.images["mimg" + Gnum].height } else { document.all("TRYmimg" + Gnum).style.width=160 }
// document.all["mlink3"].href = coodlink;
}
else{
 if (document.getElementById){
  document.getElementById("TRYmimg" + Gnum).style.top=Items[Gnum][0][mimgItemCount[Gnum][TRnum]][6];
  document.getElementById("TRYmimg" + Gnum).style.left=parseInt(Items[Gnum][0][mimgItemCount[Gnum][TRnum]][7]) + 10;
//  document.links["mlink" + Gnum].href = document.links["dlink" + Gnum + TRnum].href;
  if ( Items[Gnum][0][mimgItemCount[Gnum][TRnum]][9] ) { document.getElementById("TRYmimg" + Gnum).style.height = Items[Gnum][0][mimgItemCount[Gnum][TRnum]][9] } else {document.getElementById("TRYmimg" + Gnum).style.height = document.images["mimg" + Gnum].height}
  if (document.images["mimg" + Gnum].height > 160) { document.getElementById("TRYmimg" + Gnum).style.width=document.images["mimg" + Gnum].height } else { document.getElementById("TRYmimg" + Gnum).style.width=160 }
//  document.links["mlink3"].href = coodlink;
 }else{
  if (document.layers){
   document.layers["TRYmimg" + Gnum].top=Items[Gnum][0][mimgItemCount[Gnum][TRnum]][6];
   document.layers["TRYmimg" + Gnum].left=parseInt(Items[Gnum][0][mimgItemCount[Gnum][TRnum]][7]) + 10;
   if ( Items[Gnum][0][mimgItemCount[Gnum][TRnum]][9] ) { document.layers("TRYmimg" + Gnum).style.height = Items[Gnum][0][mimgItemCount[Gnum][TRnum]][9] } else {document.layers("TRYmimg" + Gnum).style.height = document.images["mimg" + Gnum].height}
  }
 }
}
}

function coodeshare() {
ssave(0);
ssave(1);
ssave(2);
//coodlink = "http://www.yahoo.co.jp";
window.open(coodlink, "detail");
}

function delayani(Gnum) {
 TimeCount[Gnum] = TimeCount[Gnum] + TimeSpd[Gnum] ;
 if( TimeCount[Gnum] >= 700) {
  TimeCount[Gnum] = 0;
  CycleCount[Gnum]++;
  if(CycleCount[Gnum] >= ShopItemnum[ShopId[Gnum]]) {
   CycleCount[Gnum] = 0;
  }
  TimeSet1[Gnum] = 30;
  if( TimeSpd[Gnum] != 0) { TimeSpd[Gnum] = TimeSpd[Gnum]/Math.abs(TimeSpd[Gnum]); }
  if ((Gnum == 0)&&(Items[3].length < 2)) { tstartchara(); }
 }
 if( TimeCount[Gnum] < 0) {
  TimeCount[Gnum] = 699;
  CycleCount[Gnum] = CycleCount[Gnum] - 1;
  if(CycleCount[Gnum] < 0) {
   CycleCount[Gnum] = ShopItemnum[ShopId[Gnum]] - 1;
  }
  TimeSet1[Gnum] = 30;
  if( TimeSpd[Gnum] != 0) { TimeSpd[Gnum] = TimeSpd[Gnum]/Math.abs(TimeSpd[Gnum]); }
 }
 Gnum1 = Gnum;
 timerID[Gnum]=setTimeout("eve(Gnum1)", TimeSet1[Gnum]);
}

function OnCl(Gnum,gorb){
 if( gorb == 0) {
  if( TimeSpd[Gnum] == 1) {
   TimeSpd[Gnum] = 0; 
  } else{
   TimeSpd[Gnum] = TimeSpd[Gnum] - 10;
  }
 }
 else {
  if( TimeSpd[Gnum] == -1) {
   TimeSpd[Gnum] = 0; 
  } else{
   TimeSpd[Gnum] = TimeSpd[Gnum] + 10;
  }
 }
}

function OnMo(Gnum,trID){
if (scmodeflg > 0) {
 Spdctl[Gnum] = 3 - (trID + Tsdf[Gnum]) % 7 ;
 TimeSpd[Gnum] = Spdctl[Gnum] * Spdctl[Gnum] * Spdctl[Gnum];
}
}

function scmodechange(){
scmodeflg = scmodeflg + 1;
scmodeflg = scmodeflg % 2;
if (scmodeflg == 0) {
 TimeSpd[0] = 10;
 TimeSpd[1] = 10;
 TimeSpd[2] = 10;
} else {
 TimeSpd[0] = 1;
 TimeSpd[1] = 1;
 TimeSpd[2] = 1;
}
}

function stop(Gnum){
   clearTimeout(timerID[Gnum]);
}

function eve(Gnum) {
 tryl0[Gnum] = TimeCount[Gnum] +  50; Tsdf[Gnum] = 0;
 tryl1[Gnum] = TimeCount[Gnum] + 150; if( TimeCount[Gnum] >=  600) { tryl1[Gnum] = TimeCount[Gnum] - 600 + 50; Tsdf[Gnum]++; }
 tryl2[Gnum] = TimeCount[Gnum] + 250; if( TimeCount[Gnum] >=  500) { tryl2[Gnum] = TimeCount[Gnum] - 500 + 50; Tsdf[Gnum]++; }
 tryl3[Gnum] = TimeCount[Gnum] + 350; if( TimeCount[Gnum] >=  400) { tryl3[Gnum] = TimeCount[Gnum] - 400 + 50; Tsdf[Gnum]++; }
 tryl4[Gnum] = TimeCount[Gnum] + 450; if( TimeCount[Gnum] >=  300) { tryl4[Gnum] = TimeCount[Gnum] - 300 + 50; Tsdf[Gnum]++; }
 tryl5[Gnum] = TimeCount[Gnum] + 550; if( TimeCount[Gnum] >=  200) { tryl5[Gnum] = TimeCount[Gnum] - 200 + 50; Tsdf[Gnum]++; }
 tryl6[Gnum] = TimeCount[Gnum] + 650; if( TimeCount[Gnum] >=  100) { tryl6[Gnum] = TimeCount[Gnum] - 100 + 50; Tsdf[Gnum]++; }
 if (document.all){
  document.all(TRYnm0[Gnum]).style.left=tryl0[Gnum];
  document.all(TRYnm1[Gnum]).style.left=tryl1[Gnum];
  document.all(TRYnm2[Gnum]).style.left=tryl2[Gnum];
  document.all(TRYnm3[Gnum]).style.left=tryl3[Gnum];
  document.all(TRYnm4[Gnum]).style.left=tryl4[Gnum];
  document.all(TRYnm5[Gnum]).style.left=tryl5[Gnum];
  document.all(TRYnm6[Gnum]).style.left=tryl6[Gnum];
  document.all(TRYt[Gnum]).style.left= (TimeCount[Gnum] % 100) + 350;
  document.all(TRYs[Gnum]).style.left= (TimeCount[Gnum] - tryls[Gnum] + 750) % 700;
 }
 else{
  if (document.getElementById){
   document.getElementById(TRYnm0[Gnum]).style.left=tryl0[Gnum];
   document.getElementById(TRYnm1[Gnum]).style.left=tryl1[Gnum];
   document.getElementById(TRYnm2[Gnum]).style.left=tryl2[Gnum];
   document.getElementById(TRYnm3[Gnum]).style.left=tryl3[Gnum];
   document.getElementById(TRYnm4[Gnum]).style.left=tryl4[Gnum];
   document.getElementById(TRYnm5[Gnum]).style.left=tryl5[Gnum];
   document.getElementById(TRYnm6[Gnum]).style.left=tryl6[Gnum];
   document.getElementById(TRYt[Gnum]).style.left= (TimeCount[Gnum] % 100) + 350;
   document.getElementById(TRYs[Gnum]).style.left= (TimeCount[Gnum] - tryls[Gnum] + 750) % 700;
  }
  else{
   if (document.layers){
    document.layers[TRYnm0[Gnum]].left=tryl0[Gnum];
    document.layers[TRYnm1[Gnum]].left=tryl1[Gnum];
    document.layers[TRYnm2[Gnum]].left=tryl2[Gnum];
    document.layers[TRYnm3[Gnum]].left=tryl3[Gnum];
    document.layers[TRYnm4[Gnum]].left=tryl4[Gnum];
    document.layers[TRYnm5[Gnum]].left=tryl5[Gnum];
    document.layers[TRYnm6[Gnum]].left=tryl6[Gnum];
    document.layers[TRYt[Gnum]].left= (TimeCount[Gnum] % 100) + 350;
    document.layers[TRYs[Gnum]].left= (TimeCount[Gnum] - tryls[Gnum] + 750) % 700;
   }
  }
 }
 if(Tsdf[Gnum] != hTsdf[Gnum] ) {
  hTsdf[Gnum] = Tsdf[Gnum];
  if (DGflg[Gnum] == 1) {
   if(Items[Gnum][1] > 0 ) {
    ShopItemnum[ShopId[Gnum]] = Items[Gnum][1];
//    parm[Gnum] = (Tsdf[Gnum] + ShopItemnum[ShopId[Gnum]] + (CycleCount[Gnum] * 7)) % ShopItemnum[ShopId[Gnum]];
    parm[Gnum] = (Tsdf[Gnum] + (CycleCount[Gnum] * 7)) % ShopItemnum[ShopId[Gnum]];
    if(parm[Gnum] < 0 ) {
     parm[Gnum] = parm[Gnum] + ShopItemnum[ShopId[Gnum]];
    }
    anime_2(Gnum,(7 - Tsdf[Gnum]) % 7,parm[Gnum]);
//    if (Gnum < 2) {mimgup(Gnum,(10 - Tsdf[Gnum]) % 7);}
//    if (Gnum == 2) {mimgup(Gnum,(10 - Tsdf[Gnum]) % 7),(parm[Gnum] + 3) % 7);}
     mimgup(Gnum,(10 - Tsdf[Gnum]) % 7,(parm[Gnum] + 3) % 7);
//     mimgup(Gnum,((10 - Tsdf[Gnum]) % 7),mimgItemcount[Gnum]);
   } else {
    DGflg[Gnum] = 0;
   }
  }
  if (scmodeflg == 0) {
   TimeSpd[0] = 0;
   TimeSpd[1] = 0;
   TimeSpd[2] = 0;
  }
 }
Gnum = (Gnum + 1) % 3;
delayani(Gnum);
}

function handleFileSelect(evt,Gnum) {
changez("TRYlocal2",0);
LFflg[Gnum] = "y";
DGflg[Gnum] = 0;
preset(Gnum);
Items[Gnum][0] = [];
Items[Gnum][1] = 0;
//if (window.localStorage.getItem(0) == undefined) { localStorage.setItem(0, 0); }
  var  k = 1;
  var files = evt.target.files; // FileList object
  for (var i = 0, f; f = files[i]; i++) {
//  for (var i = 0; i < files.length; i++) {
    if (!f.type.match('image.*')) { continue; }
    var reader = new FileReader();
    reader.onload = (function(theFile) {
      return function(e) {
       if (Gnum == 0 ) {
        Items[Gnum][0].push([e.target.result, theFile.name, e.target.result, 100, 100, 100, 50, 0])
       } else if (Gnum == 1 ) {
        Items[Gnum][0].push([e.target.result, theFile.name, e.target.result, 100, 100, 120, 120, 0])
       } else {
        Items[Gnum][0].push([e.target.result, theFile.name, e.target.result, 100, 100, 100, 220, 0])
//        window.localStorage.setItem(k, [e.target.result, theFile.name, e.target.result, 100, 100, 100, 220, 0].join("<kugiri>"));
        k++;
       }
       if (i > (files.length - 1) ) {
        Items[Gnum][1] = i;
//       if (k > (files.length) ) {
//        Items[Gnum][1] = k;
        DGflg[Gnum] = 1;
        changetry(Gnum);
//        window.localStorage[0] = k - 1;
//        window.localStorage.setItem(0, i);
       }
      };
    })(f);
    reader.readAsDataURL(f);
  }
}

function cget(Gnum) {
DGflg[Gnum] = 0;
preset(Gnum);
for (var k = 0; k < window.localStorage.getItem(0); k++) {
 Items[Gnum][0][k] = window.localStorage.getItem(k + 1).split("<kugiri>");
}
Items[Gnum][1] = window.localStorage.getItem(0);
DGflg[Gnum] = 1;
changetry(Gnum);
}

function sityaku(Gnum) {
//if (('localStorage' in window) && window['localStorage'] !== null) {
if (typeof localStorage !== 'undefined') {
if ((window.localStorage.getItem(0) == undefined)||(window.localStorage.getItem(0) < 1)) {
var TRYmimgsetumeihtml;
TRYmimgsetumeihtml = "\
<center>現在、気になるアイテムリストの登録はありません。<br><br>\
<font size=2>気になるアイテムリストとは、アイテム情報をブラウザ内に保存し、後で確認できる機能です。\
「まだ買わないけど後でまた詳しく調べたい」といった時などに便利です。<br><br>\
気になるアイテムリストの登録は、\
<a href='javascript:cngcg(\"TRYme\",\"TRYmimg\",\"1952\",\"sel\",\"\",\"1953\",\"sel\",\"\",\"1954\",\"aJP\",\"春\")'>試着画面</a>\
に表示されるアイテム画像にマウスをかざして表示される\
「気になるアイテムリストに登録する」リンクをクリックする事で行われます。</font></center>\
<a href='javascript:changez(\"TRYlocal3\",0)'>×</a>";
 if (document.all){
  document.all("TRYlocal3").innerHTML= TRYmimgsetumeihtml; 
 }else if (document.getElementById){
  document.getElementById("TRYlocal3").innerHTML= TRYmimgsetumeihtml;
 }
 changez("TRYlocal3",5);
} else {
 LFflg[Gnum] = "k";
 Enum = Gnum;
 cget(Gnum);
}
} else {
  window.alert("すみません、お使いのブラウザでは気になるアイテムリストを利用できません。。。");}
}

function btonl() {
DataGet(2,0,"yJP");
changez("TRYlocal2",0);
changez("RYmimgl",2);
}

function ssave(Gnum) {
Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][5] = document.images["mimg" + Gnum].height;
Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][10] = "a";
var TRYmimglnkhtmla = "<center><font size=2><a href='javascript:addmemo(" + Gnum + ")'>気になるアイテムリストに登録する</a></font></center>";
if (document.all){
 Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][6] = document.all("TRYmimg" + Gnum).style.top;
 Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][7] = parseInt(document.all("TRYmimg" + Gnum).style.left) - 10;
 Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][9] = document.all("TRYmimg" + Gnum).style.height;
 document.all("TRYmimgsetumei").innerHTML= TRYmimglnkhtmla;
}else if (document.getElementById){
 Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][6] = document.getElementById("TRYmimg" + Gnum).style.top;
 Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][7] = parseInt(document.getElementById("TRYmimg" + Gnum).style.left) - 10;
 Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][9] = document.getElementById("TRYmimg" + Gnum).style.height;
 document.getElementById("TRYmimgsetumei").innerHTML= TRYmimglnkhtmla;
}else if (document.layers){
 Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][6] = document.layers("TRYmimg" + Gnum).style.top;
 Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][7] = parseInt(document.layers("TRYmimg" + Gnum).style.left) - 10;
 Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][9] = document.layers("TRYmimg" + Gnum).style.height;
}
if (LFflg[2] == "k") {
 window.localStorage.setItem(mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7] + 1, Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]].join("<kugiri>"));
}

coodlink = "";
if ((Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][11] != undefined)&&(Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][11].match(/ID/) == null)) {
 coodpm[Gnum] = ""
 + "s" + Gnum + "=" + Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][11] + "ID&"
 + "i" + Gnum + "=" + Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][12] + "&"
 + "ih" + Gnum + "=" + Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][5] + "&"
 + "t" + Gnum + "=" + Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][6] + "&"
 + "l" + Gnum + "=" + Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][7] + "&"
 + "sh" + Gnum + "=" + Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][9] + "";
}
if ((coodpm[0] != "")&&(coodpm[1] != "")&(coodpm[2] != "")) {
 coodlink = homeurl + "/index.cgi?" + coodpm[0] + "&" + coodpm[1] + "&" + coodpm[2] + "&c=19#cood";
// if (document.all){
//  document.all["mlink3"].href = coodlink;
// } else if (document.getElementById){
//  document.links["mlink3"].href = coodlink;
// }
 changez("TRYmimglnkw",0);
} else {
 changez("TRYmimglnkw",2);
}

changezm(0);
}

function addmemo(Gnum) {
ssave(Gnum);
if (window.localStorage.getItem(0) == undefined) { localStorage.setItem(0, 0); }
if (ShopId[Gnum] == "sel") {
 if (Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][10] != "a") {
  Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][10] = "a";
 }
 if (Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][9] == undefined ) {
  Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][9] = Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]][5];
 }
}
var j = parseInt(window.localStorage.getItem(0)) + 1;
window.localStorage.setItem(j, Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]].join("<kugiri>"));
window.localStorage.setItem(0, j);
//Items[2][0][j - 1] = Items[Gnum][0][mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]];
//Items[2][1] = j;
//ShopItemnum[ShopId[2]] = Items[2][1];
//cget(2);
sityaku(2);
}

function delmemo(Gnum) {
if (Gnum == 2) {
document.images["mimg" + Gnum].src = "w.JPG";
document.images["mimg" + Gnum].title = "";
document.images["mimg" + Gnum].alt = "";
document.images["dimg" + Gnum + ((10 - Tsdf[Gnum]) % 7)].src = "w.JPG";
document.images["dimg" + Gnum + ((10 - Tsdf[Gnum]) % 7)].title = "";
document.images["dimg" + Gnum + ((10 - Tsdf[Gnum]) % 7)].alt = "";
changez("TRYmimg0",4);
changez("TRYmimg1",3);
changez("TRYmimg2",2);
if (document.all){
// document.all["mlink" + Gnum].href = "";
 document.all["dlink" + Gnum + ((10 - Tsdf[Gnum]) % 7)].href = "";
 document.all("TRYmimgsetumei").innerHTML= "";
}else if (document.getElementById){
// document.links["mlink" + Gnum].href = "";
 document.links["dlink" + Gnum + ((10 - Tsdf[Gnum]) % 7)].href = "";
 document.getElementById("TRYmimgsetumei").innerHTML= "";
}
for (var j = mimgItemCount[Gnum][(10 - Tsdf[Gnum]) % 7]; j < Items[Gnum][1]; j++) {
 Items[Gnum][0][j] = Items[Gnum][0][j + 1];
 window.localStorage.setItem(j + 1, window.localStorage.getItem(j + 2));
}
window.localStorage.removeItem(window.localStorage.getItem(0));
window.localStorage.setItem(0, window.localStorage.getItem(0) -1);
Items[Gnum][1] = Items[Gnum][1] -1;
ShopItemnum[ShopId[Gnum]] = Items[Gnum][1];
cget(Gnum);
}
}

var flag = true;
function TRYmimg2_Move() {
 flag =! flag;
 document.onmousemove = eve;
 function eve(e) {
  if (flag != true){
   if (document.all){
    document.all("TRYmimgmove").style.left=window.event.clientX + document.body.scrollLeft -5 - 25 - 25 - 10 - TRYmimgLeft;
    document.all("TRYmimgmove").style.top=window.event.clientY + document.body.scrollTop -5 - 255 - 30 - 20 - TRYmimgTop + 35;
    document.all("TRYmimgsize").style.left=document.all("TRYmimgmove").style.left;
    document.all("TRYmimgsize").style.top=parseInt(document.all("TRYmimgmove").style.top) + parseInt(document.images["mimg" + Enum].height) - 20;
    document.all("TRYmimgarea").style.left=parseInt(document.all("TRYmimgmove").style.left) - 30;
    document.all("TRYmimgarea").style.top=parseInt(document.all("TRYmimgmove").style.top) + parseInt(document.all("TRYmimg" + Enum).style.height) - 20;
    document.all("TRYmimg" + Enum).style.left=parseInt(document.all("TRYmimgmove").style.left) - 50;
    document.all("TRYmimg" + Enum).style.top=parseInt(document.all("TRYmimgmove").style.top) + 10;
    document.all("TRYmimgmove").style.background ="";
    document.all("TRYmimgsize").style.background ="";
    document.all("TRYmimgarea").style.background ="";
    document.all("TRYmimgarea").innerHTML= "<center><font size=2>Click<br>to<br>end.</font></center>";
    document.all("TRYmimgmove").innerHTML= "<center><font size=2>Click<br>to<br>end.</font></center>";
    document.all("TRYmimgsize").innerHTML= "<center><font size=2>Click<br>to<br>end.</font></center>";

    if (Enum == 2) { TRYmimgctl(parseInt(document.all("TRYmimg" + Enum).style.top),parseInt(document.all("TRYmimg" + Enum).style.height)) }

   }else{
    if (document.getElementById){
     document.getElementById("TRYmimgmove").style.left=e.pageX - 25 - 25 - 10 - TRYmimgLeft;
     document.getElementById("TRYmimgmove").style.top=e.pageY - 255 - 30 - 20 - TRYmimgTop + 35;
     document.getElementById("TRYmimgsize").style.left=document.getElementById("TRYmimgmove").style.left;
     document.getElementById("TRYmimgsize").style.top=parseInt(document.getElementById("TRYmimgmove").style.top) + parseInt(document.images["mimg" + Enum].height) - 20;
     document.getElementById("TRYmimgarea").style.left=parseInt(document.getElementById("TRYmimgmove").style.left) - 30;
     document.getElementById("TRYmimgarea").style.top=parseInt(document.getElementById("TRYmimgmove").style.top) + parseInt(document.getElementById("TRYmimg" + Enum).style.height) - 20;
     document.getElementById("TRYmimg" + Enum).style.left=parseInt(document.getElementById("TRYmimgmove").style.left) - 50;
     document.getElementById("TRYmimg" + Enum).style.top=parseInt(document.getElementById("TRYmimgmove").style.top) + 10;
     document.getElementById("TRYmimgmove").style.background ="";
     document.getElementById("TRYmimgsize").style.background ="";
     document.getElementById("TRYmimgarea").style.background ="";
     document.getElementById("TRYmimgarea").innerHTML= "<center><font size=2>Click<br>to<br>end.</font></center>";
     document.getElementById("TRYmimgmove").innerHTML= "<center><font size=2>Click<br>to<br>end.</font></center>";
     document.getElementById("TRYmimgsize").innerHTML= "<center><font size=2>Click<br>to<br>end.</font></center>";

     if (Enum == 2) { TRYmimgctl(parseInt(document.getElementById("TRYmimg" + Enum).style.top),parseInt(document.getElementById("TRYmimg" + Enum).style.height)) }

    }
   }
  }
 }
}

function TRYmimgctl(mtop,mheight) {
if (Enum == 2) {
if (mtop < 60) {
 if (mtop + mheight < 100) {
  changez("TRYmimg0",3);
  changez("TRYmimg1",2);
  changez("TRYmimg2",4);
 } else if (mtop + mheight < 240){
  changez("TRYmimg0",0);
  changez("TRYmimg1",3);
  changez("TRYmimg2",4);
 } else if (mtop + mheight < 300){
  changez("TRYmimg0",4);
  changez("TRYmimg1",0);
  changez("TRYmimg2",3);
 } else {
  changez("TRYmimg0",4);
  changez("TRYmimg1",3);
  changez("TRYmimg2",2);
 }
} else if ((mtop >= 100)&&(mtop < 200)) {
 changez("TRYmimg0",4);
 changez("TRYmimg1",0);
 changez("TRYmimg2",3);
} else {
 changez("TRYmimg0",4);
 changez("TRYmimg1",2);
 changez("TRYmimg2",3);
}
}
}

function TRYmimg2_Size() {
 flag =! flag;
 document.onmousemove = eve;
 function eve(e) {
  if (flag != true){
   if (document.all){
    document.all("TRYmimgsize").style.top=window.event.clientY + document.body.scrollTop -5 - 255 - 30 - 20 - TRYmimgTop + 35;
    document.images["mimg" + Enum].height =parseInt(document.all("TRYmimgsize").style.top) - parseInt(document.all("TRYmimgmove").style.top) + 20;
    if (document.images["mimg" + Enum].height > 160) {document.all("TRYmimg" + Enum).style.width=document.images["mimg" + Enum].height}

    document.all("TRYmimg" + Enum).style.height=parseInt(document.images["mimg" + Enum].height) - imgarea[Enum];
    document.all("TRYmimgarea").style.top=parseInt(document.all("TRYmimgmove").style.top) + parseInt(document.images["mimg" + Enum].height) - 20;
    document.all("TRYmimgmove").style.background ="";
    document.all("TRYmimgsize").style.background ="";
    document.all("TRYmimgarea").style.background ="";
    document.all("TRYmimgarea").innerHTML= "<center><font size=2>Click<br>to<br>end.</font></center>";
    document.all("TRYmimgmove").innerHTML= "<center><font size=2>Click<br>to<br>end.</font></center>";
    document.all("TRYmimgsize").innerHTML= "<center><font size=2>Click<br>to<br>end.</font></center>";

    if (Enum == 2) { TRYmimgctl(parseInt(document.all("TRYmimg" + Enum).style.top),parseInt(document.all("TRYmimg" + Enum).style.height)) }

   }else{
    if (document.getElementById){
     document.getElementById("TRYmimgsize").style.top=e.pageY - 255 - 30 - 20 - TRYmimgTop + 35;
     document.images["mimg" + Enum].height=parseInt(document.getElementById("TRYmimgsize").style.top) - parseInt(document.getElementById("TRYmimgmove").style.top) + 20;
     if (document.images["mimg" + Enum].height > 160) {document.getElementById("TRYmimg" + Enum).style.width=document.images["mimg" + Enum].height}

     document.getElementById("TRYmimg" + Enum).style.height=parseInt(document.images["mimg" + Enum].height) - imgarea[Enum];
     document.getElementById("TRYmimgarea").style.top=parseInt(document.getElementById("TRYmimgmove").style.top) + parseInt(document.getElementById("TRYmimg" + Enum).style.height) - 20;
     document.getElementById("TRYmimgmove").style.background ="";
     document.getElementById("TRYmimgsize").style.background ="";
     document.getElementById("TRYmimgarea").style.background ="";
     document.getElementById("TRYmimgarea").innerHTML= "<center><font size=2>Click<br>to<br>end.</font></center>";
     document.getElementById("TRYmimgmove").innerHTML= "<center><font size=2>Click<br>to<br>end.</font></center>";
     document.getElementById("TRYmimgsize").innerHTML= "<center><font size=2>Click<br>to<br>end.</font></center>";

     if (Enum == 2) { TRYmimgctl(parseInt(document.getElementById("TRYmimg" + Enum).style.top),parseInt(document.getElementById("TRYmimg" + Enum).style.height)) }

    }
   }
  }
 }
}

function TRYmimg2_Area() {
 flag =! flag;
 document.onmousemove = eve;
 function eve(e) {
  if (flag != true){
   if (document.all){
    document.all("TRYmimgarea").style.top=window.event.clientY + document.body.scrollTop -5 - 255 - 30 - 10 - TRYmimgTop + 35;
    if (parseInt(document.all("TRYmimgarea").style.top) <= parseInt(document.all("TRYmimgsize").style.top)) {
     imgarea[Enum]=parseInt(document.all("TRYmimgsize").style.top) - parseInt(document.all("TRYmimgarea").style.top);
     document.all("TRYmimg" + Enum).style.height=parseInt(document.all("TRYmimgarea").style.top) - parseInt(document.all("TRYmimgmove").style.top) + 20;
    } else {
     imgarea[Enum]=0;
     document.all("TRYmimg" + Enum).style.height=document.images["mimg" + Enum].height;
    }
    document.all("TRYmimgmove").style.background ="";
    document.all("TRYmimgsize").style.background ="";
    document.all("TRYmimgarea").style.background ="";
    document.all("TRYmimgarea").innerHTML= "<center><font size=2>Click<br>to<br>end.</font></center>";
    document.all("TRYmimgmove").innerHTML= "<center><font size=2>Click<br>to<br>end.</font></center>";
    document.all("TRYmimgsize").innerHTML= "<center><font size=2>Click<br>to<br>end.</font></center>";

    if (Enum == 2) { TRYmimgctl(parseInt(document.all("TRYmimg" + Enum).style.top),parseInt(document.all("TRYmimg" + Enum).style.height)) }

   }else{
    if (document.getElementById){
     document.getElementById("TRYmimgarea").style.top=e.pageY - 255 - 30 - 10 - TRYmimgTop + 35;
     if (parseInt(document.getElementById("TRYmimgarea").style.top) <= parseInt(document.getElementById("TRYmimgsize").style.top)) {
      imgarea[Enum]=parseInt(document.getElementById("TRYmimgsize").style.top) - parseInt(document.getElementById("TRYmimgarea").style.top);
      document.getElementById("TRYmimg" + Enum).style.height=parseInt(document.getElementById("TRYmimgarea").style.top) - parseInt(document.getElementById("TRYmimgmove").style.top) + 20;
     } else {
      imgarea[Enum]=0;
      document.getElementById("TRYmimg" + Enum).style.height=document.images["mimg" + Enum].height;
     }
     document.getElementById("TRYmimgmove").style.background ="";
     document.getElementById("TRYmimgsize").style.background ="";
     document.getElementById("TRYmimgarea").style.background ="";
     document.getElementById("TRYmimgarea").innerHTML= "<center><font size=2>Click<br>to<br>end.</font></center>";
     document.getElementById("TRYmimgmove").innerHTML= "<center><font size=2>Click<br>to<br>end.</font></center>";
     document.getElementById("TRYmimgsize").innerHTML= "<center><font size=2>Click<br>to<br>end.</font></center>";

     if (Enum == 2) { TRYmimgctl(parseInt(document.getElementById("TRYmimg" + Enum).style.top),parseInt(document.getElementById("TRYmimg" + Enum).style.height)) }

    }
   }
  }
 }
}

function onlimgGet(Gnum) {
changez("TRYlocal3",0);
LFflg[Gnum] = "u";
DGflg[Gnum] = 0;
preset(Gnum);
Items[Gnum][0] = [];
Items[Gnum][1] = 0;
Items[Gnum][0].push([document.urlform.url.value, document.urlform.url.value, document.urlform.url.value, 100, 100, 100, 220, 0])
Items[Gnum][1] = 1;
DGflg[Gnum] = 1;
changetry(Gnum);
}

function onlimgGetfm() {
TimeSpd[0] = 0;
TimeSpd[1] = 0;
TimeSpd[2] = 0;
var TRYmimgsetumeihtml;
TRYmimgsetumeihtml = "\
<font size=2>画像のURLを指定してください。\
<form name=\"urlform\">\
<input type=\"text\" name=\"dummy\" style=\"position:absolute;visibility:hidden\">\
<input type=\"text\" name=\"url\" size=\"30\" value=\"http://\"><br>\
<input type=\"button\" value=\"go\" onClick='onlimgGet(2)'></form></font>\
<a href='javascript:changez(\"TRYlocal3\",0)'>×</a></font>";
if (document.all){ document.all("TRYlocal3").innerHTML=TRYmimgsetumeihtml }
if (document.getElementById){ document.getElementById("TRYlocal3").innerHTML=TRYmimgsetumeihtml }
changez("TRYlocal3",5);
}

function lfGetfm() {
if (window.File) {
 TimeSpd[0] = 0;
 TimeSpd[1] = 0;
 TimeSpd[2] = 0;
 changez("TRYlocal3",0);
 changez("TRYlocal2",5);
} else {
  window.alert("すみません、お使いのブラウザではPC画像と組合わせる機能を利用できません。。。");
}
}

function swaptry(t1,t2) {
changez(t1,0);
changez(t2,2);
}

function movetray(movetop,moveleft,znum) {
TRYmimgTop = movetop;
TRYmimgLeft = moveleft;
if (document.all){
 document.all("TRYmimg").style.top=movetop;
 document.all("TRYmimg").style.left=moveleft;
} else if (document.getElementById){
 document.getElementById("TRYmimg").style.top=movetop;
 document.getElementById("TRYmimg").style.left=moveleft;
} else if (document.layers){
 document.layers["TRYmimg"].top=movetop;
 document.layers["TRYmimg"].left=moveleft;
}
changez("TRYmimg",znum);
changez("TRYshare",0);
}

function coad(s0,i0,ih0,t0,l0,sh0,s1,i1,ih1,t1,l1,sh1,s2,i2,ih2,t2,l2,sh2) {
movetray(0,400,4);
changez("TRYshare",5);
linkparm[0] = [ih0,t0,l0,sh0];
linkparm[1] = [ih1,t1,l1,sh1];
linkparm[2] = [ih2,t2,l2,sh2];
tstart("",s0,i0,"",s1,i1,"",s2,i2);
}

function linkpmset(Gnum) {
Items[Gnum][0][0][5] = linkparm[Gnum][0];
Items[Gnum][0][0][6] = linkparm[Gnum][1];
Items[Gnum][0][0][7] = linkparm[Gnum][2];
Items[Gnum][0][0][9] = linkparm[Gnum][3];
}

function tstartchara() {
DataGet(3,0,"sel1");
DataGet(4,0,"sel");
DataGet(5,0,"sel1");
startchara();
}

function startchara() {
 IntervarIDc=setTimeout("startchara()", 100);
 if ( DGflg[3] + DGflg[4] + DGflg[5] == 3 ) {
  clearTimeout(IntervarIDc);
  delaychara(3);
 }
}

function delaychara(Gnum) {
Gnum2 = Gnum;
timerID[Gnum]=setTimeout("charaup(Gnum2)", 3000);
}

function charaup(Gnum) {

changez("TRYchara",6);
changez("TRYcimg3",3);
changez("TRYcimg4",2);
changez("TRYcimg5",4);
changez("TRYcimgcmt5",5);
document.images["cimg" + Gnum].title = Items[Gnum][0][cnum[Gnum]][1];
document.images["cimg" + Gnum].alt = Items[Gnum][0][cnum[Gnum]][1];
if ( Gnum == 5 ) {
 changez("TRYcimgcmt",5);
 document.images["cimg" + Gnum].src = homeurl + "/c.JPG";
 document.images["cimg" + Gnum].height = 150;
} else {
 document.images["cimg" + Gnum].src = Items[Gnum][0][cnum[Gnum]][0];
 document.images["cimg" + Gnum].height = Math.round(Items[Gnum][0][cnum[Gnum]][5] / 2);
} 
if (document.all){
 if ( Gnum == 5 ) {
  changez("TRYchara",6);
  document.all("TRYchara").style.top=-30;
  document.all("TRYchara").style.left=-40;
  document.all["clink" + Gnum].href = Items[Gnum][0][cnum[Gnum]][2]
  document.all("TRYcimg" + Gnum).style.top=-8;
  document.all("TRYcimg" + Gnum).style.left=-20;
  document.all("TRYcimg" + Gnum).style.height = 35;
  document.all("TRYcimg" + Gnum).style.width=document.images["cimg" + Gnum].height;
  document.all("TRYcimgcmt5").style.height = 30;
  document.all("TRYcimgcmt5").innerHTML= "<a href='" + Items[Gnum][0][cnum[Gnum]][2] + "' target='detail' style='text-decoration:none;'><font size=2><b>" + Items[Gnum][0][cnum[Gnum]][1] + "</b></font></a>";
  document.all("TRYcimgcmt").style.height = 20;
  document.all("TRYcimgcmt").innerHTML= "<center>← <a href='javascript:pausechara()'><font size=2>pause</font></a> | <a href='javascript:stopchara()'><font size=2>close</font></a></center>";
 } else {
  document.all("TRYcimg" + Gnum).style.top=Math.round(Items[Gnum][0][cnum[Gnum]][6] / 2);
  document.all("TRYcimg" + Gnum).style.left=Math.round((parseInt(Items[Gnum][0][cnum[Gnum]][7]) + 10) / 2);
  if ( Items[Gnum][0][cnum[Gnum]][9] ) { document.all("TRYcimg" + Gnum).style.height = Math.round(Items[Gnum][0][cnum[Gnum]][9] / 2) } else {document.all("TRYcimg" + Gnum).style.height = document.images["cimg" + Gnum].height}
  if (document.images["cimg" + Gnum].height > 80) { document.all("TRYcimg" + Gnum).style.width=document.images["cimg" + Gnum].height } else { document.all("TRYcimg" + Gnum).style.width=80 }
 }
}
else{
 if (document.getElementById){
  if ( Gnum == 5 ) {
   document.links["clink" + Gnum].href = Items[Gnum][0][cnum[Gnum]][2]
   document.getElementById("TRYcimg" + Gnum).style.top=-8;
   document.getElementById("TRYcimg" + Gnum).style.left=-20;
   document.getElementById("TRYcimg" + Gnum).style.height = 35;
   document.getElementById("TRYcimg" + Gnum).style.width=document.images["cimg" + Gnum].height;
   document.getElementById("TRYcimgcmt5").style.height = 30;
   document.getElementById("TRYcimgcmt5").innerHTML= "<a href='" + Items[Gnum][0][cnum[Gnum]][2] + "' target='detail' style='text-decoration:none;'><font size=2><b>" + Items[Gnum][0][cnum[Gnum]][1] + "</b></font></a>";
   document.getElementById("TRYcimgcmt").style.height = 20;
   document.getElementById("TRYcimgcmt").innerHTML= "<center>← <a href='javascript:pausechara()'><font size=2>pause</font></a> | <a href='javascript:stopchara()'><font size=2>close</font></a></center>";
  } else {
   document.getElementById("TRYcimg" + Gnum).style.top=Math.round(Items[Gnum][0][cnum[Gnum]][6] / 2);
   document.getElementById("TRYcimg" + Gnum).style.left=Math.round((parseInt(Items[Gnum][0][cnum[Gnum]][7]) + 10) / 2);
   if ( Items[Gnum][0][cnum[Gnum]][9] ) { document.getElementById("TRYcimg" + Gnum).style.height = Math.round(Items[Gnum][0][cnum[Gnum]][9] / 2) } else {document.getElementById("TRYcimg" + Gnum).style.height = document.images["cimg" + Gnum].height}
   if (document.images["cimg" + Gnum].height > 80) { document.getElementById("TRYcimg" + Gnum).style.width=document.images["cimg" + Gnum].height } else { document.getElementById("TRYcimg" + Gnum).style.width=80 }
  }
 }else{
  if (document.layers){
   document.layers["TRYcimg" + Gnum].top=Items[Gnum][0][cnum[Gnum]][6];
   document.layers["TRYcimg" + Gnum].left=parseInt(Items[Gnum][0][cnum[Gnum]][7]) + 10;
   if ( Items[Gnum][0][cnum[Gnum]][9] ) { document.layers("TRYcimg" + Gnum).style.height = Items[Gnum][0][cnum[Gnum]][9] } else {document.layers("TRYcimg" + Gnum).style.height = document.images["cimg" + Gnum].height}
  }
 }
}

cnum[Gnum] = (cnum[Gnum] + 1) % parseInt(Items[Gnum][1]);
Gnum = ((Gnum + 1) % 3) + 3;
delaychara(Gnum);
}

function stopchara(){
changez("TRYchara",0);
if (document.all){
 document.all("TRYchara").style.top=10;
 document.all("TRYchara").style.left=20;
} else if (document.getElementById){
 document.getElementById("TRYchara").style.top=10;
 document.getElementById("TRYchara").style.left=20;
}else if (document.layers){
 document.layers("TRYchara").style.top=10;
 document.layers("TRYchara").style.left=20;
}
clearTimeout(timerID[3]);
clearTimeout(timerID[4]);
clearTimeout(timerID[5]);
}

function pausechara(){
clearTimeout(timerID[3]);
clearTimeout(timerID[4]);
clearTimeout(timerID[5]);
if (document.all){
 document.all("TRYcimgcmt").innerHTML= "<center>← <a href='javascript:reschara()'><font size=2>start</font></a> | <a href='javascript:stopchara()'><font size=2>close</font></a></center>";
} else if (document.getElementById){
 document.getElementById("TRYcimgcmt").innerHTML= "<center>← <a href='javascript:reschara()'><font size=2>start</font></a> | <a href='javascript:stopchara()'><font size=2>close</font></a></center>";
}else if (document.layers){
 document.layers("TRYcimgcmt").innerHTML= "<center>← <a href='javascript:reschara()'><font size=2>start</font></a> | <a href='javascript:stopchara()'><font size=2>close</font></a></center>";
}
}


function reschara(){
if (document.all){
  document.all("TRYcimgcmt").innerHTML= "<center>← <a href='javascript:pausechara()'><font size=2>pause</font></a> | <a href='javascript:stopchara()'><font size=2>close</font></a></center>";
} else if (document.getElementById){
   document.getElementById("TRYcimgcmt").innerHTML= "<center>← <a href='javascript:pausechara()'><font size=2>pause</font></a> | <a href='javascript:stopchara()'><font size=2>close</font></a></center>";
}
delaychara(5);
}

//-->
