123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441 |
- // JavaScript Document
- // クッキー保存 setCookie(クッキー名, クッキーの値, クッキーの有効日数); //
- function setCookie(c_name, value, expiredays) {
- // pathの指定
- var cnt = 0;
- /*var path = location.pathname;
- // pathをフォルダ毎に指定する場合のIE対策
- var paths = new Array();
- paths = path.split("/");
- if(paths[paths.length-1] != ""){
-
- paths[paths.length-1] = "";
-
- path = paths.join("/");
-
-
- }*/
- // 有効期限の日付
- var extime = new Date().getTime();
- var cltime = new Date(extime + (60 * 60 * 24 * 1000 * expiredays));
- var exdate = cltime.toUTCString();
- // クッキーに保存する文字列を生成
- var s = "";
- s += c_name + "=" + escape(value);// 値はエンコードしておく
- s += "; path=/"/*+ path*/;
- if (expiredays) {
- s += "; expires=" + exdate + "; ";
- } else {
- s += "; ";
- }
- // クッキーに保存
- document.cookie = s;
- }
-
- // クッキーの値を取得 getCookie(クッキー名); //
- function getCookie(c_name) {
- var st = "";
- var ed = "";
- if (document.cookie.length > 0) {
- // クッキーの値を取り出す
- st = document.cookie.indexOf(c_name + "=");
- if (st != -1) {
- st = st + c_name.length + 1;
- ed = document.cookie.indexOf(";", st);
- if (ed == -1) ed = document.cookie.length;
- // 値をデコードして返す
- return unescape(document.cookie.substring(st, ed));
- }
- }
- return "";
- }
- // クッキーの値をアラートで表示
- function checkCookie() {
- if (getCookie('backnumber')) {
- var setName = getCookie('backnumber');
- alert(setName);
- }
- if (getCookie('mobile_backnumber')) {
- var setName = getCookie('mobile_backnumber');
- alert(setName);
- }
- }
- /*function GetCookie( name )
- {
- var result = null;
-
- var cookieName = name + '=';
- var allcookies = document.cookie;
-
- var position = allcookies.indexOf( cookieName );
- if( position != -1 )
- {
- var startIndex = position + cookieName.length;
-
- var endIndex = allcookies.indexOf( ';', startIndex );
- if( endIndex == -1 )
- {
- endIndex = allcookies.length;
- }
-
- result = decodeURIComponent(
- allcookies.substring( startIndex, endIndex ) );
- }
-
- return result;
- }
- */
- //直下
- function getBackgNumber() {
- if (screen.width < 769) {
- // checkCookie();
- var num = getCookie("mobile_backnumber");
- if (num == "") {
- num = 2;
- }
- setBackground(num);
- } else {
- var num = getCookie("backnumber");
- setBackground(num);
- }
- }
- //second
- function getBackgNumber2() {
- if (screen.width < 769) {
- // checkCookie();
- var num = getCookie("mobile_backnumber");
- if (num == "") {
- num = 2;
- }
- setBackground2(num);
- } else {
- var num = getCookie("backnumber");
- setBackground2(num);
- }
- }
- //third/folder
- function getBackgNumber3() {
- if (screen.width < 769) {
- // checkCookie();
- var num = getCookie("mobile_backnumber");
- if (num == "") {
- num = 2;
- }
- setBackground3(num);
- } else {
- var num = getCookie("backnumber");
- setBackground3(num);
- }
- }
- //third/folder/folder
- function getBackgNumber3_2() {
- if (screen.width < 769) {
- // checkCookie();
- var num = getCookie("mobile_backnumber");
- if (num == "") {
- num = 2;
- }
- setBackground3_2(num);
- } else {
- var num = getCookie("backnumber");
- setBackground3_2(num);
- }
- }
-
- //直下
- function setBackground(num) {
- if (screen.width < 768) {
- if (num < 2) {
- /*body.style.backgroundImage = "url(../css/img/background1.png)";
- body.style.backgroundImage = "../css/img/background1.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(css/img/backgroundm1.png)";
- document.getElementById("back").style.backgroundImage = "url(css/img/backgroundm1.png)";
- document.getElementById("html-back").style.backgroundColor = "#D6D6D6";
- document.getElementById("back").style.backgroundColor = "#D6D6D6";
- setCookie('mobile_backnumber', 1, 7);
- } else if (num < 3) {
- /*body.style.backgroundImage = "url(../css/img/background2.png)";
- body.style.backgroundImage = "../css/img/background2.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(css/img/backgroundm2.png)";
- document.getElementById("back").style.backgroundImage = "url(css/img/backgroundm2.png)";
- document.getElementById("html-back").style.backgroundColor = "#F7F3BC";
- document.getElementById("back").style.backgroundColor = "#F7F3BC";
- setCookie('mobile_backnumber', 2, 7);
- } else {
- /*body.style.backgroundImage = "url(../css/img/background3.png)";
- body.style.backgroundImage = "../css/img/background3.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(css/img/backgroundm3.png)";
- document.getElementById("back").style.backgroundImage = "url(css/img/backgroundm3.png)";
- document.getElementById("html-back").style.backgroundColor = "#DAEDD0";
- document.getElementById("back").style.backgroundColor = "#DAEDD0";
- setCookie('mobile_backnumber', 3, 7);
- }
- return;
- }
- if (num < 2) {
- /*body.style.backgroundImage = "url(../css/img/background1.png)";
- body.style.backgroundImage = "../css/img/background1.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(css/img/background1.png)";
- document.getElementById("back").style.backgroundImage = "url(css/img/background1.png)";
- document.getElementById("html-back").style.backgroundColor = "#D6D6D6";
- document.getElementById("back").style.backgroundColor = "#D6D6D6";
- document.getElementById("button1").style.backgroundImage = "url(css/img/1_backcircle_red.png)";
- document.getElementById("button2").style.backgroundImage = "url(css/img/2_backcircle_gray.png)";
- document.getElementById("button3").style.backgroundImage = "url(css/img/3_backcircle_gray.png)";
- document.getElementById("button1").src = "css/img/1_backcircle_red.png";
- document.getElementById("button2").src = "css/img/2_backcircle_gray.png";
- document.getElementById("button3").src = "css/img/3_backcircle_gray.png";
- setCookie('backnumber', 1, 7);
- } else if (num < 3) {
- /*body.style.backgroundImage = "url(../css/img/background2.png)";
- body.style.backgroundImage = "../css/img/background2.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(css/img/background2.png)";
- document.getElementById("back").style.backgroundImage = "url(css/img/background2.png)";
- document.getElementById("html-back").style.backgroundColor = "#F7F3BC";
- document.getElementById("back").style.backgroundColor = "#F7F3BC";
- document.getElementById("button1").style.backgroundImage = "url(css/img/1_backcircle_gray.png)";
- document.getElementById("button2").style.backgroundImage = "url(css/img/2_backcircle_red.png)";
- document.getElementById("button3").style.backgroundImage = "url(css/img/3_backcircle_gray.png)";
- document.getElementById("button1").src = "css/img/1_backcircle_gray.png";
- document.getElementById("button2").src = "css/img/2_backcircle_red.png";
- document.getElementById("button3").src = "css/img/3_backcircle_gray.png";
- setCookie('backnumber', 2, 7);
- } else {
- /*body.style.backgroundImage = "url(../css/img/background3.png)";
- body.style.backgroundImage = "../css/img/background3.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(css/img/background3.png)";
- document.getElementById("back").style.backgroundImage = "url(css/img/background3.png)";
- document.getElementById("html-back").style.backgroundColor = "#DAEDD0";
- document.getElementById("back").style.backgroundColor = "#DAEDD0";
- document.getElementById("button1").style.backgroundImage = "url(css/img/1_backcircle_gray.png)";
- document.getElementById("button2").style.backgroundImage = "url(css/img/2_backcircle_gray.png)";
- document.getElementById("button3").style.backgroundImage = "url(css/img/3_backcircle_red.png)";
- document.getElementById("button1").src = "css/img/1_backcircle_gray.png";
- document.getElementById("button2").src = "css/img/2_backcircle_gray.png";
- document.getElementById("button3").src = "css/img/3_backcircle_red.png";
- setCookie('backnumber', 3, 7);
- }
- }
- //third/folder/folder
- function setBackground3_2(num) {
- if (screen.width < 768) {
- if (num < 2) {
- /*body.style.backgroundImage = "url(../css/img/background1.png)";
- body.style.backgroundImage = "../css/img/background1.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(../../../css/img/backgroundm1.png)";
- document.getElementById("back").style.backgroundImage = "url(../../../css/img/backgroundm1.png)";
- document.getElementById("html-back").style.backgroundColor = "#D6D6D6";
- document.getElementById("back").style.backgroundColor = "#D6D6D6";
- setCookie('mobile_backnumber', 1, 7);
- } else if (num < 3) {
- /*body.style.backgroundImage = "url(../css/img/background2.png)";
- body.style.backgroundImage = "../css/img/background2.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(../../../css/img/backgroundm2.png)";
- document.getElementById("back").style.backgroundImage = "url(../../../css/img/backgroundm2.png)";
- document.getElementById("html-back").style.backgroundColor = "#F7F3BC";
- document.getElementById("back").style.backgroundColor = "#F7F3BC";
- setCookie('mobile_backnumber', 2, 7);
- } else {
- /*body.style.backgroundImage = "url(../css/img/background3.png)";
- body.style.backgroundImage = "../css/img/background3.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(../../../css/img/backgroundm3.png)";
- document.getElementById("back").style.backgroundImage = "url(../../../css/img/backgroundm3.png)";
- document.getElementById("html-back").style.backgroundColor = "#DAEDD0";
- document.getElementById("back").style.backgroundColor = "#DAEDD0";
- setCookie('mobile_backnumber', 3, 7);
- }
- return;
- }
- if (num < 2) {
- /*body.style.backgroundImage = "url(../css/img/background1.png)";
- body.style.backgroundImage = "../css/img/background1.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(../../../css/img/background1.png)";
- document.getElementById("back").style.backgroundImage = "url(../../../css/img/background1.png)";
- document.getElementById("html-back").style.backgroundColor = "#D6D6D6";
- document.getElementById("back").style.backgroundColor = "#D6D6D6";
- document.getElementById("button1").style.backgroundImage = "url(../../../css/img/1_backcircle_red.png)";
- document.getElementById("button2").style.backgroundImage = "url(../../../css/img/2_backcircle_gray.png)";
- document.getElementById("button3").style.backgroundImage = "url(../../../css/img/3_backcircle_gray.png)";
- document.getElementById("button1").src = "../../../css/img/1_backcircle_red.png";
- document.getElementById("button2").src = "../../../css/img/2_backcircle_gray.png";
- document.getElementById("button3").src = "../../../css/img/3_backcircle_gray.png";
- setCookie('backnumber', 1, 7);
- } else if (num < 3) {
- /*body.style.backgroundImage = "url(../css/img/background2.png)";
- body.style.backgroundImage = "../css/img/background2.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(../../../css/img/background2.png)";
- document.getElementById("back").style.backgroundImage = "url(../../../css/img/background2.png)";
- document.getElementById("html-back").style.backgroundColor = "#F7F3BC";
- document.getElementById("back").style.backgroundColor = "#F7F3BC";
- document.getElementById("button1").style.backgroundImage = "url(../../../css/img/1_backcircle_gray.png)";
- document.getElementById("button2").style.backgroundImage = "url(../../../css/img/2_backcircle_red.png)";
- document.getElementById("button3").style.backgroundImage = "url(../../../css/img/3_backcircle_gray.png)";
- document.getElementById("button1").src = "../../../css/img/1_backcircle_gray.png";
- document.getElementById("button2").src = "../../../css/img/2_backcircle_red.png";
- document.getElementById("button3").src = "../../../css/img/3_backcircle_gray.png";
- setCookie('backnumber', 2, 7);
- } else {
- /*body.style.backgroundImage = "url(../css/img/background3.png)";
- body.style.backgroundImage = "../css/img/background3.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(../../../css/img/background3.png)";
- document.getElementById("back").style.backgroundImage = "url(../../../css/img/background3.png)";
- document.getElementById("html-back").style.backgroundColor = "#DAEDD0";
- document.getElementById("back").style.backgroundColor = "#DAEDD0";
- document.getElementById("button1").style.backgroundImage = "url(../../../css/img/1_backcircle_gray.png)";
- document.getElementById("button2").style.backgroundImage = "url(../../../css/img/2_backcircle_gray.png)";
- document.getElementById("button3").style.backgroundImage = "url(../../../css/img/3_backcircle_red.png)";
- document.getElementById("button1").src = "../../../css/img/1_backcircle_gray.png";
- document.getElementById("button2").src = "../../../css/img/2_backcircle_gray.png";
- document.getElementById("button3").src = "../../../css/img/3_backcircle_red.png";
- setCookie('backnumber', 3, 7);
- }
- }
- //second
- function setBackground2(num) {
- if (screen.width < 768) {
- if (num < 2) {
- /*body.style.backgroundImage = "url(../css/img/background1.png)";
- body.style.backgroundImage = "../css/img/background1.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(../css/img/backgroundm1.png)";
- document.getElementById("back").style.backgroundImage = "url(../css/img/backgroundm1.png)";
- document.getElementById("html-back").style.backgroundColor = "#D6D6D6";
- document.getElementById("back").style.backgroundColor = "#D6D6D6";
- setCookie('mobile_backnumber', 1, 7);
- } else if (num < 3) {
- /*body.style.backgroundImage = "url(../css/img/background2.png)";
- body.style.backgroundImage = "../css/img/background2.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(../css/img/backgroundm2.png)";
- document.getElementById("back").style.backgroundImage = "url(../css/img/backgroundm2.png)";
- document.getElementById("html-back").style.backgroundColor = "#F7F3BC";
- document.getElementById("back").style.backgroundColor = "#F7F3BC";
- setCookie('mobile_backnumber', 2, 7);
- } else {
- /*body.style.backgroundImage = "url(../css/img/background3.png)";
- body.style.backgroundImage = "../css/img/background3.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(../css/img/backgroundm3.png)";
- document.getElementById("back").style.backgroundImage = "url(../css/img/backgroundm3.png)";
- document.getElementById("html-back").style.backgroundColor = "#DAEDD0";
- document.getElementById("back").style.backgroundColor = "#DAEDD0";
- setCookie('mobile_backnumber', 3, 7);
- }
- return;
- }
- if (num < 2) {
- /*body.style.backgroundImage = "url(../css/img/background1.png)";
- body.style.backgroundImage = "../css/img/background1.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(../css/img/background1.png)";
- document.getElementById("back").style.backgroundImage = "url(../css/img/background1.png)";
- document.getElementById("html-back").style.backgroundColor = "#D6D6D6";
- document.getElementById("back").style.backgroundColor = "#D6D6D6";
- document.getElementById("button1").style.backgroundImage = "url(../css/img/1_backcircle_red.png)";
- document.getElementById("button2").style.backgroundImage = "url(../css/img/2_backcircle_gray.png)";
- document.getElementById("button3").style.backgroundImage = "url(../css/img/3_backcircle_gray.png)";
- document.getElementById("button1").src = "../css/img/1_backcircle_red.png";
- document.getElementById("button2").src = "../css/img/2_backcircle_gray.png";
- document.getElementById("button3").src = "../css/img/3_backcircle_gray.png";
- setCookie('backnumber', 1, 7);
- } else if (num < 3) {
- /*body.style.backgroundImage = "url(../css/img/background2.png)";
- body.style.backgroundImage = "../css/img/background2.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(../css/img/background2.png)";
- document.getElementById("back").style.backgroundImage = "url(../css/img/background2.png)";
- document.getElementById("html-back").style.backgroundColor = "#F7F3BC";
- document.getElementById("back").style.backgroundColor = "#F7F3BC";
- document.getElementById("button1").style.backgroundImage = "url(../css/img/1_backcircle_gray.png)";
- document.getElementById("button2").style.backgroundImage = "url(../css/img/2_backcircle_red.png)";
- document.getElementById("button3").style.backgroundImage = "url(../css/img/3_backcircle_gray.png)";
- document.getElementById("button1").src = "../css/img/1_backcircle_gray.png";
- document.getElementById("button2").src = "../css/img/2_backcircle_red.png";
- document.getElementById("button3").src = "../css/img/3_backcircle_gray.png";
- setCookie('backnumber', 2, 7);
- } else {
- /*body.style.backgroundImage = "url(../css/img/background3.png)";
- body.style.backgroundImage = "../css/img/background3.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(../css/img/background3.png)";
- document.getElementById("back").style.backgroundImage = "url(../css/img/background3.png)";
- document.getElementById("html-back").style.backgroundColor = "#DAEDD0";
- document.getElementById("back").style.backgroundColor = "#DAEDD0";
- document.getElementById("button1").style.backgroundImage = "url(../css/img/1_backcircle_gray.png)";
- document.getElementById("button2").style.backgroundImage = "url(../css/img/2_backcircle_gray.png)";
- document.getElementById("button3").style.backgroundImage = "url(../css/img/3_backcircle_red.png)";
- document.getElementById("button1").src = "../css/img/1_backcircle_gray.png";
- document.getElementById("button2").src = "../css/img/2_backcircle_gray.png";
- document.getElementById("button3").src = "../css/img/3_backcircle_red.png";
- setCookie('backnumber', 3, 7);
- }
- }
- //third/folder
- function setBackground3(num) {
- if (screen.width < 768) {
- if (num < 2) {
- /*body.style.backgroundImage = "url(../css/img/background1.png)";
- body.style.backgroundImage = "../css/img/background1.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(../../css/img/backgroundm1.png)";
- document.getElementById("back").style.backgroundImage = "url(../../css/img/backgroundm1.png)";
- document.getElementById("html-back").style.backgroundColor = "#D6D6D6";
- document.getElementById("back").style.backgroundColor = "#D6D6D6";
- setCookie('mobile_backnumber', 1, 7);
- } else if (num < 3) {
- /*body.style.backgroundImage = "url(../css/img/background2.png)";
- body.style.backgroundImage = "../css/img/background2.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(../../css/img/backgroundm2.png)";
- document.getElementById("back").style.backgroundImage = "url(../../css/img/backgroundm2.png)";
- document.getElementById("html-back").style.backgroundColor = "#F7F3BC";
- document.getElementById("back").style.backgroundColor = "#F7F3BC";
- setCookie('mobile_backnumber', 2, 7);
- } else {
- /*body.style.backgroundImage = "url(../css/img/background3.png)";
- body.style.backgroundImage = "../css/img/background3.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(../../css/img/backgroundm3.png)";
- document.getElementById("back").style.backgroundImage = "url(../../css/img/backgroundm3.png)";
- document.getElementById("html-back").style.backgroundColor = "#DAEDD0";
- document.getElementById("back").style.backgroundColor = "#DAEDD0";
- setCookie('mobile_backnumber', 3, 7);
- }
- return;
- }
- if (num < 2) {
- /*body.style.backgroundImage = "url(../css/img/background1.png)";
- body.style.backgroundImage = "../css/img/background1.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(../../css/img/background1.png)";
- document.getElementById("back").style.backgroundImage = "url(../../css/img/background1.png)";
- document.getElementById("html-back").style.backgroundColor = "#D6D6D6";
- document.getElementById("back").style.backgroundColor = "#D6D6D6";
- document.getElementById("button1").style.backgroundImage = "url(../../css/img/1_backcircle_red.png)";
- document.getElementById("button2").style.backgroundImage = "url(../../css/img/2_backcircle_gray.png)";
- document.getElementById("button3").style.backgroundImage = "url(../../css/img/3_backcircle_gray.png)";
- document.getElementById("button1").src = "../../css/img/1_backcircle_red.png";
- document.getElementById("button2").src = "../../css/img/2_backcircle_gray.png";
- document.getElementById("button3").src = "../../css/img/3_backcircle_gray.png";
- setCookie('backnumber', 1, 7);
- } else if (num < 3) {
- /*body.style.backgroundImage = "url(../css/img/background2.png)";
- body.style.backgroundImage = "../css/img/background2.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(../../css/img/background2.png)";
- document.getElementById("back").style.backgroundImage = "url(../../css/img/background2.png)";
- document.getElementById("html-back").style.backgroundColor = "#F7F3BC";
- document.getElementById("back").style.backgroundColor = "#F7F3BC";
- document.getElementById("button1").style.backgroundImage = "url(../../css/img/1_backcircle_gray.png)";
- document.getElementById("button2").style.backgroundImage = "url(../../css/img/2_backcircle_red.png)";
- document.getElementById("button3").style.backgroundImage = "url(../../css/img/3_backcircle_gray.png)";
- document.getElementById("button1").src = "../../css/img/1_backcircle_gray.png";
- document.getElementById("button2").src = "../../css/img/2_backcircle_red.png";
- document.getElementById("button3").src = "../../css/img/3_backcircle_gray.png";
- setCookie('backnumber', 2, 7);
- } else {
- /*body.style.backgroundImage = "url(../css/img/background3.png)";
- body.style.backgroundImage = "../css/img/background3.png";*/
- document.getElementById("html-back").style.backgroundImage = "url(../../css/img/background3.png)";
- document.getElementById("back").style.backgroundImage = "url(../../css/img/background3.png)";
- document.getElementById("html-back").style.backgroundColor = "#DAEDD0";
- document.getElementById("back").style.backgroundColor = "#DAEDD0";
- document.getElementById("button1").style.backgroundImage = "url(../../css/img/1_backcircle_gray.png)";
- document.getElementById("button2").style.backgroundImage = "url(../../css/img/2_backcircle_gray.png)";
- document.getElementById("button3").style.backgroundImage = "url(../../css/img/3_backcircle_red.png)";
- document.getElementById("button1").src = "../../css/img/1_backcircle_gray.png";
- document.getElementById("button2").src = "../../css/img/2_backcircle_gray.png";
- document.getElementById("button3").src = "../../css/img/3_backcircle_red.png";
- setCookie('backnumber', 3, 7);
- }
- }
|