Aucune description
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

operation.js 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. // JavaScript Document
  2. // クッキー保存 setCookie(クッキー名, クッキーの値, クッキーの有効日数); //
  3. function setCookie(c_name,value,expiredays){
  4. // pathの指定
  5. var cnt=0;
  6. /*var path = location.pathname;
  7. // pathをフォルダ毎に指定する場合のIE対策
  8. var paths = new Array();
  9. paths = path.split("/");
  10. if(paths[paths.length-1] != ""){
  11. paths[paths.length-1] = "";
  12. path = paths.join("/");
  13. }*/
  14. // 有効期限の日付
  15. var extime = new Date().getTime();
  16. var cltime = new Date(extime + (60*60*24*1000*expiredays));
  17. var exdate = cltime.toUTCString();
  18. // クッキーに保存する文字列を生成
  19. var s="";
  20. s += c_name +"="+ escape(value);// 値はエンコードしておく
  21. s += "; path=/"/*+ path*/;
  22. if(expiredays){
  23. s += "; expires=" +exdate+"; ";
  24. }else{
  25. s += "; ";
  26. }
  27. // クッキーに保存
  28. document.cookie=s;
  29. }
  30. // クッキーの値を取得 getCookie(クッキー名); //
  31. function getCookie(c_name){
  32. var st="";
  33. var ed="";
  34. if(document.cookie.length>0){
  35. // クッキーの値を取り出す
  36. st=document.cookie.indexOf(c_name + "=");
  37. if(st!=-1){
  38. st=st+c_name.length+1;
  39. ed=document.cookie.indexOf(";",st);
  40. if(ed==-1) ed=document.cookie.length;
  41. // 値をデコードして返す
  42. return unescape(document.cookie.substring(st,ed));
  43. }
  44. }
  45. return "";
  46. }
  47. // クッキーの値をアラートで表示
  48. function checkCookie(){
  49. if(getCookie('backnumber')){
  50. var setName = getCookie('backnumber');
  51. alert(setName);
  52. }
  53. }
  54. /*function GetCookie( name )
  55. {
  56. var result = null;
  57. var cookieName = name + '=';
  58. var allcookies = document.cookie;
  59. var position = allcookies.indexOf( cookieName );
  60. if( position != -1 )
  61. {
  62. var startIndex = position + cookieName.length;
  63. var endIndex = allcookies.indexOf( ';', startIndex );
  64. if( endIndex == -1 )
  65. {
  66. endIndex = allcookies.length;
  67. }
  68. result = decodeURIComponent(
  69. allcookies.substring( startIndex, endIndex ) );
  70. }
  71. return result;
  72. }
  73. */
  74. //直下
  75. function getBackgNumber(){
  76. var num=getCookie("backnumber");
  77. setBackground(num);
  78. }
  79. //second
  80. function getBackgNumber2(){
  81. var num=getCookie("backnumber");
  82. setBackground2(num);
  83. }
  84. //third/folder
  85. function getBackgNumber3(){
  86. var num=getCookie("backnumber");
  87. setBackground3(num);
  88. }
  89. //third/folder/folder
  90. function getBackgNumber3_2(){
  91. var num=getCookie("backnumber");
  92. setBackground3_2(num);
  93. }
  94. //直下
  95. function setBackground(num){
  96. if(num<2) {
  97. /*body.style.backgroundImage = "url(../css/img/background1.png)";
  98. body.style.backgroundImage = "../css/img/background1.png";*/
  99. document.getElementById("back").style.backgroundImage = "url(css/img/background1.png)";
  100. document.getElementById("button1").style.backgroundImage = "url(css/img/1_backcircle_red.png)";
  101. document.getElementById("button2").style.backgroundImage = "url(css/img/2_backcircle_gray.png)";
  102. document.getElementById("button3").style.backgroundImage = "url(css/img/3_backcircle_gray.png)";
  103. document.getElementById("button1").src = "css/img/1_backcircle_red.png";
  104. document.getElementById("button2").src = "css/img/2_backcircle_gray.png";
  105. document.getElementById("button3").src = "css/img/3_backcircle_gray.png";
  106. setCookie('backnumber',1,7);
  107. }else if(num<3){
  108. /*body.style.backgroundImage = "url(../css/img/background2.png)";
  109. body.style.backgroundImage = "../css/img/background2.png";*/
  110. document.getElementById("back").style.backgroundImage = "url(css/img/background2.png)";
  111. document.getElementById("button1").style.backgroundImage = "url(css/img/1_backcircle_gray.png)";
  112. document.getElementById("button2").style.backgroundImage = "url(css/img/2_backcircle_red.png)";
  113. document.getElementById("button3").style.backgroundImage = "url(css/img/3_backcircle_gray.png)";
  114. document.getElementById("button1").src = "css/img/1_backcircle_gray.png";
  115. document.getElementById("button2").src = "css/img/2_backcircle_red.png";
  116. document.getElementById("button3").src = "css/img/3_backcircle_gray.png";
  117. setCookie('backnumber',2,7);
  118. }else{
  119. /*body.style.backgroundImage = "url(../css/img/background3.png)";
  120. body.style.backgroundImage = "../css/img/background3.png";*/
  121. document.getElementById("back").style.backgroundImage = "url(css/img/background3.png)";
  122. document.getElementById("button1").style.backgroundImage = "url(css/img/1_backcircle_gray.png)";
  123. document.getElementById("button2").style.backgroundImage = "url(css/img/2_backcircle_gray.png)";
  124. document.getElementById("button3").style.backgroundImage = "url(css/img/3_backcircle_red.png)";
  125. document.getElementById("button1").src = "css/img/1_backcircle_gray.png";
  126. document.getElementById("button2").src = "css/img/2_backcircle_gray.png";
  127. document.getElementById("button3").src = "css/img/3_backcircle_red.png";
  128. setCookie('backnumber',3,7);
  129. }
  130. }
  131. //third/folder/folder
  132. function setBackground3_2(num){
  133. if(num<2) {
  134. /*body.style.backgroundImage = "url(../css/img/background1.png)";
  135. body.style.backgroundImage = "../css/img/background1.png";*/
  136. document.getElementById("back").style.backgroundImage = "url(../../../css/img/background1.png)";
  137. document.getElementById("button1").style.backgroundImage = "url(../../../css/img/1_backcircle_red.png)";
  138. document.getElementById("button2").style.backgroundImage = "url(../../../css/img/2_backcircle_gray.png)";
  139. document.getElementById("button3").style.backgroundImage = "url(../../../css/img/3_backcircle_gray.png)";
  140. document.getElementById("button1").src = "../../../css/img/1_backcircle_red.png";
  141. document.getElementById("button2").src = "../../../css/img/2_backcircle_gray.png";
  142. document.getElementById("button3").src = "../../../css/img/3_backcircle_gray.png";
  143. setCookie('backnumber',1,7);
  144. }else if(num<3){
  145. /*body.style.backgroundImage = "url(../css/img/background2.png)";
  146. body.style.backgroundImage = "../css/img/background2.png";*/
  147. document.getElementById("back").style.backgroundImage = "url(../../../css/img/background2.png)";
  148. document.getElementById("button1").style.backgroundImage = "url(../../../css/img/1_backcircle_gray.png)";
  149. document.getElementById("button2").style.backgroundImage = "url(../../../css/img/2_backcircle_red.png)";
  150. document.getElementById("button3").style.backgroundImage = "url(../../../css/img/3_backcircle_gray.png)";
  151. document.getElementById("button1").src = "../../../css/img/1_backcircle_gray.png";
  152. document.getElementById("button2").src = "../../../css/img/2_backcircle_red.png";
  153. document.getElementById("button3").src = "../../../css/img/3_backcircle_gray.png";
  154. setCookie('backnumber',2,7);
  155. }else{
  156. /*body.style.backgroundImage = "url(../css/img/background3.png)";
  157. body.style.backgroundImage = "../css/img/background3.png";*/
  158. document.getElementById("back").style.backgroundImage = "url(../../../css/img/background3.png)";
  159. document.getElementById("button1").style.backgroundImage = "url(../../../css/img/1_backcircle_gray.png)";
  160. document.getElementById("button2").style.backgroundImage = "url(../../../css/img/2_backcircle_gray.png)";
  161. document.getElementById("button3").style.backgroundImage = "url(../../../css/img/3_backcircle_red.png)";
  162. document.getElementById("button1").src = "../../../css/img/1_backcircle_gray.png";
  163. document.getElementById("button2").src = "../../../css/img/2_backcircle_gray.png";
  164. document.getElementById("button3").src = "../../../css/img/3_backcircle_red.png";
  165. setCookie('backnumber',3,7);
  166. }
  167. }
  168. //second
  169. function setBackground2(num){
  170. if(num<2) {
  171. /*body.style.backgroundImage = "url(../css/img/background1.png)";
  172. body.style.backgroundImage = "../css/img/background1.png";*/
  173. document.getElementById("back").style.backgroundImage = "url(../css/img/background1.png)";
  174. document.getElementById("button1").style.backgroundImage = "url(../css/img/1_backcircle_red.png)";
  175. document.getElementById("button2").style.backgroundImage = "url(../css/img/2_backcircle_gray.png)";
  176. document.getElementById("button3").style.backgroundImage = "url(../css/img/3_backcircle_gray.png)";
  177. document.getElementById("button1").src = "../css/img/1_backcircle_red.png";
  178. document.getElementById("button2").src = "../css/img/2_backcircle_gray.png";
  179. document.getElementById("button3").src = "../css/img/3_backcircle_gray.png";
  180. setCookie('backnumber',1,7);
  181. }else if(num<3){
  182. /*body.style.backgroundImage = "url(../css/img/background2.png)";
  183. body.style.backgroundImage = "../css/img/background2.png";*/
  184. document.getElementById("back").style.backgroundImage = "url(../css/img/background2.png)";
  185. document.getElementById("button1").style.backgroundImage = "url(../css/img/1_backcircle_gray.png)";
  186. document.getElementById("button2").style.backgroundImage = "url(../css/img/2_backcircle_red.png)";
  187. document.getElementById("button3").style.backgroundImage = "url(../css/img/3_backcircle_gray.png)";
  188. document.getElementById("button1").src = "../css/img/1_backcircle_gray.png";
  189. document.getElementById("button2").src = "../css/img/2_backcircle_red.png";
  190. document.getElementById("button3").src = "../css/img/3_backcircle_gray.png";
  191. setCookie('backnumber',2,7);
  192. }else{
  193. /*body.style.backgroundImage = "url(../css/img/background3.png)";
  194. body.style.backgroundImage = "../css/img/background3.png";*/
  195. document.getElementById("back").style.backgroundImage = "url(../css/img/background3.png)";
  196. document.getElementById("button1").style.backgroundImage = "url(../css/img/1_backcircle_gray.png)";
  197. document.getElementById("button2").style.backgroundImage = "url(../css/img/2_backcircle_gray.png)";
  198. document.getElementById("button3").style.backgroundImage = "url(../css/img/3_backcircle_red.png)";
  199. document.getElementById("button1").src = "../css/img/1_backcircle_gray.png";
  200. document.getElementById("button2").src = "../css/img/2_backcircle_gray.png";
  201. document.getElementById("button3").src = "../css/img/3_backcircle_red.png";
  202. setCookie('backnumber',3,7);
  203. }
  204. }
  205. //third/folder
  206. function setBackground3(num){
  207. if(num<2) {
  208. /*body.style.backgroundImage = "url(../css/img/background1.png)";
  209. body.style.backgroundImage = "../css/img/background1.png";*/
  210. document.getElementById("back").style.backgroundImage = "url(../../css/img/background1.png)";
  211. document.getElementById("button1").style.backgroundImage = "url(../../css/img/1_backcircle_red.png)";
  212. document.getElementById("button2").style.backgroundImage = "url(../../css/img/2_backcircle_gray.png)";
  213. document.getElementById("button3").style.backgroundImage = "url(../../css/img/3_backcircle_gray.png)";
  214. document.getElementById("button1").src = "../../css/img/1_backcircle_red.png";
  215. document.getElementById("button2").src = "../../css/img/2_backcircle_gray.png";
  216. document.getElementById("button3").src = "../../css/img/3_backcircle_gray.png";
  217. setCookie('backnumber',1,7);
  218. }else if(num<3){
  219. /*body.style.backgroundImage = "url(../css/img/background2.png)";
  220. body.style.backgroundImage = "../css/img/background2.png";*/
  221. document.getElementById("back").style.backgroundImage = "url(../../css/img/background2.png)";
  222. document.getElementById("button1").style.backgroundImage = "url(../../css/img/1_backcircle_gray.png)";
  223. document.getElementById("button2").style.backgroundImage = "url(../../css/img/2_backcircle_red.png)";
  224. document.getElementById("button3").style.backgroundImage = "url(../../css/img/3_backcircle_gray.png)";
  225. document.getElementById("button1").src = "../../css/img/1_backcircle_gray.png";
  226. document.getElementById("button2").src = "../../css/img/2_backcircle_red.png";
  227. document.getElementById("button3").src = "../../css/img/3_backcircle_gray.png";
  228. setCookie('backnumber',2,7);
  229. }else{
  230. /*body.style.backgroundImage = "url(../css/img/background3.png)";
  231. body.style.backgroundImage = "../css/img/background3.png";*/
  232. document.getElementById("back").style.backgroundImage = "url(../../css/img/background3.png)";
  233. document.getElementById("button1").style.backgroundImage = "url(../../css/img/1_backcircle_gray.png)";
  234. document.getElementById("button2").style.backgroundImage = "url(../../css/img/2_backcircle_gray.png)";
  235. document.getElementById("button3").style.backgroundImage = "url(../../css/img/3_backcircle_red.png)";
  236. document.getElementById("button1").src = "../../css/img/1_backcircle_gray.png";
  237. document.getElementById("button2").src = "../../css/img/2_backcircle_gray.png";
  238. document.getElementById("button3").src = "../../css/img/3_backcircle_red.png";
  239. setCookie('backnumber',3,7);
  240. }
  241. }