function WM_readCookie(name, NS_outputElement, IE_outputElement) {

  // if there's no cookie, don't do anything

  if(document.cookie != '') {

    var actualValue, outputElement, firstChar, lastChar;


    // get the entire cookie string (this may have other name=value pairs in it

    var theBigCookie = document.cookie;

    // grab just this cookie from theBigCookie string

    // find the start of 'name'

    firstChar = theBigCookie.indexOf(name);

    // if you found it

    if(firstChar != -1) {

      // skip 'name' and '='

      firstChar += name.length + 1;

      // find the end of the value string (i.e. the next ';')

      lastChar = theBigCookie.indexOf(';', firstChar);

      if(lastChar == -1) lastChar = theBigCookie.length;

      // return the value

      actualValue = unescape(theBigCookie.substring(firstChar, lastChar));

    } else {

      // if there was no cookie, return false

      actualValue = false;

    }


    outputElement = (navigator.appName == 'Netscape')?NS_outputElement:IE_outputElement;

    //fix layer ref if not supported (thanks, Ken Sundermeyer!)

    if ((outputElement.indexOf('document.layers[')==0 && document.layers==null)|| (outputElement.indexOf('document.all[')   ==0 && document.all   ==null)) {

      outputElement = 'document'+outputElement.substring(outputElement.substring(0,outputElement.lastIndexOf('.')).lastIndexOf('.'),outputElement.length);

    }


    if(outputElement && actualValue) {
// thanks to Matthew Toledo for pointing out IE5 not handling some evals..
fehIE5=eval(outputElement);
fehIE5.value = actualValue;
    }

  }

}

function WM_setCookie (name, NS_value, IE_value, hours, path, domain, evalValue) {


    daValue = (navigator.appName == 'Netscape')?NS_value:IE_value;

    //fix layer ref if not supported (thanks, Ken Sundermeyer!)

    if ((daValue.indexOf('document.layers[')==0 && document.layers==null)|| (daValue.indexOf('document.all[')==0 && document.all==null)) {

      daValue = 'document'+daValue.substring(daValue.substring(0,daValue.lastIndexOf('.')).lastIndexOf('.'),daValue.length);

    }


    if(evalValue == 1) daValue = eval(daValue + '.value');


  // set the cookie, adding any parameters that were specified

  // (convert hours to milliseconds (*3600000) and then to a GMTString)

    document.cookie = name + '=' + escape(daValue) + ((hours)?(';expires=' + ((new Date((new Date()).getTime() + parseInt(hours)*3600000)).toGMTString())):'') + ((path)?';path=' + path:'') + ((domain)?';domain=' + domain:'');

}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
