  function NewWindow(u,n,w,h,f,p,x,y) {
    var ws=window.screen?1:0,m=Math,C='center',R='random',M='custom',sw=screen.availWidth,sh=screen.availHeight,T=(p==C&&ws)?(sh-h)/2:(p==R&&ws)?(m.floor(m.random()*(sh-h))):(p==M)?y:100,L=(p==C&&ws)?(sw-w)/2:(p==R&&ws)?(m.floor(m.random()*(sw-w))):(p==M)?x:100,s='scrollbars,width='+w+',height='+h+',top='+T+',left='+L;s+=(!f||f=='')?'':','+f;

    if(x) {
      window.location=x;
    }

    browser_version= parseInt(navigator.appVersion);
    browser_type = navigator.appName;

    if (browser_type == "Microsoft Internet Explorer") {
      // ie 7
      win=window.open(u);
    } else {
      win=window.open(u,n,s);

      if(win.focus) {
        win.focus();
      }
    }

  }

  function setCookie(name, value, expires, path, domain, secure) {
    document.cookie= name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  }

  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 null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
  }


  function setCookieDays(cookieName,cookieValue,nDays) {
    var today = new Date();
    var expire = new Date();
    if (nDays==null || nDays==0) nDays=1;
    expire.setTime(today.getTime() + 3600000*24*nDays);
    document.cookie = cookieName+"="+escape(cookieValue)
                    + ";expires="+expire.toGMTString();
  }

