/* project ......: mountain stewards web site */
/* program.......: mtnstew.js                 */
/* author .......: mickey nardo               */            
/* circa ........: 01/2006                    */  


var windowCount = 0;
var browseCount = 0;

function plainWindow(oURL, oWidth, oHeight){
  var oWindow  = 'resizable=yes,';
      oWindow += 'scrollbars=yes,';
      oWindow += 'width=';
      oWindow += oWidth;
      oWindow += ',height=';
      oWindow += oHeight;
  myWindow = open(oURL, 'Page_'+windowCount, oWindow);
  windowCount +=1}

function browserWindow(oURL, oMenu, oToolbar, oLocation, oStatus, oWidth, oHeight){
  var oWindow  = '';
    if(oMenu==1){
      oWindow += 'menubar=yes,'}
    if(oToolbar==1){
      oWindow += 'toolbar=yes,'}
    if(oLocation==1){
      oWindow += 'location=yes,'}
    if(oStatus==1){
      oWindow += 'status=yes,'}
      oWindow += 'resizable=yes,';
      oWindow += 'scrollbars=yes,';
      oWindow += 'width=';
      oWindow += oWidth;
      oWindow += ',height=';
      oWindow += oHeight;
  myWindow = open(oURL, "URL_"+browseCount, oWindow);
  browseCount +=1}

function setCookie(name, value) {
  document.cookie = name + '=' + escape(value)}

function getCookie(name){
  var search = name + '=';
      if (document.cookie.length > 0){
        offset = document.cookie.indexOf(search);
        if (offset != -1){
          offset += search.length ;
          end = document.cookie.indexOf(';', offset);
            if (end == -1){
              end = document.cookie.length}
          return unescape(document.cookie.substring(offset, end))}
        else {return('')}}
      {return('')}}

function trimString(sInString) {
  sInString = sInString.replace( /^\s+/g, "" );
  sInString = sInString.replace( /\s+$/g, "" );
  return sInString}

function goPage(newPage, oldPage){
  setCookie('newPageKey', newPage);
  setCookie('currentKey', oldPage);
  parent.parent.frames[2].location='menu.php'}