function setCookie(name, value, expires, path, domain, secure) {
 var curCookie = name + "=" + escape(value) +
   ((expires) ? "; expires=" + expires.toGMTString() : "") +
   ((path) ? "; path=" + path : "") +
   ((domain) ? "; domain=" + domain : "") +
   ((secure) ? "; secure" : "");
 document.cookie = curCookie;
}

function setTimeCookie() {
 var now = new Date();
 var offset = now.getTimezoneOffset();
 setCookie("time", offset, "", "/", ".nextaris.com", false);
}

function go() {
 tabs = document.navigation.mainMenu;
 destination = tabs.options[tabs.selectedIndex].value;
 if (destination)
  location.href = destination;
}

function win(url) {
 window.open(url, 'Nextaris', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=320,height=440,left=100,top=100'); 
}

function doScroll() {
 if (document.location.search.indexOf('scroll=') >= -1) {
  var search = document.location.search;
  var scroll = search.substr(search.indexOf('scroll=') + 7, search.length);
  scrollTo(0, scroll);
 }
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0)
      return "";
    }
  else {
    begin += 2;
  }
  var end = dc.indexOf(";", begin);
  if (end == -1) {
    end = dc.length;
  }
  return unescape(dc.substring(begin + prefix.length, end));
}
				    

