﻿


Loadcookie();

function Loadcookie()
{
 for(var i=0;i<groupcount;i++)
      {
          var number=i+1;      
          var cookievaluecontent=GetCookie("stylechangecookiecontent"+number);
          if(cookievaluecontent!=undefined)
          {
          //link
          var styleContr = document.getElementById("sd_stylechange_link"+number);
          styleContr.href =stylechangeskinpath+cookievaluecontent;
         }
      }

}
     //设定cookie值  
 function SetCookie(name, value, domain) {  
     //IE Cookie Bug 替代方案
    var cookie_path = window.location.pathname;
    var cookie_name = name;
    cookie_path = cookie_path.substring(0, cookie_path.lastIndexOf('/') + 1);
    var cookie_value = value;
    expires = new Date();
    expires.setTime(expires.getTime() + 86400 * 1000);

    document.cookie = cookie_name + "=" + encodeURIComponent(cookie_value)
		    + "; expires=" + expires.toGMTString() + "; path=" + cookie_path;
 }//:$ 
//    function SetCookie(Cookie_name,Cookie_value)　　
//    {　　
//　    var Then = new Date()　　
//　    Then.setTime(Then.getTime() + 24*3600000 ) //小时　　
//　    document.cookie = Cookie_name+"="+Cookie_value+";expires="+ Then.toGMTString()　　
//　
//    }　　
    function GetCookie(Cookie_name)　　
     {//获取单个cookies
    // alert(document.cookie);
         var search = Cookie_name + "="
          if (document.cookie.length > 0) { // if there are any cookies
                    offset = document.cookie.indexOf(search) 
                    if (offset != -1) { // if cookie exists 
                              offset += search.length 
                              // set index of beginning of value
                              end = document.cookie.indexOf(";", offset) 
                              // set index of end of cookie value
                              if (end == -1) 
                                        end = document.cookie.length
                                      //  alert(unescape(document.cookie.substring(offset, end)));
                              return unescape(document.cookie.substring(offset, end))
                    } 
          }

    }　　
    
    

    
    function MoveCookie(Cookie_name)　　
    {　　
　    document.cookie = Cookie_name+"=;expires=Fri, 02-Jan-1970 00:00:00 GMT";　　
    }　　
