// JavaScript Document


/*******************************************************************************
**
** This function displays prev and/or next buttons.
**
*******************************************************************************/


function display_buttons(prevLink,nextLink)
{

	s =  "<table border=0 width=100% cellpadding=0 cellspacing=0><tr>";

	if (prevLink != "")
		s =  s + "<td class=nav align=right><a href='" + prevLink + "'>&#171; LAST</a></td>";
	else
		s =  s + "<td class=nav align=right>&#171; LAST</td>";
	if (nextLink != "")
		s =  s + "<td class=nav><a href='" + nextLink + "'>NEXT &#187;</a></td>";
	else
		s =  s + "<td class=nav>NEXT &#187;</td>";

	s =  s + "</tr></table>";

	return s;
	
}

/*******************************************************************************
**
** This function displays the footer.
**
*******************************************************************************/


function footer()
{

	return "<p class=footer>Copyright © 2005 Moberg Research, Inc.</p>";

	
}

/**********************************************************************
**  Function: get_params()
**  Description: This function is used to get the parameters from the
**               query string
**********************************************************************/
function get_params()
{
   var strSearch = window.location.search;

   var idx = strSearch.indexOf('?');
   if (idx != -1) 
      {
         var pairs = strSearch.substring(idx+1, strSearch.length).split('&');
         for (var i=0; i<pairs.length; i++) 
         {
            nameVal = pairs[i].split('=');
            g_params[nameVal[0]] = unescape(nameVal[1]);
         }
      }
}

/*******************************************************************************
**
** This function sets a cookie
**
*******************************************************************************/


function set_cookie(cookieName,cookieValue,nDays) 
{
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=7;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}

/*******************************************************************************
**
** This function sets a cookie
**
*******************************************************************************/

function read_cookie(cookieName) {
 var theCookie=""+document.cookie;
 var ind=theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return ""; 
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length; 
 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}


