anchor.diff:  device_type([]) ->
       text;
   device_type(Properties) when is_list(Properties) ->
  -    case proplists:get_value(parentId, Properties) of
  -        <<"desktopDevice">> -> desktop;
  -        _ ->
  +    case is_desktop(Properties) of
  +        true -> 
  +            desktop;
  +        false ->
               case proplists:get_value(id, Properties) of
  -                <<"desktopDevice">> -> desktop;
  -                <<"desktopCrawler">> -> desktop;
  -                <<"unknown">> -> desktop;
                   <<"genericTouchPhone">> -> phone;
                   <<"textDevice">> -> text;
                   _ -> check_tablet(Properties)
  
positive.code:     check_phone(Ps) ->
          case proplists:get_value(ajax_support_javascript, Ps, false) of
              true -> 
                  case is_touch_enabled(Ps) of
                      true -> phone;
                      false -> text
                  end;
              false -> text
          end.
  
      is_touch_enabled(Ps) ->
          case proplists:get_value(inputDevices, Ps) of
             Ds when is_list(Ds) -> 
                  lists:member(<<"touchscreen">>, Ds) orelse lists:member(<<"stylus">>, Ds);
             <<"touchscreen">> -> true;
             <<"stylus">> -> true;
             _ -> false
         end.
  
  
  %% @doc Test some known user-agent strings and the values they must return.
  
negative.code:     init/0,
      classify/1,
      device_type/1,
      has_pointer_device/1,
      
      test/0
  ]).
  