function init(){
window.onscroll = function(){
if(target=document.getElementById("totop")){
//show totop button when scroll starts
str=target.className;
if(str.match("v0")){
target.className=str.replace(/v0/,"v1");
}
//hide totop button when scroll hits top of page
if (document.all){
if(document.documentElement.scrollTop){
var tempPTop = document.documentElement.scrollTop;
} else {
var tempPTop = document.body.scrollTop;
};
} else {
var tempPTop = window.pageYOffset;
};
if(tempPTop==0){
target.className=str.replace(/v1/,"v0");
target.style.display="";
}
}
}
}
function initmap(){
//resize mobile map to square
resizemap("map1");
resizemap("map2");
resizemap("map3");
}
function resizemap(v){
if(target=document.getElementById(v)){
var mapwidth=window.innerWidth;
mapwidth=mapwidth*.8
var mapsrc=target.src+"&w="+mapwidth;
target.style.width=mapwidth+"px";
target.style.height=mapwidth+"px";
target.src=mapsrc;
}
}
function crSwfCode(SWFFILE,FW,FH){
var acontent = '';
document.write(acontent);
}
//set image button for porder
function sib(v){
//if(v==0){
if(target=document.getElementById("imgbtn")){
target.value=" ";
}
//}
}
function showhide2(v){
if(v.id){
if(target=document.getElementById(v.id)){
str=target.className;
if(str.match("v0")){
//target.className=str.replace(/v0/,"v1");
} else {
//target.className=str.replace(/v1/,"v0");
target.style.display="none";
}
}
}
}
function showhide(a,b,mode){
if(target=document.getElementById(a)){
str=target.className;
if(mode=="v1"){
target.className=str.replace(/v0/,"v1");
} else if(mode=="v0"){
target.className=str.replace(/v1/,"v0");
} else if(str.match(/v0/)){
target.className=str.replace(/v0/,"v1");
if(target2=document.getElementById(b)){
target2.className="v0";
};
} else if(str.match(/v1/)){
target.className=str.replace(/v1/,"v0");
if(target2=document.getElementById(b)){
target2.className="v1";
};
} else {
target.className="v0";
};
};
};
//function showhide(a,b){
// if(target=document.getElementById(b)){
// str=target.className;
// z_slidebox(b);
// if(str.match("v0")){
// target.className=str.replace(/v0/,"v1");
// a.value="「お届け先」と「ご注文者情報の住所」が同じ場合は押して下さい";
// document.getElementById("sendinfoflag").value=1;
// } else {
// target.className=str.replace(/v1/,"v0");
// a.value="「お届け先」と「ご注文者情報の住所」が異なる場合は押して下さい";
// document.getElementById("sendinfoflag").value=0;
// }
// }
//}
function z_slidebox(v){
if ($("#"+v).is(":hidden")) {
$("#"+v).slideDown("fast");
} else {
$("#"+v).slideUp("fast");
}
}
function activateorderpage(){
if(target=document.getElementById('jsbody')){
target.className='v1';
}
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// AJAX
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//rcrafz url popup (thickbox replacement) 20100629
function rcpopup(obj,url,mode){
//open
if(mode==1){
if(t=obj.parentNode){
if(a=document.getElementById("asff")){
a.parentNode.removeChild(a);
}
var element = document.createElement('div');
element.id="asff";
element.className="rcpopup";
t.appendChild(element);
//load flipflash
readRemoteData("asff",url);
} else {
return;
};
//close
} else {
if(a=document.getElementById("asff")){
a.parentNode.removeChild(a);
};
};
}
//XMLHttpRequest 20100629
httpRequest = false;
if(window.XMLHttpRequest) {
//Mozilla,Firefox,Safari,Opera etc
httpRequest = new XMLHttpRequest();
if (httpRequest.overrideMimeType) {
httpRequest.overrideMimeType('text/xml');
};
} else if(window.ActiveXObject) {
//IE
try {
httpRequest = new ActiveXObject('Msxml2.XMLHTTP');
} catch (e) {
httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
};
};
function readRemoteData(target,page){
if(page == '') return;
httpRequest.abort();
httpRequest.open('GET',page, true);
httpRequest.onreadystatechange = function() {
if(httpRequest.readyState == 4) {
if(httpRequest.status == 200) {
document.getElementById(target).innerHTML = httpRequest.responseText;
};
};
};
httpRequest.send(null);
};
//ボックスのスライド開閉機能 20100701 ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
//このobjId毎に格納するおおもとのパラメータ配列を生成
var PPP=new Array();
function rcSlideBox(objId,min,max,forceslidemode){
if(document.getElementById(objId)){
//初期化
//このobjId専用に格納するパラメータ配列を生成(無い場合)
if(!PPP[objId]){ PPP[objId]=new Array(); }
//イージング値 -100〜0〜100
PPP[objId]['edgingvalue']=100 ;
//カウント初期化(division数分ループ加算されていく)
PPP[objId]['stepcount']=0 ;
//分割数=スピード(数字が多いほど遅くなる)
PPP[objId]['division']=10 ;
//
if(min || max){
PPP[objId]['resetsize']=0 ;
} else {
PPP[objId]['resetsize']=1 ;
}
//既にスライド中の場合はリセットする
if(PPP[objId]['timer']){
clearTimeout(PPP[objId]['timer']);
PPP[objId]['stepcount']=0;
}
//openstatusが無い(初期状態)の時はclassNameから判別する
if(!PPP[objId]['openstatus']){
if(document.getElementById(objId).className.indexOf("v1")){
PPP[objId]['openstatus']="close";
} else if(document.getElementById(objId).className.indexOf("v0")){
PPP[objId]['openstatus']="open";
}
}
//ifj 強制スライドモード、既にopen or closeの場合はreturn
if(forceslidemode){
if( (forceslidemode=="open" && PPP[objId]['openstatus']=="open") || (forceslidemode=="close" && PPP[objId]['openstatus']=="closed") ){
return;
}
if(forceslidemode=="close"){
PPP[objId]['openstatus']="open";
} else if(forceslidemode=="open"){
PPP[objId]['openstatus']="closed";
}
}
//開いている場合、これから閉じる
if(
(forceslidemode=="close" && PPP[objId]['openstatus']=="open") ||
(!forceslidemode && PPP[objId]['openstatus']=="open")
){
//minとmaxを引数で指定してきた場合はそれに従う
if(min){
PPP[objId]['minsize']=min;
} else {
PPP[objId]['minsize']=1;
}
if(max){
PPP[objId]['maxsize']=max;
} else {
PPP[objId]['maxsize']=document.getElementById(objId).clientHeight;
}
rcSlideBoxExec(objId,"close");
PPP[objId]['openstatus']="close";
//閉じている場合、これから開く
} else if (
forceslidemode=="open" ||
!forceslidemode
) {
//classをv0からv1に切り替えて、一瞬、あるべきサイズで表示する。
//子要素の分量によってサイズが違うため、ここで最終サイズを取得する。
document.getElementById(objId).className=document.getElementById(objId).className.replace(/v0/,"v1");
document.getElementById(objId).style.height=null;
//minとmaxを引数で指定してきた場合はそれに従う
if(min){
PPP[objId]['minsize']=min;
} else {
PPP[objId]['minsize']=1;
}
if(max){
PPP[objId]['maxsize']=max;
} else {
PPP[objId]['maxsize']=document.getElementById(objId).clientHeight;
}
//すぐに縮める
document.getElementById(objId).style.height=0+"px";
//スライド実行
rcSlideBoxExec(objId,"open");
PPP[objId]['openstatus']="open";
}
//document.getElementById("txt").innerHTML=PPP[objId]['openstatus'];
}
}
function rcSlideBoxExec(objId,slidemode){
target=document.getElementById(objId);
if(PPP[objId]['stepcount']++ < PPP[objId]['division']){
var c=PPP[objId]['stepcount']/PPP[objId]['division'] ;
if(slidemode=="open"){
var x=Math.floor(PPP[objId]['minsize']+((PPP[objId]['maxsize']-PPP[objId]['minsize'])*(c+PPP[objId]['edgingvalue']/(100*Math.PI)*Math.sin( Math.PI*c))));
} else if(slidemode=="close") {
var x=Math.floor(PPP[objId]['maxsize']-((PPP[objId]['maxsize']-PPP[objId]['minsize'])*(c+PPP[objId]['edgingvalue']/(100*Math.PI)*Math.sin( Math.PI*c))));
}
PPP[objId]['timer']=setTimeout( "rcSlideBoxExec(\""+objId+"\",\""+slidemode+"\");" , 30 );
target.style.height=x+"px";
//document.getElementById("jsdebug").innerHTML=x;
} else {
PPP[objId]['stepcount'] = 0 ;
if(slidemode=="open"){
if(PPP[objId]['resetsize']==1){
target.style.height=null;
}
} else {
document.getElementById(objId).className=document.getElementById(objId).className.replace(/v1/,"v0");
}
}
}
//郵便番号が複数あった場合の確定スクリプト
function zipfix(v,type){
var R2=v.innerHTML.split("_");
//都道府県はselectboxなので少々厄介
document.getElementById(type+"address1").value=R2[0];
pulldown_option=document.getElementById(type+"address1").getElementsByTagName('option');
for(i=0; i区切りで来るので分割。
var R1=AJAXRESPONSE.split("<>");
var RESPONSE="";
//複数の選択肢がある場合
if(R1.length>1){
for(i=0;i"+R2[1]+"_"+R2[2]+"
";
}
showhide(type+"addresslistbox","","v1");
document.getElementById(type+"addresslist").innerHTML=RESPONSE;
//ドンピシャまたは該当無しの場合
} else if (R1.length==1){
var R2=R1[0].split("_");
showhide(type+"addresslistbox","","v0");
//IEはインデックス番号を取得しないとjsで選択できないので、配列を取得
var sel=document.getElementById(type+"address1").options;
for(var i=0; i documentHeight){
// rScrArr.TargetElementPosition = documentHeight- windowHeight;
//};
//compare current and target, true or false
//alert(rScrArr.TargetElementPosition);
rScrArr.updownFlag = !!(rScrArr.TargetElementPosition= rScrArr.tcurrentTopPosition) endFlag=1;
};
if (endFlag){
rScrArr.tcurrentTopPosition = rScrArr.TargetElementPosition;
rScrArr.timeId = clearInterval(rScrArr.timeId);
//endFlag=0;
};
scrollTo(rScrArr.currentLeftPosition, rScrArr.tcurrentTopPosition)
};
function clearallchecks(id){
if(target=document.getElementById(id)){
var childarray=target.childNodes;
for (var i=0; i1){
for (var j=0; j