123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- // 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);
- }
- }
- /*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(){
- var num=getCookie("backnumber");
- setBackground(num);
- }
- //second
- function getBackgNumber2(){
- var num=getCookie("backnumber");
- setBackground2(num);
- }
- //third/folder
- function getBackgNumber3(){
- var num=getCookie("backnumber");
- setBackground3(num);
- }
- //third/folder/folder
- function getBackgNumber3_2(){
- var num=getCookie("backnumber");
- setBackground3_2(num);
- }
-
- //直下
- function setBackground(num){
- if(num<2) {
- /*body.style.backgroundImage = "url(../css/img/background1.png)";
- body.style.backgroundImage = "../css/img/background1.png";*/
- document.getElementById("back").style.backgroundImage = "url(css/img/background1.png)";
- 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("back").style.backgroundImage = "url(css/img/background2.png)";
- 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("back").style.backgroundImage = "url(css/img/background3.png)";
- 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(num<2) {
- /*body.style.backgroundImage = "url(../css/img/background1.png)";
- body.style.backgroundImage = "../css/img/background1.png";*/
- document.getElementById("back").style.backgroundImage = "url(../../../css/img/background1.png)";
- 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("back").style.backgroundImage = "url(../../../css/img/background2.png)";
- 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("back").style.backgroundImage = "url(../../../css/img/background3.png)";
- 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(num<2) {
- /*body.style.backgroundImage = "url(../css/img/background1.png)";
- body.style.backgroundImage = "../css/img/background1.png";*/
- document.getElementById("back").style.backgroundImage = "url(../css/img/background1.png)";
- 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("back").style.backgroundImage = "url(../css/img/background2.png)";
- 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("back").style.backgroundImage = "url(../css/img/background3.png)";
- 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(num<2) {
- /*body.style.backgroundImage = "url(../css/img/background1.png)";
- body.style.backgroundImage = "../css/img/background1.png";*/
- document.getElementById("back").style.backgroundImage = "url(../../css/img/background1.png)";
- 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("back").style.backgroundImage = "url(../../css/img/background2.png)";
- 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("back").style.backgroundImage = "url(../../css/img/background3.png)";
- 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);
- }
- }
|