// custom selector to use with jquery
$.browser.msie6 = $.browser.msie && /MSIE 6\.0/i.test(window.navigator.userAgent) && !/MSIE 7\.0/i.test(window.navigator.userAgent);



// tr:selectedRow    returns current selection
$.extend($.expr[':'], {
  selectedRow: function(a) {
    return $(a).hasClass("highlight");
  },

  containsRegExp : function(objNode, intStackIndex, arrProperties, arrNodeStack) {
    var $a = $(objNode);    
    var arrArguments = eval("([" + arrProperties[ 3 ] + "])");
    return $a.text().match(arrArguments[0])!=null;
  },

  // tr:selectByAirlineId('id')
  selectByAirlineId : function(objNode, intStackIndex, arrProperties, arrNodeStack)
  {
    var arrArguments = eval("([" + arrProperties[ 3 ] + "])");

    // Create a jQuery version of this node.
    var $obj = $( objNode );

    // Check to see if this node has any of the given
    // titles. If so, return true (we only need to find
    // one of the titles to qualify).
    for (var i = 0 ; i < arrArguments.length ; i++){

      // Check for title equality.
      if ($obj.attr( "airlineid" ) == arrArguments[ i ]){

        // We found a title match, return true to
        // indicate that this node should be included
        // in the returned jQuery stack.
        return( true );

      }

    }

    // If we have made it this far, then we found no
    // match. Return false to indicate that this node
    // did not match our selector.
    return( false );
  },


  // tr:selectByGroup('id')
  selectByGroup : function(objNode, intStackIndex, arrProperties, arrNodeStack)
  {
    var arrArguments = eval("(['" + arrProperties[ 3 ] + "'])");
//    var arrArguments = arrProperties[ 3 ];

    // Create a jQuery version of this node.
    var $obj = $( objNode );

    // Check to see if this node has any of the given
    // titles. If so, return true (we only need to find
    // one of the titles to qualify).
    for (var i = 0 ; i < arrArguments.length ; i++){

      // Check for title equality.
      if ($obj.attr( "group" ) == arrArguments[ i ]){

        // We found a title match, return true to
        // indicate that this node should be included
        // in the returned jQuery stack.
        return( true );

      }

    }

    // If we have made it this far, then we found no
    // match. Return false to indicate that this node
    // did not match our selector.
    return( false );
  },


  // search for Items with negative text indent
  negativeIndent: function(objNode)
  {
    var $this = $(objNode);
    var indent = $this.css('text-indent');

    return (indent && indent[0]=='-');
  }

});

