<!-- BEGIN

window.name = "main";

var popWin;
function loadUniquePage(page, win_name, properties) {
  if ( popWin && !popWin.closed && popWin.focus )
  {
    popWin.focus();
  }
  else
  {
    popWin = window.open(page,win_name,properties);
  }
  return false;
}

function Set_Cookie( name, value, expires, path, domain, secure )
{
  // set time, it's in milliseconds
  var today = new Date();
  today.setTime( today.getTime() );

  /*
    is expressed in seconds; for minutes add * 60; for hours add * 60 * 60; for days add * 60 * 60 * 24;
  */
  if ( expires )
  {
    expires = expires * 1000;
  }
  var expires_date = new Date( today.getTime() + (expires) );

  document.cookie = name + "=" +escape( value ) +
  ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
  ( ( path ) ? ";path=" + path : "" ) +
  ( ( domain ) ? ";domain=" + domain : "" ) +
  ( ( secure ) ? ";secure" : "" );
}

function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}

/*
if ( ! document.cookie.match('jstest') || readCookie('jstest') == 0 )
{
  // remember, these are the possible parameters for Set_Cookie:
  // name, value, expires, path, domain, secure
  Set_Cookie( 'jstest', '1', 3600, '/', '', '' );
}
*/
Set_Cookie( 'jstest', '1', 3600, '/', '', '' );

//  End -->

