// fm.util.js // ver. 1.01 // 2010 Jun 08 Tu //

fm.Cookie_set = function( argName, argValue, argDays ) {
  var expires = new Date();
  expires.setTime(expires.getTime() + (1000 * 86400 * argDays)); // 1 day
  var cookieStr = argName + "=" + argValue + "; expires=" + expires.toGMTString() +  "; path=/";
  document.cookie = cookieStr;
  fm.deb += "cookieStr: " + cookieStr + "\n";
};

fm.Elem_getAttr = function( argElem, argAttrName ) {
  var result = null;
  //
  if (argElem != null) {
    var attr = argElem.getAttributeNode( argAttrName );
    //
    if (attr != null) {
       result = attr.value;
    }
  }
  return result;
};

fm.Select_getSelValue = function( argSelectId ) {
  var elemSel = document.getElementById( argSelectId );
  //
  if (!elemSel) {
    alert( "element is null" );
    return null;
  }
  var selInd  = elemSel.selectedIndex;
  var opt     = elemSel.options[ selInd ];
  return opt.value;
};

