function SetCookie(name, value, days) {
    var expire = new Date ();
    expire.setTime (expire.getTime() + (24 * 60 * 60 * 1000) * days); 
    document.cookie = name + "=" + escape(value) + "; expires=" + expire.toGMTString(); 
}

function DeleteCookie(name) {
    var expire = new Date ();
    expire.setTime (expire.getTime() - (24 * 60 * 60 * 1000)); 
    document.cookie = name + "=; expires=" + expire.toGMTString(); 
}

function GetCookie(name) {
    var startIndex = document.cookie.indexOf(name); 
    if (startIndex != -1) {
        var endIndex = document.cookie.indexOf(";", startIndex); 
        if (endIndex == -1) endIndex = document.cookie.length; 
        return unescape(document.cookie.substring(startIndex+name.length+1, endIndex)); 
    } else {
		var it = ""
        return it; 
    }
}

function setActiveStyleSheet(title) {
  var i, a, main;
  for (i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if (a.getAttribute("rel") &&
        a.getAttribute("rel").indexOf("style") != -1 &&
        a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}
function getActiveStyleSheet() {
  var i, a;
  for (i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if (a.getAttribute("rel") &&
        a.getAttribute("rel").indexOf("style") != -1 &&
        a.getAttribute("title") &&
        !a.disabled
        ) return a.getAttribute("title");
  }
  return null;
}
function getPreferredStyleSheet() {
  var i, a;
  for (i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if (a.getAttribute("rel") &&
        a.getAttribute("rel").indexOf("style") != -1 &&
        a.getAttribute("rel").indexOf("alt") == -1 &&
        a.getAttribute("title")
        ) return a.getAttribute("title");
  }
  return null;
}


