/* project ......: mountain stewards project  */
/* program.......: mtnstew.js                 */
/* author .......: mickey nardo               */            
/* circa ........: 01/2007                    */  


var windowCount = 0;
var browseCount = 0;

function dualWindows(iURL, iWidth, iHeight, jURL, jWidth, jHeight){
  var iWindow  = 'menubar=yes,';
      iWindow += 'width=';
      iWindow += iWidth;
      iWindow += ',height=';
      iWindow += iHeight;
  my_iWindow = open(iURL, 'iPage_'+windowCount, iWindow);
  var jWindow  = 'width=';
      jWindow += jWidth;
      jWindow += ',height=';
      jWindow += jHeight;
  my_jWindow = open(jURL, 'jPage_'+windowCount, jWindow);
  windowCount +=1}

function plainWindow(oURL, oWidth, oHeight){
  var oWindow  = 'resizable=yes,';
      oWindow += 'scrollbars=yes,';
      oWindow += 'width=';
      oWindow += oWidth;
      oWindow += ',height=';
      oWindow += oHeight;
  myWindow = open(oURL, 'oPage_'+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, "oURL_"+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'}