function setCookie( p_name, p_value, p_expires, p_path, p_domain, p_secure ) 
{
  var today = new Date();
  today.setTime( today.getTime() );

  if ( p_expires ) {
   p_expires = p_expires * 1000 * 60 * 60 * 24;
  }

  var p_expires_date = new Date( today.getTime() + (p_expires) );

  document.cookie = p_name + "=" +escape( p_value ) +
  ( ( p_expires ) ? ";expires=" + p_expires_date.toGMTString() : "" ) + 
  ( ( p_path ) ? ";path=" + p_path : "" ) + 
  ( ( p_domain ) ? ";domain=" + p_domain : "" ) +
  ( ( p_secure ) ? ";secure" : "" );
}


function getCookie( p_name ) {
  var start = document.cookie.indexOf( p_name + "=" );
  var len = start + p_name.length + 1;

  if ( ( !start ) && ( p_name != document.cookie.substring( 0, p_name.length ) ) )
  {
    return null;
  }

  if ( start == -1 ) return null;

  var end = document.cookie.indexOf( ";", len );
  if ( end == -1 ) end = document.cookie.length;
  return unescape( document.cookie.substring( len, end ) );
}

function setPage( p_value ) {
//  setCookie( "Page", "'p_value'", 365, "/", ".calmarineelectronics.com", "");
  setCookie( "Page", p_value, 365, "/", ".calmarineelectronics.com", "");
}

function getPage( p_name ) {
  var name = getCookie( p_name ) ;
  return name; 
}